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.The methods described here assume you used the default Helm-based installation. If you modified the default configuration, you may need to adjust the service names and namespaces accordingly.
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
Forward the Kong proxy service to your local machine:
The command will block your terminal. Keep it running while you access Dashboard.
Login
You’ll be presented with the Dashboard login screen. You’ll need a bearer token to authenticate.See the Creating Sample User section below for instructions on generating a token.
- 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:Important Limitation: When using
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
Ensure you have:
- 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
Update your Dashboard installation with Ingress enabled:Replace
dashboard.example.com with your actual domain.These annotations ensure proper HTTPS communication between the ingress controller and Dashboard’s Kong gateway.
NodePort Service
Expose Dashboard directly on a node port (not recommended for production):LoadBalancer Service
For cloud environments, use a LoadBalancer service:Get External IP
Wait for the external IP to be assigned:This may take several minutes depending on your cloud provider.
LoadBalancer services typically incur additional costs from your cloud provider and expose Dashboard to the internet. Ensure you have proper authentication and network policies in place.
Authentication
Creating a Sample User
To access Dashboard, you need a bearer token. Here’s how to create a sample admin user:Generate Token
Create a temporary token:This will output a JWT token. Copy it for use in the Dashboard login screen.For a long-lived token, create a Secret:Then retrieve it:
Clean Up Sample User
When you’re done testing, remove the admin user:Security Considerations
Always use HTTPS
Always use HTTPS
Dashboard should only be accessed over HTTPS. The Kong gateway uses HTTPS by default. Never disable TLS in production.
Network Policies
Network Policies
Consider enabling network policies to restrict access:
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
Dashboard runs with restrictive security contexts by default:
- 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
Cause: Dashboard uses self-signed certificates by default.Solutions:
- 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
Troubleshooting steps:
-
Verify pods are running:
-
Check service exists:
-
Check port-forward command is correct:
Login fails with 'Invalid token'
Login fails with 'Invalid token'
Possible causes:
- 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
Cause: The service account doesn’t have sufficient permissions.Solution: Review and update the RBAC permissions for your service account. See Kubernetes RBAC documentation for details.
404 errors loading Dashboard resources
404 errors loading Dashboard resources
Possible causes:
- 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
Next Steps
Access Control
Learn about Kubernetes RBAC and how to configure granular permissions for Dashboard users
View Metrics
Enable metrics-server to view resource usage graphs in Dashboard