k8s 1.21.2 版本 pvc pending


1.pvc 状态pending 报错:persistentvolume-controller  waiting for a volume to be created, either by external provisioner "nfs-client" or manually created by system administrator

2.原因:因为原来是1.20版本(我的是1.21.1)默认禁止使用selfLink

3.解决办法:

在apiserver.yaml里面添加:

- --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
- --feature-gates=RemoveSelfLink=false 

再次重启apiserver,pvc 状态变为 Bound 

k8s