Open dyrnq opened 3 years ago
there is a bootstrap-token- whitch DESCRIPTION is Proxy for managing TTL for the kubeadm-certs secret
has 1h ttl default.
After 1h the secret bootstrap-token- expired,at the same time the kubeadm-certs will expired too.
find the kubeadm-certs`s ownerReferences will find the bootstrap-token- secret
kubectl -n kube-system get secret kubeadm-certs -o jsonpath='{ .metadata.ownerReferences[0].name }'
your may need rerun the cmd on the first control-plane node
kubeadm init phase upload-certs --upload-certs --config /tmp/kubeadm-config.yaml -v5
make bootstrap-token- never expired
kubectl -n kube-system get secret "$(kubectl -n kube-system get secret kubeadm-certs -o jsonpath='{ .metadata.ownerReferences[0].name }')" -o yaml > token.yaml && \
sed -i "/ expiration:.*$/d" token.yaml && \
kubectl replace -f token.yaml
if no kubeadm-config.yaml saved
kubectl -n kube-system get cm kubeadm-config -o json |jq -r '.data.ClusterConfiguration' > /tmp/kubeadm-config.yaml
kubeadm init phase upload-certs --upload-certs --config /tmp/kubeadm-config.yaml -v5