1. 程式人生 > >Unable to connect to the server: x509: certificate signed by unknown authority

Unable to connect to the server: x509: certificate signed by unknown authority

一、問題

當kubeadm安裝完k8s後,使用kubectl命令,提示Unable to connect to the server: x509: certificate signed by unknown authority

二、 解決

配置使用者使用kubectl訪問叢集

$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

#root使用者可以不設
$ sudo chown $(id -u):$(id -g) $HOME/.