如果Kubernetes的版本是1.20.x的版本,我们查看nfs-client-provisioner服务日志,应该会出现报错:unexpected error getting claim reference: selfLink was empty, can’t make reference 解决方法:
1)二进制安装的集群:
在/etc/kubernetes/manifests/kube-apiserver.yaml的文件中添加:

--feature-gates=RemoveSelfLink=false

修改后自动生效

2)Rancher RKE工具安装或者其他工具

万变不离其宗,参考Rancher万金油法则,在Rancher上修改Kubernetes的API yaml文件

问题记录:K8s1.20版本上安装NFS-StorageClass,报错:unexpected error getting claim reference: selfLink was empty._linux


问题记录:K8s1.20版本上安装NFS-StorageClass,报错:unexpected error getting claim reference: selfLink was empty._容器_02


问题记录:K8s1.20版本上安装NFS-StorageClass,报错:unexpected error getting claim reference: selfLink was empty._linux_03


修改

services:
    kube-api:
      extra_args:
        feature-gates: 'RemoveSelfLink=false'

问题记录:K8s1.20版本上安装NFS-StorageClass,报错:unexpected error getting claim reference: selfLink was empty._容器_04


最后点击保存,等到集群更新完成即可