How to access Kubernetes cluster dashboard
Products
...
Kubernetes Engine
How to access Kubernetes cluster dashboard
Step 1: Login to the Controller node with the ssh-key used while creating the Kubernetes cluster.
You can log into the Kubernetes cluster using following command
ssh -i
Step 2: Check the Kubernetes dashboard service using the following command
kubectl get servies --all-namespaces
By default kubernetes dashboard service runs on cluster IP. In order to access the kubernetes dashboard from the Public IP, we need to create dashboard service with Nodeport option.
Step 3: Delete the Kubernetes dashboard service running on ClusterIP using following command
kubectl delete services kubernetes-dashboard -n kubernetes-dashboard
Step 4: Create a new Kubernetes dashboard service with the below yaml file using vi or nano editor.
Text
1# kubernetes-dashboard-service.yaml (file name)
2kind: Service
3apiVersion: v1
4metadata:
5 labels:
6k8s-app: kubernetes-dashboard
7name: kubernetes-dashboard
8namespace: kubernetes-dashboard
9spec:
10type: NodePort
11ports:
12- port: 443
13 targetPort: 8443
14 nodePort: 30001 #This is outside port you can change it as per your need
15selector:
16k8s-app: kubernetes-dashboard
kubernetes-dashboard-service.yaml (file name)
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
type: NodePort
ports:
- port: 443
targetPort: 8443
nodePort: 30001 #This is outside port you can change it as per your need
selector:
k8s-app: kubernetes-dashboard
After creating the above file, create Kubernetes service using following command
kubectl apply -f kubernetes-dashboard-service.yaml
Step 5: Check the Kubernetes service.
Now the service will be running on Nodeport port number 30001. Open the same port in the firewall on the portal & also created a port forwarding rule for the same from the portal as shown in the screenshot below
Step 6: Once the firewall & port forwarding rules are created. You will be able to access the Kubernetes dashboard using following url from any browser
https://
Step 2: Check the Kubernetes dashboard service using the following command
Step 3: Delete the Kubernetes dashboard service running on ClusterIP using following command
Step 4: Create a new Kubernetes dashboard service with the below yaml file using vi or nano editor.
Step 5: Check the Kubernetes service.
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key