Cluster information:
Kubernetes version: 1.14
Cloud being used: (put bare-metal if not on a public cloud)
Installation method: ECK
Host OS: Linux
I am trying to add Elasticsearch to the cluster. But whenever I apply the changes again my data is lost.
My yaml file for elastic search is as follow …
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: elasticsearch-uat
namespace: k8
labels:
component: elasticsearch-uat
spec:
replicas: 1
serviceName: elasticsearch-uat
template:
metadata:
labels:
component: elasticsearch-uat
spec:
initContainers:
- name: init-sysctl
image: busybox
imagePullPolicy: IfNotPresent
command: ["sysctl", "-w", "vm.max_map_count=262144"]
securityContext:
privileged: true
nodeSelector:
name: elasticsearch-uat
containers:
- name: es
securityContext:
capabilities:
add:
- IPC_LOCK
image: 559076975273.dkr.ecr.us-west-2.amazonaws.com/elasticsearch-s3:v2
env:
- name: "CLUSTER_NAME"
value: "es-cluster_uat"
- name: "DISCOVERY_SERVICE"
value: "elasticsearch_uat"
- name: NETWORK_HOST
value: "_eth0_"
- name: ES_JAVA_OPTS
value: -Xms256m -Xmx256m
- name: AWS_REGION
value: us-west-2
- name: AWS_ACCESS_KEY
valueFrom:
secretKeyRef:
name: global-env
key: aws-access-key
- name: AWS_SECRET_KEY
valueFrom:
secretKeyRef:
name: global-env
key: aws-secret-key
ports:
- containerPort: 9200
name: http
protocol: TCP
- containerPort: 9300
name: transport
protocol: TCP
volumeMounts:
- mountPath: /data
name: es-storage-uat
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
namespace: k8
name: es-storage-uat
spec:
storageClassName: gp2
accessModes: [ ReadWriteOnce ]
resources:
requests:
storage: 2Gi
Please help me to understand this concept. I do not want my data to loose in any condition.
Thanks in advance.