Unable to connect to the server: tls: failed to verify certificate: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

라는 오류 발생하면 권한 설정이 제대로 안 돼서 그렇다. 아래의 명령어 차례대로 입력

k8s 클러스터 트러블슈팅


unset KUBECONFIG

export KUBECONFIG=/etc/kubernetes/admin.conf

mv  $HOME/.kube $HOME/.kube.bak

mkdir $HOME/.kube

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

sudo chown $(id -u):$(id -g) $HOME/.kube/config