Kubernetes Pod Warning: 1 node(s) had volume node affinity conflict

2023. 2. 22. 14:39Dev

728x90
반응형

 

Kubernetes Pod Warning: 1 node(s) had volume node affinity conflict

 

Kubernetes Pod Warning: 1 node(s) had volume node affinity conflict

I try to set up Kubernetes cluster. I have Persistent Volume, Persistent Volume Claim and Storage class all set-up and running but when I wan to create pod from deployment, pod is created but it ha...

stackoverflow.com

Warning  FailedScheduling  3m14s (x3 over 7m7s)  default-scheduler  0/2 nodes are available: 1 node(s) didn't match Pod's node affinity/selector, 1 node(s) had volume node affinity conflict. preemption: 0/2 nodes are available: 2 Preemption is not helpful for scheduling.

 

  Warning  ProvisioningFailed    2m16s (x9 over 6m31s)  ebs.csi.aws.com_ebs-csi-controller-6847c46b4d-cpm4f_bfed70e9-03b9-4d92-8a72-a7f9b9052f01  failed to provision volume with StorageClass "gp3": error generating accessibility requirements: topology map[topology.ebs.csi.aws.com/zone:ap-northeast-2c] from selected node "ip-192-168-152-73.ap-northeast-2.compute.internal" is not in requisite: [map[failure-domain.beta.kubernetes.io/zone:ap-northeast-2a] map[failure-domain.beta.kubernetes.io/zone:ap-northeast-2c]]

위 글을 답변을 참고해서 gp3 storageclass에 allowedTopologies 추가하고 재시작해서 성공

allowVolumeExpansion: true
allowedTopologies:
- matchLabelExpressions:
  - key: topology.ebs.csi.aws.com/zone
    values:
    - ap-northeast-2a
    - ap-northeast-2c
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"allowVolumeExpansion":true,"allowedTopologies":[{"matchLabelExpressions":[{"key":"failure-domain.beta.kubernetes.io/zone","values":["ap-northeast-2a","ap-northeast-2c"]}]}],"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"},"creationTimestamp":"2023-01-13T04:10:30Z","name":"gp3","resourceVersion":"1647","uid":"88b537ab-9fc3-4b95-88f4-dea0e671cf26"},"parameters":{"csi.storage.k8s.io/fstype":"ext4","type":"gp3"},"provisioner":"ebs.csi.aws.com","reclaimPolicy":"Delete","volumeBindingMode":"WaitForFirstConsumer"}
    storageclass.kubernetes.io/is-default-class: "true"
  creationTimestamp: "2023-01-13T04:10:30Z"
  name: gp3
  resourceVersion: "13369982"
  uid: 88b537ab-9fc3-4b95-88f4-dea0e671cf26
parameters:
  csi.storage.k8s.io/fstype: ext4
  type: gp3
provisioner: ebs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

 

https://pet2cattle.com/2022/04/volume-affinity-conflict

 

Pod events: volume node affinity conflict

volume node affinity conflict means that the worker nodes sit on a different AZ than the volumes it needs

pet2cattle.com