安装好后执行kubectl get node显示unable to connect to the server
使用kubeadm init
安装好之后
执行kubectl get node
报错
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")
是因为没有复制admin.conf
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
即可
使用kubectl get cs查看显示controller-manager、scheduler状态为Unhealthy
kubectl get cs
NAME STATUS MESSAGE ERROR
controller-manager Unhealthy Get http://127.0.0.1:10252/healthz: dial tcp 127.0.0.1:10252: connect: connection refused
scheduler Unhealthy Get http://127.0.0.1:10251/healthz: dial tcp 127.0.0.1:10251: connect: connection refused
etcd-0 Healthy {"health":"true"}
修改/etc/kubernetes/manifests
中的kube-controller-manager.yaml
和kube-scheduler.yaml
把这个--port=0
注释掉
重启kubelet
再查看即可