# Elasticsearch pods stuck in pending: nodes are available: 3 node(s) had volume node affinity conflict,

**URL:** <https://discuss.elastic.co/t/elasticsearch-pods-stuck-in-pending-nodes-are-available-3-node-s-had-volume-node-affinity-conflict/302935>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [April 21, 2022, 3:27pm UTC](https://discuss.elastic.co/t/elasticsearch-pods-stuck-in-pending-nodes-are-available-3-node-s-had-volume-node-affinity-conflict/302935 "2022-04-21T15:27:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![x00m](https://avatars.discourse-cdn.com/v4/letter/x/90db22/32.png) [@x00m](https://discuss.elastic.co/u/x00m)\
**Post date:** [April 21, 2022, 3:27pm UTC](https://discuss.elastic.co/t/elasticsearch-pods-stuck-in-pending-nodes-are-available-3-node-s-had-volume-node-affinity-conflict/302935/1 "2022-04-21T15:27:33Z")

</div>

I am using AKS. (Azure)  
I had an elasticsearch cluster provisioned via ECK 1.8.0 with 3 nodes accross 3 VMs in a nodepool. (AKS)

I wanted to bump up the configuration, so i provisioned a new nodepool with 3 VMs and then changed the elasticsearch manifest yaml with the new nodepool, and then applied it.

After that, I see that the first pod itself is stuck in pending state with the error :-

## 0/X nodes are available: 3 node(s) had volume node affinity conflict, X node(s) didn't match Pod's node affinity/selector.

I am expecting it to be scheduled in those 3 nodes that's supposedly having " **volume node affinity conflict**" as that's the affinity I've set.

here is a part of my elasticsearch manifest:-

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1

kind: Elasticsearch
...
...
      spec:
        nodeSelector:
          agentpool: newNodePool
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 128Gi
        storageClassName: managed-premium
...
...

```

---

<div class="post-metadata">

**Author:** ![x00m](https://avatars.discourse-cdn.com/v4/letter/x/90db22/32.png) [@x00m](https://discuss.elastic.co/u/x00m)\
**Post date:** [April 21, 2022, 4:21pm UTC](https://discuss.elastic.co/t/elasticsearch-pods-stuck-in-pending-nodes-are-available-3-node-s-had-volume-node-affinity-conflict/302935/2 "2022-04-21T16:21:07Z")

</div>

Found the issue. May help the others so leaving the solution here.  
My previous nodepool had availability zone :None but the new one had Availability zone 1,2 and 3 selected.  
Node from one zone can't attach to a PV (managed-premium storage class which provisions Premium\_LRS behind the scene) in another zone. hence this error.  
Solution was for me to create the new nodepool with the same configuration as the previous one with respect to the availability zones.

---

<div class="post-metadata">

**Author:** ![michael.morello](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael.morello/32/47448_2.png) [@michael.morello](https://discuss.elastic.co/u/michael.morello)\
**Post date:** [May 10, 2022, 6:59am UTC](https://discuss.elastic.co/t/elasticsearch-pods-stuck-in-pending-nodes-are-available-3-node-s-had-volume-node-affinity-conflict/302935/3 "2022-05-10T06:59:42Z")

</div>


