pod has unbound immediate PersistentVolumeClaims (repeated 3 times) pod has unbound immediate PersistentVolumeClaims (repeated 3 times) kubernetes kubernetes

pod has unbound immediate PersistentVolumeClaims (repeated 3 times)


From the docs here

The storage for a given Pod must either be provisioned by a PersistentVolume Provisioner based on the requested storage class, or pre-provisioned by an admin.

There should be a StorageClass which can dynamically provision the PV and mention that storageClassName in the volumeClaimTemplates or there needs to be a PV which can satisfy the PVC.

volumeClaimTemplates:  - metadata:      name: elasticsearch-data-persistent-storage    spec:      accessModes: [ "ReadWriteOnce" ]      storageClassName: "standard"      resources:        requests:          storage: 10Gi


It looks like there is some issue with your PVC.

NAME                                                         STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGEelasticsearch-data-persistent-storage-elasticsearch-data-0   Pending                                      gp2            8h

As you can see your PV is also not created.I think there is an issue with your storage class.Looks like gp2 storage class is not available in your cluster.

Either run this yaml file if you are in AWS EKS

kind: StorageClassapiVersion: storage.k8s.io/v1metadata:  name: gp2  annotations:    storageclass.kubernetes.io/is-default-class: "true"provisioner: kubernetes.io/aws-ebsparameters:  type: gp2  fsType: ext4

or simply change the storage class to standard in GCP GKE


apiVersion: apps/v1beta1kind: StatefulSetmetadata:  namespace: default  name: elasticsearch-data  labels:    app: elasticsearch    role: dataspec:  serviceName: "elasticsearch-data"  replicas: 1  template:    metadata:      labels:        app: elasticsearch-data        role: data    spec:      containers:        - name: elasticsearch-data          image: docker.elastic.co/elasticsearch/elasticsearch:7.3.0          env:            - name: CLUSTER_NAME              value: elasticsearch            - name: NODE_NAME              value: elasticsearch-data            - name: NODE_LIST              value: elasticsearch-master,elasticsearch-data,elasticsearch-client            - name: MASTER_NODES              value: elasticsearch-master            - name: "ES_JAVA_OPTS"              value: "-Xms300m -Xmx300m"          ports:            - containerPort: 9300              name: transport          volumeMounts:            - name: config              mountPath: /usr/share/elasticsearch/config/elasticsearch.yml              readOnly: true              subPath: elasticsearch.yml            - name: elasticsearch-data-persistent-storage              mountPath: /data/db      volumes:        - name: config          configMap:            name: elasticsearch-data-config      initContainers:        - name: increase-vm-max-map          image: busybox          command: ["sysctl", "-w", "vm.max_map_count=262144"]          securityContext:            privileged: true  volumeClaimTemplates:    - metadata:        name: elasticsearch-data-persistent-storage        annotations:          volume.beta.kubernetes.io/storage-class: "standard"      spec:        accessModes: [ "ReadWriteOnce" ]        resources:          requests:            storage: 10Gi---

This worked for me. Like Avinash said I simply changed the storage class to standard in GCP GKE