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: <none>
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