I am trying to follow a very basic pvc/pod example with persistent storage. My cluster administrator has configured a 4 node cluster and has setup longhorn for persistent storage. I can successfully create the pvc (from a yaml file) but when I try to create the pod, I am getting an error back:
AttachVolume.Attach failed for volume “pvc-9a369527-6842-473a-8c9b-234c1a92b7f7” : node “gms-dev-rancher3” has no NodeID annotation
Here are my yaml files:
pvc_test.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-path-pvc
namespace: dev
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 2Gi
pod_test.yaml
apiVersion: v1
kind: Pod
metadata:
name: volume-test
namespace: dev
spec:
containers:
- name: volume-test
image: my-docker-registry.myorg.gov/kubetest/postgres:beckytest
imagePullPolicy: IfNotPresent
volumeMounts:- name: volv
mountPath: /data
ports: - containerPort: 80
volumes:
- name: volv
- name: volv
persistentVolumeClaim:
claimName: local-path-pvc
$ kubectl apply -f pvc_test.yaml
$ kubectl apply -f pod_test.yaml
$ kubectl describe pod volume-test
Gives the attach error above
I have googled this error but haven’t found any clear cut solutions.
Has anyone else seen this problem and overcome it?