When I try to log into the Kubernetes Dashboard.
Not Found (404) the server could not find the requested resource
and how to deal with the error.
Reason
Older Dashboards used "kube-system" for "namespace", but more recent Dashboards use "kubernetes-dashboard".
The namespace is specified when obtaining a user token and accessing the proxy, and which namespace is used depends on which namespace is actually used by the Dashboard deployed on that Kubernetes.
And when the namespace specification is different from the actual one, the above error occurs.
support
Where namespace is used, make sure to use the same namespace as the Dashboard.
Token acquisition
NAMESPACE=kubernetes-dashboard # or kube-system kubectl -n $NAMESPACE describe secret $(kubectl -n $NAMESPACE get secret | grep admin-user | awk '{print $1}')
proxy URL
NAMESPACE=kubernetes-dashboard # or kube-system echo "http://localhost:8001/api/v1/namespaces/$NAMESPACE/services/https:kubernetes-dashboard:/proxy/"
Impressions, etc.
I got stuck with the title error because I mixed old and new scripts....