Kubernetes是v1.20.0
。
尝试创建pvc,它们都处于“pending”状态
使用命令查看kubectl logs nfs-client-provisioner
报:
I1210 14:42:01.396466 1 leaderelection.go:194] successfully acquired lease default/fuseim.pri-ifs
I1210 14:42:01.396534 1 controller.go:631] Starting provisioner controller fuseim.pri/ifs_nfs-client-provisioner-64b7476494-p4fcm_dcfca333-3af5-11eb-8248-5aed4ceb7af7!
I1210 14:42:01.496922 1 controller.go:680] Started provisioner controller fuseim.pri/ifs_nfs-client-provisioner-64b7476494-p4fcm_dcfca333-3af5-11eb-8248-5aed4ceb7af7!
I1210 14:42:01.497152 1 controller.go:987] provision "default/pvc1" class "managed-nfs-storage": started
I1210 14:42:01.497157 1 controller.go:987] provision "default/test-claim" class "managed-nfs-storage": started
E1210 14:42:01.500487 1 controller.go:1004] provision "default/pvc1" class "managed-nfs-storage": unexpected error getting claim reference: selfLink was empty, can't make reference
E1210 14:42:01.500502 1 controller.go:1004] provision "default/test-claim" class "managed-nfs-storage": unexpected error getting claim reference: selfLink was empty, can't make reference
在v1.20.0中禁用了selfLink。
当前的解决方法是编辑
/etc/kubernetes/manifests/kube-apiserver.yaml
在这里:
spec: containers: - command: - kube-apiserver
添加这一行:
- --feature-gates=RemoveSelfLink=false
然后应用它,即可
kubectl apply -f /etc/kubernetes/manifests/kube-apiserver.yaml
你的答案