Kubernetes - You must be logged in to the server (Unauthorized):
Check expiration of the certificates:
#kubeadm alpha certs check-expiration OR
find /etc/kubernetes/pki/ -type f -name "*.crt" -print|egrep -v 'ca.crt$'|xargs -L 1 -t -i bash -c 'openssl x509 -noout -text -in {}|grep After'
Renew all certificates:
#kubeadm alpha certs renew all
Check expiration of the certificates:
#kubeadm alpha certs check-expiration
Backup existing config file:
#cat cp /etc/kubernetes/admin.conf $HOME/.kube/config > cp /etc/kubernetes/admin.conf.orig
Replace the config file
#cp /etc/kubernetes/admin.conf $HOME/.kube/config
#kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-66bff467f8-djhr7 1/1 Running 1 450d
kube-system coredns-66bff467f8-dn2t5 1/1 Running 1 450d
kube-system etcd-usg-dt-mysql03.wdc.com 1/1 Running 0 16m
kube-system kube-apiserver-<hostname> 1/1 Running 0 16m
kube-system kube-controller-manager-<hostname> 1/1 Running 0 16m
kube-system kube-proxy-ktp6x 1/1 Running 0 450d
kube-system kube-proxy-xs8bx 1/1 Running 1 450d
kube-system kube-scheduler-<hostname> 1/1 Running 0 16m
kube-system weave-net-czmjs 2/2 Running 3 450d
kube-system weave-net-g5vmn 2/2 Running 1 450d
Explore Kubernetes commands
Comments
Post a Comment