Overview
Once Kubernetes Dashboard is installed in your cluster, there are several methods to access it. This guide covers the most common approaches, from simple port forwarding to production-ready ingress configurations.Access Methods
kubectl port-forward (Recommended for Development)
The simplest and most secure method for accessing Dashboard locally is usingkubectl port-forward. This method works without any ingress configuration and is ideal for development and testing.
Start Port Forwarding
Access Dashboard
Login
- No additional configuration required
- Secure (traffic stays within kubectl tunnel)
- Works on any platform
- Only accessible from the machine running the command
- Requires keeping terminal open
- Not suitable for production
kubectl proxy
Another local access method using the Kubernetes API proxy:Start kubectl proxy
Access Dashboard
kubectl proxy, the Authorization header will not work properly because the API server drops additional headers. Use bearer token authentication on the login screen instead.Ingress (Recommended for Production)
For production deployments, use an Ingress resource to expose Dashboard with proper TLS and authentication.Prerequisites
- An Ingress controller installed (e.g., nginx-ingress, Traefik)
- cert-manager for TLS certificate management (optional but recommended)
- A domain name pointing to your cluster
Enable Ingress in Helm
dashboard.example.com with your actual domain.Configure TLS with cert-manager
Verify Ingress
Access Dashboard
NodePort Service
Expose Dashboard directly on a node port (not recommended for production):Update Service Type
Get NodePort
443:30001/TCP).Access Dashboard
LoadBalancer Service
For cloud environments, use a LoadBalancer service:Update Service Type
Get External IP
Access Dashboard
Authentication
Creating a Sample User
To access Dashboard, you need a bearer token. Here’s how to create a sample admin user:Create Service Account
dashboard-adminuser.yaml:Create ClusterRoleBinding
dashboard-clusterrolebinding.yaml:Generate Token
Login to Dashboard
- Navigate to Dashboard using one of the access methods above
- Select “Token” authentication method
- Paste the token you generated
- Click “Sign in”
Clean Up Sample User
When you’re done testing, remove the admin user:Security Considerations
Always use HTTPS
Always use HTTPS
Network Policies
Network Policies
Token Security
Token Security
- Token login only works over HTTPS
- Never commit tokens to version control
- Use short-lived tokens when possible
- Rotate tokens regularly
- Grant minimal required permissions
Pod Security
Pod Security
- Non-root user (UID 1001, GID 2001)
- Read-only root filesystem
- No privilege escalation
- Dropped all capabilities
Troubleshooting
Certificate warnings in browser
Certificate warnings in browser
- For development: Accept the certificate warning
- For production: Use cert-manager with a trusted CA like Let’s Encrypt
Cannot connect - connection refused
Cannot connect - connection refused
-
Verify pods are running:
-
Check service exists:
-
Check port-forward command is correct:
Login fails with 'Invalid token'
Login fails with 'Invalid token'
- Token has expired (if using temporary token)
- Accessing over HTTP instead of HTTPS
- Token was not copied correctly
- Service account was deleted
403 Forbidden errors after login
403 Forbidden errors after login
404 errors loading Dashboard resources
404 errors loading Dashboard resources
- Incorrect proxy URL (missing trailing slash)
- Cluster configuration issues
- Known issue with Kubernetes 1.7.x
- Ensure URL ends with
/when using kubectl proxy - Try accessing via port-forward instead
- Check Dashboard logs:
kubectl logs -n kubernetes-dashboard -l app.kubernetes.io/name=web
Advanced Configuration
Custom TLS Certificates
Provide your own TLS certificates:Reverse Proxy with Authentication
For advanced setups, you can use a reverse proxy (e.g., OAuth2 Proxy) in front of Dashboard to handle authentication:- Deploy OAuth2 Proxy or similar
- Configure it to pass
Authorization: Bearer <token>header - Ensure the Kubernetes API server is configured to accept these tokens
- Point users to the proxy URL instead of directly to Dashboard