# Pods in Pending state - 0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 No preemption victims found for incoming pod

**URL:** <https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257>\
**Category:** Percona Operator for MongoDB\
**Tags:** mongodb, psmdb-operator\
**Created:** [December 19, 2023, 7:04pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257 "2023-12-19T19:04:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![athreyavc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/athreyavc/32/14652_2.png) [@athreyavc](https://forums.percona.com/u/athreyavc)\
**Post date:** [December 19, 2023, 7:04pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/1 "2023-12-19T19:04:50Z")

</div>

Hi,  
I am trying to setup a MongoDB cluster on a small Kubernetes cluster using Percona Operator for MongoDB. I have followed the steps in [Generic Kubernetes installation - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/kubernetes.html). While the operator is running fine, I am unable to create the Replica set.

```auto
❯ kubectl get pods
NAME READY STATUS RESTARTS AGE
minimal-cluster-cfg-0 0/1 Pending 0 5m38s
minimal-cluster-mongos-0 0/1 Running 1 (58s ago) 5m27s
minimal-cluster-rs0-0 0/1 Pending 0 5m27s

```

When I describe the POD, I see

```auto
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 39s default-scheduler 0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 No preemption victims found for incoming pod..

```

I see PVCs in Pending State.  
Am I missing something here?  
Any help/Pointers will be extremely helpful.

Best,  
J

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [December 19, 2023, 8:52pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/2 "2023-12-19T20:52:24Z")

</div>

> [@athreyavc](#):
>
> `pod has unbound immediate PersistentVolumeClaims`

Hi @athreyavc, which k8s platform are you using? This warning means that your k8s cluster can’t create PVC.

`When using `storageClass` Kubernetes is going to enable **"Dynamic Volume Provisioning"** which is not working with the local file system.`

Please read our blog post about it: [Percona Operator for MongoDB with Local Storage and OpenEBS](https://www.percona.com/blog/percona-distribution-for-mongodb-operator-with-local-storage-and-openebs/)  
Or you can try to use [hostPath](https://github.com/percona/percona-server-mongodb-operator/blob/main/deploy/cr.yaml#L198C8-L198C16).

---

<div class="post-metadata">

**Author:** ![athreyavc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/athreyavc/32/14652_2.png) [@athreyavc](https://forums.percona.com/u/athreyavc)\
**Post date:** [December 20, 2023, 1:10pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/3 "2023-12-20T13:10:04Z")

</div>

Hi @Slava_Sarzhan, Thanks for the reply.

I am using a clutster that is running locally on my laptop

```auto
❯ kubectl get nodes
NAME STATUS ROLES AGE VERSION
flatcar-worker1 Ready control-plane 105d v1.28.0
flatcar-worker2 Ready <none> 105d v1.28.0
flatcar-worker5 Ready <none> 82d v1.28.0

```

I am currently checking with the hostPath configuration.

Best, J

---

<div class="post-metadata">

**Author:** ![athreyavc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/athreyavc/32/14652_2.png) [@athreyavc](https://forums.percona.com/u/athreyavc)\
**Post date:** [December 20, 2023, 4:15pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/4 "2023-12-20T16:15:01Z")

</div>

I followed this document, [Percona Operator for MongoDB with Local Storage and OpenEBS](https://www.percona.com/blog/percona-distribution-for-mongodb-operator-with-local-storage-and-openebs/), I am trying to use kubectl though. I suppose it shouldn’t matter what method I am using helm or kubctl

```auto
type or pas allowUnsafeConfigurations: true
  upgradeOptions:
    apply: disabled
    schedule: "0 2 * * *"
  secrets:
    users: minimal-cluster
  replsets:

  - name: rs0
    size: 3
    volumeSpec:
      persistentVolumeClaim:
        storageClassName: local-storage
        resources:
          requests:
            storage: 3Gi

  sharding:
    enabled: false

    configsvrReplSet:
      size: 3
      volumeSpec:
        persistentVolumeClaim:
          storageClassName: local-storage
          resources:
            requests:
              storage: 3Gite code here

```

As I understand, we create the storageClass beforehand to pass it on to the configuration. Still no luck.

Best, J

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [December 20, 2023, 6:29pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/5 "2023-12-20T18:29:59Z")

</div>

Can you create PVC manually? Your cluster should be able to do it when you request it.

---

<div class="post-metadata">

**Author:** ![athreyavc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/athreyavc/32/14652_2.png) [@athreyavc](https://forums.percona.com/u/athreyavc)\
**Post date:** [December 22, 2023, 11:35am UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/6 "2023-12-22T11:35:50Z")

</div>

Thank you @Slava_Sarzhan . I think that made it work.

```auto
❯ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
minimal-cluster-rs0-0 1/1 Running 3 (92s ago) 11m 10.36.0.2 flatcar-worker5 <none> <none>
minimal-cluster-rs0-1 0/1 Pending 0 10m <none> <none> <none> <none>

```

Best,  
J

---

<div class="post-metadata">

**Author:** ![athreyavc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/athreyavc/32/14652_2.png) [@athreyavc](https://forums.percona.com/u/athreyavc)\
**Post date:** [December 22, 2023, 1:55pm UTC](https://forums.percona.com/t/pods-in-pending-state-0-3-nodes-are-available-pod-has-unbound-immediate-persistentvolumeclaims-preemption-0-3-nodes-are-available-3-no-preemption-victims-found-for-incoming-pod/27257/7 "2023-12-22T13:55:57Z")

</div>

Creating the PVC beforehand, did help to the make the Pods run, but the drawback was I have to create all the required PVCs before applying the manifest. So, I managed to run a longhorn on my cluster. After that, pointed the replica set to longhorn storageClass.

```auto
- name: rs0
    size: 3
    volumeSpec:
      persistentVolumeClaim:
        storageClassName: longhorn
        resources:
          requests:
            storage: 3Gi

```

That made everything dymanic.

Thank you @Slava_Sarzhan for directions.
