I have setup Elasticsearch in single node in GKE how to add storage for my elasticsearch data.
You need to add a PersistentVolumeClaims (pvc) to the pod. A PersistentVolumeClaim is a request for and claim to a PersistentVolume resource and pods use claims as Volumes. In this following example manifest describes a request for a 30 GiB disk whose access mode allows it to be mounted by one Pod at a time in read/write mode:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: helloweb-disk
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi
You can find more information about PersistentVolumes and PersistentVolumeClaims in Kubernetes here.