I am trying to deploy a sample postgres on k8s cluster using helm. After deploying the application I ran kubectl get pods and then my application was in pending state because of this error "pod has unbound immediate PersistentVolumeClaims."

Please check the logs:
Name:           postgres-7b448c59b9-5zbpd
Namespace:      default
Priority:       0
Node:           <none>
Labels:         app=postgres 
                group=db
                pod-template-hash=7b448c59b9  
Annotations:    <none>
Status:         Pending 
IP:             
IPs:            <none>
Controlled By:  ReplicaSet/postgres-7b448c59b9
Containers:
  postgres:
    Image:      postgres:9.6-alpine
    Port:       5432/TCP
    Host Port:  0/TCP
    Environment Variables from:
      postgres-config  ConfigMap  Optional: false
    Environment:       <none>
    Mounts:
      /var/lib/postgresql/data from postgres-storage (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-9v2fd (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  postgres-storage:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  postgres-persistent-volume-claim
    ReadOnly:   false
  default-token-9v2fd:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-9v2fd
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:   
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  58s (x2 over 58s)  default-scheduler  0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims.
1

There are 1 best solutions below

1
On

This means your pods are requesting more PVC storage than actual it's present. makes sure you assign PVC correct to pods.

You can check the PVC

kubectl get pvc