Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes dashboard in aws EC2 instance?

I have started 2 ubuntu 16 EC2 instance(one for master and other for worker). Everything working OK. I need to setup dashboard to view on my machine. I have copied admin.ctl and executed the script in my machine's terminal

 kubectl --kubeconfig ./admin.conf proxy --address='0.0.0.0' --port=8002 --accept-hosts='.*' 

Everything is fine. But in browser when I use below link

http://localhost:8002/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

I am getting Error: 'dial tcp 192.168.1.23:8443: i/o timeout' Trying to reach: 'https://192.168.1.23:8443/'

I have enabled all traffics in security policy for aws. What am I missing? Please point me a solution

like image 752
JibinNajeeb Avatar asked Oct 20 '25 12:10

JibinNajeeb


1 Answers

If you only want to reach the dashboard then it is pretty easy, get the IP address of your EC2 instance and the Port on which it is serving dashboard (kubectl get services --all-namespaces) and then reach it using: First:

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'

And in your browswer:

http://<IP>:<PORT>/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

Note that this is a possible security vulnerability as you are accepting all traffic (AWS firewall rules) and also all connections for your kubectl proxy (--address 0.0.0.0 --accept-hosts '.*') so please narrow it down or use different approach. If you have more questions feel free to ask.

like image 197
aurelius Avatar answered Oct 22 '25 01:10

aurelius