kubernetes 常见错误
:~# kubectl get svc
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")
:~# rm -rf $HOME/.kube
:~# 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 svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 9m30s
先删除 $HOME/.kube
- node NotReady
:~# kubectl get node
NAME STATUS ROLES AGE VERSION
ubuntu NotReady master 12m v1.17.3
因为没有创建flannel网络
:~# kubectl create -f kube-flannel.yml
podsecuritypolicy.policy/psp.flannel.unprivileged created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds-amd64 created
daemonset.apps/kube-flannel-ds-arm64 created
daemonset.apps/kube-flannel-ds-arm created
daemonset.apps/kube-flannel-ds-ppc64le created
daemonset.apps/kube-flannel-ds-s390x created
:~# kubectl get node
NAME STATUS ROLES AGE VERSION
ubuntu NotReady master 14m v1.17.3
等待 网络创建完成
:~# kubectl get node
NAME STATUS ROLES AGE VERSION
ubuntu Ready master 15m v1.17.3