counter-app icon indicating copy to clipboard operation
counter-app copied to clipboard

Pod has unbound immediate PersistentVolumeClaims

Open tuv7041 opened this issue 4 years ago • 3 comments

Hi, I'm trying your tutorial, and when applying either the replicaset or the daemonset, the pods get scheduled but they stay on "pending". kubectl describe pods counter-app-6pxrw (a pod in the replicaset) shows the following:

Name:           counter-app-6pxrw
Namespace:      default
Priority:       0
Node:           <none>
Labels:         app=counter
                controller-revision-hash=686bfcc966
                pod-template-generation=1
Annotations:    <none>
Status:         Pending
IP:
IPs:            <none>
Controlled By:  DaemonSet/counter-app
Containers:
  counter:
    Image:        kahootali/counter:1.0
    Port:         <none>
    Host Port:    <none>
    Environment:  <none>
    Mounts:
      /app/ from counter (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-bx7rz (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  counter:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  counter
    ReadOnly:   false
  default-token-bx7rz:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-bx7rz
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     :NoSchedule
                 node.kubernetes.io/disk-pressure:NoSchedule
                 node.kubernetes.io/memory-pressure:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute
                 node.kubernetes.io/pid-pressure:NoSchedule
                 node.kubernetes.io/unreachable:NoExecute
                 node.kubernetes.io/unschedulable:NoSchedule
Events:
  Type     Reason            Age        From               Message
  ----     ------            ----       ----               -------
  **Warning  FailedScheduling  <unknown>  default-scheduler  running "VolumeBinding" filter plugin for pod "counter-app-6pxrw": pod has unbound immediate PersistentVolumeClaims**

I get the same error for the daemonset.

tuv7041 avatar Jun 12 '20 12:06 tuv7041

Hi @tuv7041, do you have a StorageClass in your cluster? Please share output of kubectl get storageclass And where is your cluster hosted, I mean any cloud or minikube?

kahootali avatar Jun 16 '20 08:06 kahootali

I have the same problem. kubectl get storageclass --all-namespaces No resources found

My K8S is on 3 VMs

shitana avatar Nov 29 '20 15:11 shitana

I saw that that persistentvolumeclaims is created but its status is pending

kubectl get persistentvolumeclaims
NAME                STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
counter             Pending                                      efs            4h42m
counter-counter-0   Pending                                      efs            8m57s

Going in depth, i think the issue is storageclass.storage.k8s.io "efs" not found:

kubectl describe persistentvolumeclaims counter
Name:          counter
Namespace:     default
StorageClass:  efs
Status:        Pending
.....
Events:
  Type     Reason              Age                      From                         Message
  ----     ------              ----                     ----                         -------
  Warning  ProvisioningFailed  3m4s (x1122 over 4h43m)  persistentvolume-controller  storageclass.storage.k8s.io "efs" not found

Could you please add to your tutorial how to create properly the needed volume ?

shitana avatar Nov 29 '20 15:11 shitana