Step-by-Step Guide to Deploying a High‑Availability Kubernetes Cluster with NFS, Ingress, Dashboard, and Harbor
This comprehensive tutorial walks through preparing the operating system, installing Docker and containerd, configuring yum repositories, initializing a multi‑master HA Kubernetes cluster with IPVS, deploying the Kubernetes dashboard, setting up NFS storage, installing an Ingress controller, and finally installing Harbor with Helm and a custom NFS provisioner, providing all necessary commands and configuration files.
The guide begins with host preparation, including hostname configuration, hosts file updates, SSH key distribution, time synchronization, firewall and swap disabling, and SELinux deactivation across all nodes.
Docker is installed from Alibaba Cloud mirrors, and its daemon is configured with a registry mirror; containerd is then set up and its cgroup driver switched to systemd and the sandbox image source changed to Alibaba Cloud mirrors.
Kubernetes components (kubeadm, kubelet, kubectl) are installed from a custom yum repo, and the master node is initialized with kubeadm init using a specific API server advertise address, image repository, service CIDR, and pod network CIDR. The Flannel CNI plugin is deployed, and worker nodes join the cluster using a generated token.
IPVS is enabled by loading kernel modules and configuring kube-proxy to use IPVS mode. High availability is achieved by deploying Nginx and Keepalived on the master nodes, creating a virtual IP (VIP) and configuring failover scripts.
The Kubernetes dashboard is installed via a customized manifest that exposes it as a NodePort service; a ServiceAccount and ClusterRoleBinding are created to generate a login token.
NFS is installed on all nodes, a shared directory is exported, and an NFS provisioner is deployed with Helm, using the previously created NFS server as the backend storage class.
Harbor is installed via Helm with TLS certificates generated using OpenSSL, an Ingress controller is deployed (with image overrides for Alibaba Cloud mirrors), and Harbor is configured to use the NFS storage class for all its components.
Finally, the guide shows how to push images to Harbor, configure Docker and containerd to trust the private registry, and pull images directly from Harbor for use in the cluster.
Architect's Guide
Dedicated to sharing programmer-architect skills—Java backend, system, microservice, and distributed architectures—to help you become a senior architect.
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.