Hi, my pods are stuck on Init because attaching volumes is not working, here is kubelet log:
kubelet[5246]: I0302 04:17:45.983773 5246 reconciler.go:227] operationExecutor.AttachVolume started for volume "pvc-c4fd2215-3c18-11e9-bffa-001999d764e2" (UniqueName: "kubernetes.io/csi/io.drbd.linstor-csi^bf753dd6-48df-4157-a421-74d802a59e44") pod "hc1-wd43-0" (UID: "13418de2-3c97-11e9-bffa-001999d764e2")
kubelet[5246]: E0302 04:17:45.986787 5246 csi_attacher.go:103] kubernetes.io/csi: attacher.Attach failed: volumeattachments.storage.k8s.io is forbidden: User "system:node:m12c16" cannot create resource "volumeattachments" in API group "storage.k8s.io" at the cluster scope: can only get individual resources of this type
It seems something wrong with RBAC:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: system:node
rules:
...
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
kubectl version
Client Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.0-alpha.0.1172+29b3ec91089d0e-dirty", GitCommit:"29b3ec91089d0e213c15118e3c39087bcfbb6400", GitTreeState:"dirty", BuildDate:"2018-12-20T23:05:11Z", GoVersion:"go1.11.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Hi, my pods are stuck on Init because attaching volumes is not working, here is kubelet log:
It seems something wrong with RBAC:
kubectl version