Open dyrnq opened 2 years ago
kubectl -n kube-public get cm cluster-info -o jsonpath='{.data.kubeconfig}' | grep certificate-authority-data | awk -F ":" '{print $2}' | xargs | base64 -d
cat /etc/kubernetes/pki/ca.crt
check two files same?
certhash=`openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'`
echo "kubeadm join 192.168.122.216:6443 --token ayngk7.m1555duk5x2i3ctt --discovery-token-ca-cert-hash sha256:$certhash"
kubeadm init phase kubeconfig admin
I0814 08:55:51.502333 566771 version.go:255] remote version is much newer: v1.24.3; falling back to: stable-1.23
error execution phase kubeconfig/admin: couldn't create a kubeconfig; the CA files couldn't be loaded: failed to load certificate: couldn't load the certificate file /etc/kubernetes/pki/ca.crt: open /etc/kubernetes/pki/ca.crt: no such file or directory
To see the stack trace of this error execute with --v=5 or higher