kubernets

[k8s] TLS certificate errors

IT공부 2023. 2. 21. 10:05
반응형

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/

TLS certificate errors

The following error indicates a possible certificate mismatch.

# kubectl get pods
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")
  • Verify that the $HOME/.kube/config file contains a valid certificate, and regenerate a certificate if necessary. The certificates in a kubeconfig file are base64 encoded. The base64 --decode command can be used to decode the certificate and openssl x509 -text -noout can be used for viewing the certificate information.
  • Unset the KUBECONFIG environment variable using:Or set it to the default KUBECONFIG location:
  • export KUBECONFIG=/etc/kubernetes/admin.conf
    
  • unset KUBECONFIG
    
  • Another workaround is to overwrite the existing kubeconfig for the "admin" user:
  • 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

'kubernets' 카테고리의 다른 글

[kubenetes] worker노드 삭제 후 다시 조인  (0) 2023.03.06
[CentOS] Docker 설치  (0) 2023.02.21
[Ubuntu]Docker 설치  (0) 2023.02.16
[Ubuntu] kubernetes 설치  (0) 2023.02.16