How to setup storage for my elasticsearch setup on GKE?

1/7/2019

I have setup Elasticsearch in single node in GKE how to add storage for my elasticsearch data.

-- Harshdeep Kanhai
elasticsearch
google-cloud-platform
google-kubernetes-engine

1 Answer

1/7/2019

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.

-- Milad
Source: StackOverflow