Installing Kubernetes Dashboard with Registry Mirror Solutions
Overview
When setting up a Kubernetes Dashboard, network restrictions and access limitations to certain registries can prevent successful deployment. This guide provides a comprehensive solution using alternative registry mirrors and proper Helm chart configuration to ensure successful installation.
Registry Mirror Mapping
Due to network constraints, direct access to certain registries may be blocked. The following mapping table provides alternative mirror URLs that have been verified to work:
Dashboard Installation Process
Step 1: Download the Helm Chart
First, add the official Kubernetes Dashboard repository and download the desired version. In this example, we'll use version 7.0.0:
# Add the official Kubernetes Dashboard repository
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
# Pull the specific version of the chart
helm pull kubernetes-dashboard/kubernetes-dashboard --version=7.0.0
Step 2: Extract and Modify Chart Configuration
Extract the downloaded archive and modify the configuration files:
# Extract the chart archive
tar -zxvf kubernetes-dashboard-7.0.0.tgz
cd kubernetes-dashboard
# Open the main values file for editing
vim values.yaml
Step 3: Update Image Registries
Replace the default registry URLs with the mirror alternatives:
# Update Docker Hub images
:%s/docker.io/docker.m.daocloud.io/g
# Update Google Container Registry images
:%s/gcr.io/gcr.m.daocloudio/g
# Update Kubernetes specific registries
:%s/k8s.gcr.io/k8s-gcr.m.daocloud.io/g
:%s/registry.k8s.io/k8s.m.daocloud.io/g
Step 4: Configure Node Placement (Optional)
If you need to deploy the dashboard on control-plane nodes instead of worker nodes, update the node selection and tolerations:
# Configure node selector to target control-plane nodes
:%s/nodeSelector: {}/nodeSelector: {kubernetes-dashboard: "master"}/g
# Add tolerations for control-plane taints
:%s/tolerations: []/tolerations: [{key: "node-role.kubernetes.io/control-plane", operator: "Exists", effect: "NoSchedule"}]/g
# Save and exit the editor
:wq
Step 5: Prepare Control-Plane Nodes
Label the control-plane nodes to match the node selector configuraton:
# Apply the required label to control-plane nodes
kubectl label nodes <control-plane-node-name> kubernetes-dashboard=master
# To remove the label if needed
kubectl label nodes <control-plane-node-name> kubernetes-dashboard-
</control-plane-node-name></control-plane-node-name>
Step 6: Update Additional Chart Values
The dashboard deployment depends on multiple components. Find and update all values.yaml files in the chart:
# Locate all values.yaml files in the chart
find ./ -name values.yaml
# Update the Kong values for node placement if needed
vim ./charts/kong/values.yaml
# Apply similar node selector and toleration changes as in the main values.yaml
Step 7: Deploy the Dashboard
Install the modified chart using Helm:
# Deploy the dashboard with the modified configuration
helm upgrade --install kubernetes-dashboard ./ --create-namespace --namespace kubernetes-dashboard
# Verify the deployment
kubectl get all -n kubernetes-dashboard
Expected Deployment Components
A successful deployment will create multiple pods including:
- Kong proxy/manager for ingress
- Dashboard API pods (with high availability configuration)
- Authentication service
- Metrics scraper
- Web interface
Each component will be exposed through appropriate services, with the web interface typically accessible via the Kong proxy on port 443.
Troubleshooting
If pods fail to start, check the image pull logs in pod descriptions. Image pull errors indicate that mirror registry URLs may need updating as mirror availability can change over time.