Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Installing Kubernetes Dashboard with Registry Mirror Solutions

Tech May 17 1

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.

Tags: Kubernetes

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.