Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of

一、问题

当 kubeadm 安装完 k8s 后,使用 kubectl 命令,报错 Unable to connect to the server: x509: certificate signed by unknown authority

二、 解决

配置用户使用 kubectl 访问集群

[root@master ~]# mkdir -p $HOME/.kube
[root@master ~]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@master ~]# sudo chown $(id -u):$(id -g) $HOME/.kube/config
[root@master ~]#
 

你可能感兴趣的:(《容器排障指南》,kubernetes,容器,云原生)