<p>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:</p>

<pre><code>curl -L http://127.0.0.1:8443
</code></pre>

<p>Now I am stuck in login into kubernetes dashboard container. I am using this command to login kubernetes dashboard:</p>

<pre><code>kubectl exec -it kubernetes-dashboard-6466b68b-mrrs9 -- /bin/bash
</code></pre>

<p>and throw this error:</p>

<pre><code>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
</code></pre>

<p>and this is what I already tried:</p>

<pre><code>[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]#
</code></pre>

<p>what should I do to login the kubenetes dashboard container?</p>

Dolphin
<p>The recommended way is to use <code>kubectl proxy</code> 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.</p>

<p>So try </p>

<pre class="lang-sh prettyprint-override"><code>kubectl proxy
</code></pre>

<p>Then use your browser to navigate to</p>

<p><a href="http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/" rel="nofollow noreferrer">http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/</a></p>

<p>Be aware that this URL contains the namespace <strong>kube-system</strong> where the <strong>kubernetes-dashboard</strong> must be deployed in. Change the URL accordingly if it is deployed differently on your cluster.</p>
