Kubernetes: Deploy dashboard

Kubernetes provides a dashboard to manage your cluster, to install it first we need to make sure we have Helm installed in our system. helm version If we have Helm installed it will output something similar to this: version.BuildInfo{Version:"v3.17.3", GitCommit:"...", GitTreeState:"clean", GoVersion:"go1.23.7"} If you don't have it installed, run the following command: sudo snap install helm --classic Deploy the dashboard Once we have Helm installed, we have to add the kubernetes-dashboard repository: helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ Next, we deploy the dashboard: helm upgrade --install kubernetes-dashboard \ kubernetes-dashboard/kubernetes-dashboard \ --create-namespace --namespace kubernetes-dashboard Access the dashboard To access the dashboard we need to obtain a bearer token: kubectl -n kubernetes-dashboard create token default Once we have the bearer token, we need to start the port forwarding: kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 This command will forward the 443 pod's port to the 8443 localhost's port. If we cannot access the localhost, we can specify the address to bind, like 0.0.0.0. kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 --address 0.0.0.0 You will can use the dashboard as long as the port forwarding is working. If you want to always be able to access the dashboard read the official documentation about authentication and authorization.

Apr 23, 2025 - 09:35
 0
Kubernetes: Deploy dashboard

Kubernetes provides a dashboard to manage your cluster, to install it first we need to make sure we have Helm installed in our system.

helm version

If we have Helm installed it will output something similar to this:

version.BuildInfo{Version:"v3.17.3", GitCommit:"...", GitTreeState:"clean", GoVersion:"go1.23.7"}

If you don't have it installed, run the following command:

sudo snap install helm --classic

Deploy the dashboard

Once we have Helm installed, we have to add the kubernetes-dashboard repository:

helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/

Next, we deploy the dashboard:

helm upgrade --install kubernetes-dashboard \
    kubernetes-dashboard/kubernetes-dashboard \
    --create-namespace --namespace kubernetes-dashboard

Access the dashboard

To access the dashboard we need to obtain a bearer token:

kubectl -n kubernetes-dashboard create token default

Once we have the bearer token, we need to start the port forwarding:

kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443

This command will forward the 443 pod's port to the 8443 localhost's port. If we cannot access the localhost, we can specify the address to bind, like 0.0.0.0.

kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 --address 0.0.0.0

You will can use the dashboard as long as the port forwarding is working. If you want to always be able to access the dashboard read the official documentation about authentication and authorization.