0

I am not sure whether my setup is too unique, but I can't seem to find relevant information about the right way to do this. I will try to share my setup in details.

I installed a KIND cluster on my AWS EC2, and I install metrics-server and kubernetes-dashboard using helm.

ubuntu@sig-apac-ec2:~$ k get svc -n kubernetes-dashboard
NAME                   TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE
kubernetes-dashboard   NodePort   10.96.45.161   <none>        443:30130/TCP   140m

Then I tried to enable proxy with

$kubectl proxy --address 0.0.0.0 --accept-hosts '.*'
Starting to serve on [::]:8001

Then add port 8001 on my EC2 security group, when I navigate to URL http://x-x-x-x.ap-southeast-1.compute.amazonaws.com:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:443/proxy/#/login

I got enter image description here

what is the simplest way for me to access kubernetes dashboard remotely in my situation? this is just for experiment, so I understand and will accept some risk here.

sqr
  • 365
  • 2
  • 12
  • 29

1 Answers1

0

If you are asking how to login, then the options shown in the screen describe themselves, either create a service account and generate a token for it, and use that token to login to the dashboard (you will only see resources that the service account has access to via RBAC). Or, use your own kubeconfig file to login, and you will see all resources assuming you have admin permissions.

If you are asking how to skip the proxy, and you are looking to have the dashboard accessible all the time, you can use the node ip directly on port 443 (since the service is of type nodeIp already). Or, you can create your own LoadBalancer service which will have its own IP (assuming you have that setup).

akathimi
  • 1,393
  • 11
  • Thanks, @akathimi The red text in the screen says I can't log in because I am logging in using http instead of https, it also provides a link to dashboard repo which explains further, but I don't know how to fix it. – sqr Aug 31 '23 at 13:08