diff --git a/docs/common/faq.md b/docs/common/faq.md index b4caf27735f2..26fa31d3afb3 100644 --- a/docs/common/faq.md +++ b/docs/common/faq.md @@ -29,26 +29,26 @@ Try to run: ```shell sudo mount --bind /var/lib/kubelet /var/lib/kubelet && sudo mount --make-shared /var/lib/kubelet ``` + You can find more information [here](https://github.com/kubernetes/kubernetes/issues/4869#issuecomment-193640483). ### I am seeing 404 errors when trying to access Dashboard. Dashboard resources can not be loaded. ``` -GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/vendor.9aa0b786.css -proxy:1 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/app.8ebf2901.css -proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/api/appConfig.json -proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/app.68d2caa2.js -proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/vendor.840e639c.js -proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/api/appConfig.json -proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/app.68d2caa2.js +GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/vendor.9aa0b786.css +proxy:1 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/app.8ebf2901.css +proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/api/appConfig.json +proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/app.68d2caa2.js +proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/vendor.840e639c.js +proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/api/appConfig.json +proxy:5 GET https:///api/v1/namespaces/kube-system/services/kubernetes-dashboard/static/app.68d2caa2.js ``` **IMPORTANT:** There is a [known issue](https://github.com/kubernetes/kubernetes/issues/52729) related to Kubernetes 1.7.6 where `/ui` redirect does not work. Try to add trailing slash at the end of `/ui` redirect url: `http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/` If this does not help then this means there is a problem with your cluster or you are trying to access Dashboard in a wrong way. Usually this happens when you try to expose Dashboard using `kubectl proxy` in a wrong way (i.e. missing permissions). -You can quickly check if accessing -`http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/` instead of `http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy` will work for you. +You can quickly check if accessing `http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/` instead of `http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy` will work for you. Other way of checking if your issue is related to Dashboard is to expose and access it using **NodePort** method described in our [Accessing Dashboard](../user/accessing-dashboard/README.md) guide. This will allow you to access Dashboard directly without any proxy involved. @@ -72,5 +72,71 @@ The reason why `/ui` redirect does not work for HTTPS is that it hasn't yet been Correct links that can be used to access Dashboard are in our documentation. Check [Accessing Dashboard](../user/accessing-dashboard/README.md) to find out more. ----- +### Kong pod doesn't start - Socket binding errors + +This issue commonly occurs when the Kong pod fails to start due to socket binding conflicts, typically manifesting with errors like: + +``` +bind() to unix:/kong_prefix/sockets/we failed (98: Address already in use) +``` + +**Common Causes:** +- Previous Kong processes didn't shut down cleanly +- Stale socket files persist after container restarts +- Permission issues preventing proper socket file management +- Host system restart issues with Docker Desktop (particularly on Windows) + +**Solutions:** + +#### 1. Clean restart the Kong pod +The quickest fix is to delete the existing Kong pod, which forces Kubernetes to recreate it: + +```shell +# Find the Kong pod name +kubectl get pods -n kubernetes-dashboard | grep kong + +# Delete the Kong pod (it will be automatically recreated) +kubectl delete pod -n kubernetes-dashboard +``` + +#### 2. Clean up stale socket files +If the pod restart doesn't resolve the issue, manually remove lingering socket files: + +```shell +# Execute into the Kong pod (if accessible) +kubectl exec -it -n kubernetes-dashboard -- rm -f /kong_prefix/sockets/we + +# Or from the host (if socket directory is accessible) +rm -f /path/to/kong_prefix/sockets/we +``` + +#### 3. Check socket file permissions +Verify that the Kong process has proper permissions: + +```shell +kubectl exec -it -n kubernetes-dashboard -- ls -la /kong_prefix/sockets/ +``` + +#### 4. Docker Desktop specific fix (Windows) +On Windows with Docker Desktop, socket files may persist between restarts. Consider: + +- Upgrading Docker Desktop to a newer version +- Restarting Docker Desktop after Windows restarts +- Recreating the Kubernetes cluster if the issue persists + +#### 5. Persistent solution +To prevent this issue from recurring: + +```shell +# Add a pre-stop hook to your Kong pod configuration to clean up sockets +# This can be done through Helm chart customization +helm upgrade kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard \ + --set kong.container.lifecycle.preStop.exec.command='["/bin/sh", "-c", "rm -f /kong_prefix/sockets/we"]' \ + --namespace kubernetes-dashboard +``` + +**Related Issues:** [#8909](https://github.com/kubernetes/dashboard/issues/8909), [#8765](https://github.com/kubernetes/dashboard/issues/8765), [#10362](https://github.com/kubernetes/dashboard/issues/10362) + +--- + _Copyright 2019 [The Kubernetes Dashboard Authors](https://github.com/kubernetes/dashboard/graphs/contributors)_