0
0
Kubernetesdevops~30 mins

High availability cluster setup in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
High Availability Cluster Setup
📖 Scenario: You are working as a DevOps engineer tasked with setting up a high availability Kubernetes cluster. This cluster will ensure that your application stays online even if one of the master nodes fails.Think of it like having multiple backup generators at home. If one stops working, the others keep the lights on without interruption.
🎯 Goal: Build a simple Kubernetes cluster configuration with multiple master nodes for high availability. You will create the initial cluster configuration, add a control plane endpoint, configure multiple master nodes, and finally verify the cluster status.
📋 What You'll Learn
Create a basic Kubernetes cluster configuration file named kubeadm-config.yaml with a single master node.
Add a control plane endpoint to enable high availability.
Add two additional master nodes to the configuration.
Verify the cluster status using kubectl commands.
💡 Why This Matters
🌍 Real World
High availability clusters keep applications running without interruption even if some servers fail, which is critical for business continuity.
💼 Career
DevOps engineers often set up and maintain highly available Kubernetes clusters to ensure reliable application deployment and uptime.
Progress0 / 4 steps
1
Create initial cluster configuration
Create a file named kubeadm-config.yaml with the following content exactly: a ClusterConfiguration kind, Kubernetes version v1.26.0, and a single control plane endpoint set to "localhost:6443". Include one master node with the name master1 and IP 192.168.1.10 under nodes.
Kubernetes
Need a hint?

Use YAML format. The controlPlaneEndpoint is the address clients use to connect to the cluster.

2
Add control plane endpoint for high availability
Modify kubeadm-config.yaml to change the controlPlaneEndpoint from "localhost:6443" to "ha-cluster.example.com:6443" to enable high availability access point.
Kubernetes
Need a hint?

The controlPlaneEndpoint should be a DNS name or IP that points to your load balancer for masters.

3
Add two more master nodes
Add two more master nodes to kubeadm-config.yaml under nodes: master2 with IP 192.168.1.11 and master3 with IP 192.168.1.12. Both should have the role master.
Kubernetes
Need a hint?

Indent the new nodes properly under nodes in YAML.

4
Verify cluster status
Run the command kubectl get nodes to display the status of all nodes in the cluster.
Kubernetes
Need a hint?

Make sure your cluster is running and kubectl is configured to connect to it.