Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Last active Aug 23, 2021
Embed
What would you like to do?
elastic single node k8s
apiVersion: v1
kind: ConfigMap
metadata:
labels:
product: k8s-elastic
name: elastic-config
data:
elasticsearch.yaml: |
discovery.type: single-node
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: elasticsearch
spec:
selector:
matchLabels:
run: elasticsearch
template:
metadata:
labels:
name: elasticsearch
run: elasticsearch
spec:
containers:
- image: docker.elastic.co/elasticsearch/elasticsearch:6.0.0
name: elasticsearch
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9200
protocol: TCP
volumeMounts:
- name: elastic-config
mountPath: /etc/elasticsearch/elasticsearch.yaml
subPath: elasticsearch.yaml
volumes:
- name: elastic-config
configMap:
name: elastic-config
---
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
labels:
run: elasticsearch
spec:
ports:
- port: 9200
targetPort: 9200
protocol: TCP
selector:
run: elasticsearch
type: ClusterIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment