Hi..
I am running elastic on kubernetes cluster. My Yaml is as below but this is not persisting the data after elastic restarts. What should i do to persist it
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: elasticsearch-volume
spec:
accessModes:
- ReadWriteMany
storageClassName: "standard-nfs"
resources:
requests:
storage: 8Gi
-----------------
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: elasticsearch
namespace: bb
labels:
k8s-app: elasticsearch
spec:
serviceName: elasticsearch
replicas: 1
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
k8s-app: elasticsearch
template:
metadata:
labels:
k8s-app: elasticsearch
spec:
containers:
- image: elasticsearch:7.10.1
name: elasticsearch
ports:
- containerPort: 9200
name: db
protocol: TCP
- containerPort: 9300
name: transport
protocol: TCP
volumeMounts:
- name: elasticsearch
mountPath: /data
volumes:
- name: elasticsearch
persistentVolumeClaim:
claimName: elasticsearch-volume
---
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
namespace: bb
labels:
k8s-app: elasticsearch
spec:
ports:
- port: 9200
protocol: TCP
targetPort: db
selector:
k8s-app: elasticsearch