Skip to content

Instantly share code, notes, and snippets.

@jmrobles
Created September 11, 2022 18:43
Show Gist options
  • Save jmrobles/1aa9920a648ff06c34ac738f116c6688 to your computer and use it in GitHub Desktop.
Save jmrobles/1aa9920a648ff06c34ac738f116c6688 to your computer and use it in GitHub Desktop.
ElasticSearch Deployment
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elastic-pvc
namespace: default
labels:
app: elastic-pvc
spec:
storageClassName: nfs-client
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: elastic
namespace: default
labels:
app: elastic
spec:
selector:
matchLabels:
app: elastic
replicas: 1
template:
metadata:
labels:
app: elastic
spec:
containers:
- name: elastic
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 1000m
memory: 1024Mi
limits:
cpu: 1000m
memory: 2048Mi
env:
- name: discovery.type
value: "single-node"
ports:
- containerPort: 9200
name: elastic-port
- containerPort: 9300
name: elastic-intra
volumeMounts:
- name: elastic-data
mountPath: /usr/share/elasticsearch/data
volumes:
- name: elastic-data
persistentVolumeClaim:
claimName: elastic-pvc
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: elastic-svc
namespace: default
spec:
selector:
app: elastic
clusterIP: None
ports:
- port: 9200
name: rest
- port: 9300
name: intra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment