开发用户K8S授权

#开发用户没有K8S权限
[ans@master ~]$ kubectl get po 
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

#切换普通用户授权
[root@master ~]#su - ans
[ans@master ~]$mkdir -p $HOME/.kube
[ans@master ~]$sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[ans@master ~]$sudo chown $(id -u):$(id -g) $HOME/.kube/config
posted @ 2022-11-02 10:26  安生丶  阅读(53)  评论(0编辑  收藏  举报