k8s踩坑记录(持续更新)

安装好后执行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.yamlkube-scheduler.yaml

image

把这个--port=0 注释掉

重启kubelet再查看即可


你可能感兴趣的:(k8s踩坑记录(持续更新))