Step-by-Step Guide to Deploying a High‑Availability Kubernetes Cluster with Dashboard and Harbor
This comprehensive tutorial walks through preparing multiple Linux nodes, installing Docker and containerd, setting up kubeadm, kubelet and kubectl, initializing a HA Kubernetes control plane, configuring Flannel networking, deploying the Kubernetes dashboard, installing Nginx + Keepalived for load balancing, setting up NFS with rsync, provisioning storage via Helm, and finally installing a secure Harbor image registry, all with detailed commands and configuration snippets.
This article provides a comprehensive step‑by‑step tutorial for building a production‑grade Kubernetes (k8s) cluster with high availability, including installation of Docker, containerd, kubeadm, kubelet, and kubectl on multiple nodes.
It details pre‑deployment tasks such as hostname configuration, hosts file setup, SSH key distribution, time synchronization, firewall and swap disabling, SELinux adjustment, and kernel module loading for IPVS.
Docker is installed from Alibaba Cloud mirrors, followed by containerd configuration to use systemd cgroup driver and replace the deprecated dockershim.
Kubernetes components are installed via yum, then the master node is initialized with kubeadm init using a custom image repository and pod network CIDR, and the cluster is joined by worker nodes using generated tokens.
Network plugins (Flannel) are deployed, and IPVS load balancing is configured with required kernel modules and kube‑proxy mode changes.
High‑availability is achieved by adding a second master and configuring a virtual IP with Nginx and Keepalived, including detailed Nginx and Keepalived configuration files.
The Kubernetes dashboard is deployed as a NodePort service, a ServiceAccount with cluster‑admin role is created, and login token generation is shown.
NFS server setup, export configuration, client mounting, and rsync synchronization (including rsync daemon setup) are described, followed by deployment of the nfs‑subdir‑external‑provisioner via Helm with a StorageClass.
Harbor registry is installed using Helm with TLS certificates, custom storage class, and ingress configuration; steps for creating self‑signed certificates, adding them to containerd, and pulling images from Harbor are included.
Finally, verification commands, screenshots, and troubleshooting tips are provided throughout the guide.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.