I am very new to the idea of kubernetes
. I found some good tutorials online to get my kubernetes
cluster up & running. Right Now I want to add a kubernetes
dashboard to my cluster so that it would be easy and good to have a page where I can watch how my pods and node's react (even do I'm more of a CLI guy, some GUI is not bad). I've downloaded the dashboard pod and it's up and running. Because the kubernetes cluster is running on a Raspberry Pi cluster I've set up a NodePort to access it from outside my cluster. But I've come to some problems where I can't find any problems too online.
Can someone direct me to the right documentation/tutorial / or give me any help for my Kube dashboard?
The first thing you will need to use in the deployment is Ingress so lets start with it.
Firstly you should create an Ingress controller, you can find the Installation Guide here
The most relevant is the first part - Generic Deployment which includes following:
Namespace for the Ingress controller installation:
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/namespace.yaml \ | kubectl apply -f -
Default backend for Ingress controller:
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/default-backend.yaml \ | kubectl apply -f -
And config maps:
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/configmap.yaml \ | kubectl apply -f -
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/tcp-services-configmap.yaml \ | kubectl apply -f -
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/udp-services-configmap.yaml \ | kubectl apply -f -
Because you deployed your cluster on Raspberry Pi, all of this needs to be created manually.
After the Ingress controller is installed you can deploy specific configuration for your Ingress with rules to route traffic to your service.
Here is an example of Ingress yaml file:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: endpoint-to-the-world
annotations:
ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: your-external-address-for-the-cluster
http:
paths:
- path: /console
backend:
serviceName: kubernetes-dashboard
servicePort: 443
- path: /some-other-path
backend:
serviceName: different-service
servicePort: 22
This will act like an external proxy for your cluster and you can route all traffic to any service. More details can be read here.
This should be enough to have Kubernetes Dashboard exposed.
Someone in an other forum send me this tutorial which was very helpfull. I'll share it here also for all the people who've came to this post with the same question.