Hi Team, I appreciate your input as I can't figure out what's broken. I have a s . . .

Karim:
Hi Team, I appreciate your input as I can’t figure out what’s broken. I have a storage class configured with AWS EBS and it is working correctly in the sense that when I create the PVC it is actually creating the volume in AWS. The issue is that when I configure the Pod to use the PVC I get the error in Pod creation “running PreBind plugin “VolumeBinding”: binding volumes: pv “pvc-b2593f4b-ae52-42ae-8dfa-4524e74404ea” node affinity doesn’t match node “k8s-worker-node-1”: no matching NodeSelectorTerms”

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-ebs-pod
  namespace: default
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
  storageClassName: standard
ubuntu@k8s-control-node:~$ kubectl describe sc standard 
Name:                  standard
IsDefaultClass:        No
Annotations:           <none>
Provisioner:           <http://kubernetes.io/aws-ebs|kubernetes.io/aws-ebs>
Parameters:            type=gp2
AllowVolumeExpansion:  True
MountOptions:
  debug
ReclaimPolicy:      Retain
VolumeBindingMode:  WaitForFirstConsumer
Events:             &lt;none&gt;
ubuntu@k8s-control-node:~$ kubectl get pvc test-ebs-pod
NAME           STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
test-ebs-pod   Bound    pvc-b2593f4b-ae52-42ae-8dfa-4524e74404ea   2Gi        RWO            standard       4m13s

Pod YAML
apiVersion: v1
kind: Pod
metadata:
  name: test-ebs
spec:
  containers:
  - image: <http://registry.k8s.io/test-webserver|registry.k8s.io/test-webserver>
    name: test-container
    volumeMounts:
    - mountPath: /test-ebs
      name: test-volume
  volumes:
  - name: test-volume
    persistentVolumeClaim:
        claimName: test-ebs-pod

Alistair Mackay:
I’m afraid your cluster is now getting very personal to you and outside of the realms of what we can easily assist with. You’ll need to carefully study the documentation for the EBS volume provisioner that you must now have installed. It may have certain requirements for node labels and the like.

Also EBS volume can only be bound to one node at a time. You may have to tune selectors and affinity on pods to get them to go where the EBS volume is actually mounted.

Check the logs of the pod(s) that manage mounting the volumes as well.

Not having a lab set up like yours, I can’t reproduce it to tell you where you are going wrong.

Radoslaw Czajkowski:
i suspect that the pod is on a diffent node, than the one the volume was associated with but it’s just my guess

Radoslaw Czajkowski:
so the pod cannot reach the volume

Radoslaw Czajkowski:
you need to make sure the pod lands on the same node the volume is getting attached to

Karim:
thanks @Alistair Mackay @Radoslaw Czajkowskithe point that I noticed is that when I look at the PV i see it mapped to a node, but the EBS volume created is not attached to the instance…I also tried pinning the Pod to the same node using NodeName