1.创建pvc的时候pod一直处于pending问题,provider报错信息如下:
error retrieving resource lock kube-system/fuseim.pri-ifs: endpoints "fuseim.pri-ifs" is forbidden: User "system:serviceaccount:kube-system:nfs-provisioner" cannot get resource "endpoints" in API group "" in the namespace "kube-system"
解决方法:
在创建角色绑定的时候,需要在subjects:字段下加入:
- kind: ServiceAccount //这三行之前没有
name: nfs-provisioner
namespace: kube-system
2.pvc一直pending,nfs-client-provisioner报错信息如下:
class "nfs": unexpected error getting claim reference: selfLink was empty, can't make reference
解决方法:
k8s1.20以上版本问题,需要在apiserver加入以下参数:
- --feature-gates=RemoveSelfLink=false
(kubeadm部署的k8s集群在/etc/kubernetes/manifests/kube-apiserver.yaml下修改就可以,不需要重启pod,定时读取里面的配置文件)