kubernetes dynamic pv with aws is in pending

0

I am creating redis-cluster on kube with aws-gp2 persistent volume. I was using redis-cluster.yml
Link: https://raw.githubusercontent.com/sanderploegsma/redis-cluster/master/redis-cluster.yml

I have created Storage Class according to this https://kubernetes.io/docs/concepts/storage/storage-classes/ , for dynamic persistence volume creation.

This is my StorageClass definition

    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
      name: aws-gp2
    provisioner: kubernetes.io/aws-ebs
    parameters:
      type: gp2
      zones: us-west-2a, us-west-2b, us-west-2c
      fsType: ext4
    reclaimPolicy: Retain
    allowVolumeExpansion: true

When I try to create cluster volume creation stuck at pending state, after checking logs found this

$ kubectl -n staging describe pvc data-redis-cluster-0
Name:          data-redis-cluster-0
Namespace:     staging
StorageClass:
Status:        Pending
Volume:
Labels:        app=redis-cluster
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
Events:
  Type    Reason         Age                From                         Message
  ----    ------         ----               ----                         -------
  Normal  FailedBinding  13s (x11 over 2m)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
$ kubectl -n staging get events
LAST SEEN   FIRST SEEN   COUNT     NAME                                    KIND                    SUBOBJECT   TYPE      REASON             SOURCE                        MESSAGE
10s         10s          1         redis-cluster.15816c6dc1d6c03a          StatefulSet                         Normal    SuccessfulCreate   statefulset-controller        create Claim data-redis-cluster-0 Pod redis-cluster-0 in StatefulSet redis-cluster success
10s         10s          1         redis-cluster.15816c6dc2226fe0          StatefulSet                         Normal    SuccessfulCreate   statefulset-controller        create Pod redis-cluster-0 in StatefulSet redis-cluster successful
8s          10s          3         data-redis-cluster-0.15816c6dc1dfd0cb   PersistentVolumeClaim               Normal    FailedBinding      persistentvolume-controller   no persistent volumes available for this claim and no storage class is set
3s          10s          5         redis-cluster-0.15816c6dc229258d        Pod                                 Warning   FailedScheduling   default-scheduler             pod has unbound PersistentVolumeClaims (repeated 4 times)

someone point out what is wrong here ?

stackoverflow : https://stackoverflow.com/questions/54579644/kubernetes-dynamic-pv-with-aws-is-in-pending

royx
gefragt vor 5 Jahren5011 Aufrufe
3 Antworten
1

As the message indicates no storage class exists.
no persistent volumes available for this claim and no storage class is set

What is Pod configuration for storage class?

dvohra
beantwortet vor 5 Jahren
0

dvohra wrote:
As the message indicates no storage class exists.
no persistent volumes available for this claim and no storage class is set

What is Pod configuration for storage class?

I am using StatefulSet and this is the volumeClaimTemplates from https://raw.githubusercontent.com/sanderploegsma/redis-cluster/master/redis-cluster.yml

volumeClaimTemplates:
  - metadata:
      name: data
      labels:
        name: redis-cluster
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 100Mi
royx
beantwortet vor 5 Jahren
0

after adding storageClassName: aws-gp2 to volumeClaimTemplates, everything resolved

      volumeClaimTemplates:
      - metadata:
          namespace: staging
          name: data
          labels:
            name: redis-cluster
        spec:
          accessModes: [ "ReadWriteOnce" ]
          storageClassName: aws-gp2
          resources:
            requests:
              storage: 100Mi
royx
beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen