update read me for unable to connect to the server (#4803)
* update read me for unable to connect to the server * Fix words, thanks tengqm * Update create-cluster-kubeadm.md
This commit is contained in:
@@ -542,8 +542,24 @@ You may have trouble in the configuration if you see Pod statuses like `RunConta
|
|||||||
|
|
||||||
[ubuntu-vagrantfile]: https://github.com/errordeveloper/k8s-playground/blob/22dd39dfc06111235620e6c4404a96ae146f26fd/Vagrantfile#L11)
|
[ubuntu-vagrantfile]: https://github.com/errordeveloper/k8s-playground/blob/22dd39dfc06111235620e6c4404a96ae146f26fd/Vagrantfile#L11)
|
||||||
|
|
||||||
As with all Kubernetes troubleshooting, normal commands you can take advantage of to help diagnose
|
1. The following error indicates a possible certificate mismatch.
|
||||||
what happened are `kubectl describe pod` or `kubectl logs`. Example usage:
|
|
||||||
|
```
|
||||||
|
# kubectl get po
|
||||||
|
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.
|
||||||
|
Another workaround is to overwrite the default `kubeconfig` for the "admin" user:
|
||||||
|
|
||||||
|
```
|
||||||
|
mv $HOME/.kube $HOME/.kube.bak
|
||||||
|
mkdir -p $HOME/.kube
|
||||||
|
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||||
|
sudo chown $(id -u):$(id -g) $HOME/.kube/config
|
||||||
|
```
|
||||||
|
|
||||||
|
The `kubectl describe pod` or `kubectl logs` commands can help you diagnose errors. For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl -n ${NAMESPACE} describe pod ${POD_NAME}
|
kubectl -n ${NAMESPACE} describe pod ${POD_NAME}
|
||||||
|
|||||||
Reference in New Issue
Block a user