I have been able to successfully setup kubernetes on my Centos 7 server.
On trying to get the dashboard working after following the documentation, running ‘kubectl proxy’ it
attempts to run using 127.0.0.1:9001 and not my server ip. Do this mean I cannot access kubernetes dashboard outside the server?
I need help on getting the dashboard running using my public ip
2
Answers
As I understand, you would like to access the dashboard from your laptop. What you should do is create an admin account called k8s-admin:
Then setup kubectl on your laptop, e.g. for macOS it looks like this (see documentation):
Setup a proxy to your workstation. Create a
~/.kube
directory on your laptop and then scp the~/.kube/config
file from the k8s (Kubernetes) master to your~/.kube
directory.Then get the authentication token you need to connect to the dashboard:
Now start the proxy:
Now open the dashboard by going to:
You should see the
Token
option and then copy-paste the token from the prior step and Sign-In.You can follow this tutorial.
You can specify on which address you want to run
kubectl proxy
, i.e.You can also use port forwarding to access the dashboard.
This will listen port 8888 on all addresses and route traffic directly to your pod.
For instance:
In another terminal running