I am using Treafik ingress to forward request into kubernetes(v1.15.2) dashboard container,but it give me no page found error. now I want to login into kubernetes dashboard to try to get the home page html using this command:
curl -L http://127.0.0.1:8443Now I am stuck in login into kubernetes dashboard container. I am using this command to login kubernetes dashboard:
kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/bashand throw this error:
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknownand this is what I already tried:
[root@ops001 conf.d]# docker exec -it kubernetes-dashboard-6466b68b-mrrs9 /bin/ash
Error: No such container: kubernetes-dashboard-6466b68b-mrrs9
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 /bin/bash
Error from server (NotFound): pods "kubernetes-dashboard-6466b68b-mrrs9" not found
[root@ops001 conf.d]# kubectl config set-context --current --namespace=kube-system
Context "kubernetes" modified.
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 /bin/ash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/ash\": stat /bin/ash: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 --
error: you must specify at least one command for the container
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- ls
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"ls\": executable file not found in $PATH": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/ls
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/ls\": stat /bin/ls: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/\": stat /bin/: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/\": permission denied": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/sh
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/ash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/ash\": stat /bin/ash: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
command terminated with exit code 126
[root@ops001 conf.d]# kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- env
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"env\": executable file not found in $PATH": unknown
command terminated with exit code 126
[root@ops001 conf.d]#what should I do to login the kubenetes dashboard container?
The recommended way is to use kubectl proxy as it is independend if there are any ingresses or other network ressources available...it should work in any environment as long as kubectl has the correct context.
So try
kubectl proxyThen use your browser to navigate to
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
Be aware that this URL contains the namespace kube-system where the kubernetes-dashboard must be deployed in. Change the URL accordingly if it is deployed differently on your cluster.