Kubernetes Dashboard Installation and Configuration on Windows 11

Prerequisites

  • Windows 11 with Docker and Kubernetes enabled.
  • Helm installed.
  • kubectl installed and configured to use the local Kubernetes cluster.

Step 1: Add Kubernetes Dashboard Helm Repository

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

This command adds the Kubernetes Dashboard Helm chart repository.


Step 2: Install Kubernetes Dashboard using Helm

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

This command:

  • Installs or upgrades the kubernetes-dashboard Helm chart.
  • Creates the kubernetes-dashboard namespace if it does not exist.
  • Deploys the Kubernetes Dashboard.

If you see an error like:

Error: Kubernetes cluster unreachable: Get "https://kubernetes.docker.internal:6443/version": dial tcp 127.0.0.1:6443: connectex: No connection could be made because the target machine actively refused it.

Ensure that your local Kubernetes cluster is running.


Step 3: Forward Kubernetes Dashboard Service

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

This command forwards the Kubernetes Dashboard service to localhost on port 8443.

Access the dashboard at:

https://localhost:8443

Step 4: Generate Authentication Token for Dashboard Login

  1. List available service accounts in the kubernetes-dashboard namespace:
kubectl -n kubernetes-dashboard get serviceaccounts
  1. Generate a token for the correct service account:
kubectl -n kubernetes-dashboard create token kubernetes-dashboard-web
  1. Copy the generated token and use it to log in to the dashboard.

Step 5: Fix Insufficient Permissions (RBAC Configuration)

If you encounter errors like:

ingresses.networking.k8s.io is forbidden: User "system:serviceaccount:kubernetes-dashboard:kubernetes-dashboard-web" cannot list resource "ingresses"

You need to grant additional permissions to the Kubernetes Dashboard service account.

Grant cluster-admin role to the service account:

kubectl create clusterrolebinding kubernetes-dashboard-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:kubernetes-dashboard-web

This ensures the dashboard has access to all resources.


Step 6: Verify Kubernetes Context

Check which Kubernetes cluster and context are in use:

kubectl config view
kubectl config get-contexts

Ensure the current context is set to your local cluster (e.g., docker-desktop).

If necessary, set the context manually:

kubectl config use-context docker-desktop

Conclusion

After following these steps, you should have a working Kubernetes Dashboard running locally with full access. If any issues arise, verify your cluster status, service account permissions, and Helm deployment.

Happy Kubernetes management! ๐Ÿš€