<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kavya Bhalodia on Medium]]></title>
        <description><![CDATA[Stories by Kavya Bhalodia on Medium]]></description>
        <link>https://medium.com/@kavyabhalodia22?source=rss-a7f378b79b40------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tYgMOJ2RZl6O8dP4</url>
            <title>Stories by Kavya Bhalodia on Medium</title>
            <link>https://medium.com/@kavyabhalodia22?source=rss-a7f378b79b40------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:41:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kavyabhalodia22/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Converting a Running Non-HA Kubernetes Cluster to an HA Cluster]]></title>
            <link>https://medium.com/@kavyabhalodia22/converting-a-running-non-ha-kubernetes-cluster-to-an-ha-cluster-b2a5432e2d4d?source=rss-a7f378b79b40------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2a5432e2d4d</guid>
            <category><![CDATA[ha-kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes-multi-master]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Kavya Bhalodia]]></dc:creator>
            <pubDate>Thu, 29 May 2025 02:55:11 GMT</pubDate>
            <atom:updated>2025-06-22T12:47:03.527Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y5-D49shxaDSRjh6" /></figure><p>As your infrastructure grows, the need for high availability (HA) becomes critical to avoid single points of failure. Kubernetes supports high availability natively, but many clusters are initially set up with just a single control plane node for simplicity. In this guide, we walk through how to convert a running <strong>non-HA Kubernetes cluster</strong> into a <strong>highly available cluster</strong>, step by step.</p><h3>Overview</h3><p>The process involves six main steps assuming:</p><ol><li>Set up an NGINX load balancer</li><li>Update the kubeadm configuration</li><li>Regenerate control plane certificates</li><li>Update critical Kubernetes configuration files</li><li>Join additional control plane nodes</li><li>Reconfigure existing worker nodes to point to the load balancer</li></ol><p>Note: Take backup of the existing ETCD to be on the safer side. Refer to this for backup and restore process — <a href="https://medium.com/@kavyabhalodia22/how-to-restore-a-failed-k8s-cluster-using-etcd-ha-and-non-ha-525f36c3ef0a">https://medium.com/@kavyabhalodia22/how-to-restore-a-failed-k8s-cluster-using-etcd-ha-and-non-ha-525f36c3ef0a</a></p><h3>Step 1: Create a NGINX Load Balancer</h3><p>The load balancer is essential to distribute traffic among multiple control planes.</p><h3>Install NGINX:</h3><pre># Update package lists<br>sudo apt update<br><br># Install Nginx<br>sudo apt install -y nginx<br><br># Install nginx stream module (already included in standard nginx install in Ubuntu)<br># If needed explicitly:<br>sudo apt install -y libnginx-mod-stream<br><br># Start and enable nginx<br>sudo systemctl start nginx<br>sudo systemctl enable nginx</pre><h3>Configure NGINX:</h3><p>Edit the config file:</p><pre>vim /etc/nginx/nginx.conf</pre><p>Add the following block:</p><pre>stream {<br>    upstream apiserver_read {<br>        server &lt;CONTROL_PLANE_IP_1&gt;:6443;<br>        server &lt;CONTROL_PLANE_IP_2&gt;:6443;<br>        server &lt;CONTROL_PLANE_IP_3&gt;:6443;<br>    }<br>    server {<br>        listen 6443;<br>        proxy_pass apiserver_read;<br>    }<br>}</pre><h3>Reload NGINX:</h3><pre>nginx -s reload</pre><h3>Step 2: Update kubeadm Configuration</h3><p>Edit the kubeadm config map on the current control plane node:</p><pre>kubectl edit cm kubeadm-config -n kube-system</pre><p>Under data.ClusterConfiguration.apiServer, add:</p><pre>certSANs:<br>- &quot;10.96.0.1&quot;<br>- &quot;&lt;NODE_IP&gt;&quot;<br>- &quot;kubernetes.default&quot;<br>- &quot;kubernetes&quot;<br>- &quot;kubernetes.default.svc&quot;<br>- &quot;kubernetes.default.svc.cluster.local&quot;<br>- &quot;&lt;HOSTNAME&gt;&quot;<br>- &quot;&lt;LOAD_BALANCER_IP&gt;&quot;</pre><p>Also add under data.ClusterConfiguration:</p><pre>controlPlaneEndpoint: &lt;LOAD_BALANCER_IP</pre><h3>Step 3: Generate New Certificates</h3><p>Backup and remove existing certificates:</p><pre>sudo mv /etc/kubernetes/pki/apiserver.crt /etc/kubernetes/pki/apiserver.crt.backup<br>sudo mv /etc/kubernetes/pki/apiserver.key /etc/kubernetes/pki/apiserver.key.backu</pre><p>Create a new kubeadm-config.yaml</p><pre>apiVersion: kubeadm.k8s.io/v1beta3<br>kind: ClusterConfiguration<br>controlPlaneEndpoint: &lt;LOAD_BALANCER_IP&gt;<br>apiServer:<br>  certSANs:<br>    - &quot;10.96.0.1&quot;<br>    - &quot;&lt;NODE_IP&gt;&quot;<br>    - &quot;kubernetes.default&quot;<br>    - &quot;kubernetes&quot;<br>    - &quot;kubernetes.default.svc&quot;<br>    - &quot;kubernetes.default.svc.cluster.local&quot;<br>    - &quot;&lt;HOSTNAME&gt;&quot;<br>    - &quot;&lt;LOAD_BALANCER_IP&gt;&quot;<br>  timeoutForControlPlane: 4m0s<br>certificatesDir: /etc/kubernetes/pki<br>clusterName: kubernetes<br>imageRepository: registry.k8s.io<br>kubernetesVersion: v1.30.3<br>networking:<br>  podSubnet: 10.244.0.0/16<br>  serviceSubnet: 10.96.0.0/12</pre><p>Generate new API server certs:</p><pre>sudo kubeadm init phase certs apiserver --config /path/to/kubeadm-config.yam</pre><h3>Step 4: Update Kubernetes Config Files</h3><p>Update the server: field in the following files to point to the load balancer:</p><pre>vi /etc/kubernetes/controller-manager.conf<br>vi /etc/kubernetes/scheduler.conf<br>vi /etc/kubernetes/kubelet.conf</pre><p>Restart kubelet:</p><pre>systemctl restart kubelet</pre><p>Update the kube-proxy config:</p><pre>kubectl edit cm kube-proxy -n kube-system<br>kubectl rollout restart ds kube-proxy -n kube-system</pre><p>Update your kubeconfig:</p><pre>vi ~/.kube/config</pre><p>Restart the API server pod and container</p><pre>kubectl delete po kube-apiserver-&lt;node-name&gt; -n kube-system<br>crictl ps<br>crictl stop &lt;CONTAINER_ID&gt;<br>crictl rm &lt;CONTAINER_ID&gt;</pre><p>Verify the SANs:</p><pre>openssl x509 -in /etc/kubernetes/pki/apiserver.crt -text -noout | grep -A 1 &quot;Subject Alternative Name&quot;</pre><h3>Step 5: Join Additional Control Planes</h3><p>Upload certs and generate the certificate key:</p><pre>sudo kubeadm init phase upload-certs --upload-certs</pre><p>Generate the join command:</p><pre>kubeadm token create --print-join-command</pre><p>Run the command on the new control plane node:</p><pre>kubeadm join &lt;LOAD_BALANCER_IP&gt;:6443 \<br>  --token &lt;TOKEN&gt; \<br>  --discovery-token-ca-cert-hash sha256:&lt;HASH&gt; \<br>  --control-plane \<br>  --certificate-key &lt;CERTIFICATE_KEY&gt;</pre><h3>Step 6: Reconfigure Existing Worker Nodes</h3><p>Edit the kubelet config:</p><pre>vi /etc/kubernetes/kubelet.conf</pre><p>Update the server line to:</p><pre>server: https://&lt;LOAD_BALANCER_IP&gt;:6443</pre><p>Restart kubelet:</p><pre>systemctl restart kubelet</pre><h3>Step 7: Join new Worker Nodes</h3><p>Generate command to join new worker node and run it on machines to join.</p><pre>kubeadm token create --print-join-command</pre><h3>Conclusion</h3><p>Converting a non-HA Kubernetes cluster to HA is a risky process, but if done carefully and tested in a dev or staging environment, it can be a practical alternative to a full cluster migration. While some downtime is expected, this approach can save time and effort by upgrading the existing setup instead of building a new one from scratch.</p><p>While this method isn’t officially recommended for production clusters, it provides a practical path forward when downtime is manageable and rebuilding from scratch isn’t feasible.</p><p>Ultimately, you can choose between migrating to a new HA cluster or upgrading the current one based on your tolerance for downtime, complexity, and resource availability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2a5432e2d4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up PostgreSQL HA & Cross-Cluster Replication using Zalando Postgres Operator in Kubernetes]]></title>
            <link>https://medium.com/@kavyabhalodia22/setting-up-postgresql-ha-cross-cluster-replication-using-zalando-postgres-operator-8d131461a105?source=rss-a7f378b79b40------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d131461a105</guid>
            <dc:creator><![CDATA[Kavya Bhalodia]]></dc:creator>
            <pubDate>Fri, 11 Apr 2025 09:39:56 GMT</pubDate>
            <atom:updated>2025-04-11T14:11:25.535Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*1oG-IKSKSrWPRKLw5Tb9BA.jpeg" /></figure><p>The Zalando Postgres Operator simplifies the deployment and management of PostgreSQL clusters in Kubernetes, delivering out-of-the-box support for:</p><ul><li>High availability</li><li>Disaster recovery (DR)</li><li>Integration with cloud-native tooling (like S3 backups)</li></ul><h3>How Zalando Postgres Operator Handles HA with Patroni</h3><p>Zalando operator uses <strong>Patroni</strong> — a battle-tested HA framework for PostgreSQL. Patroni coordinates PostgreSQL instances using a <strong>Distributed Configuration Store (DCS)</strong> to ensure that only one primary (leader) exists at a time, and orchestrates automated failovers in case of node or pod failures.</p><h3>How Patroni Works in Kubernetes</h3><p>In traditional setups, Patroni can use DCS backends like etcd<strong> </strong>or Consul. However, in Kubernetes, Patroni leverages the Kubernetes resources itself as a DCS<strong> </strong>— a more native and simplified approach that eliminates the need to maintain an external consensus system.</p><p>Key components of how Patroni operates within Kubernetes:</p><ul><li><strong>DCS via Kubernetes API</strong>: Patroni uses Kubernetes ConfigMaps or Endpoints to store cluster state, including the identity of the leader and other critical coordination data.</li><li><strong>Leader Election</strong>: All Patroni-managed PostgreSQL pods participate in leader election using the DCS. One pod becomes the primary, while the others stay in sync as replicas.</li><li><strong>Health Monitoring</strong>: Each instance continuously monitors its own health and PostgreSQL status. Unhealthy nodes automatically remove themselves from eligibility for leadership.</li><li><strong>Failover Mechanism</strong>: When the current primary fails, a healthy replica is promoted to primary.</li></ul><h3>Step 1: Install the Zalando Postgres Operator using Helm</h3><p>Start by adding the Helm repository and installing the operator in your Kubernetes cluster.</p><pre>bash<br>CopyEdit<br>helm repo add postgres-operator-charts &lt;https://opensource.zalando.com/postgres-operator/charts/postgres-operator&gt;<br>helm repo update</pre><pre># Create a namespace<br>kubectl create namespace postgres# Install the operator<br>helm install postgres-operator postgres-operator-charts/postgres-operator --namespace postgres</pre><h3>Step 2: Deploy a PostgreSQL HA Cluster</h3><p>Create a manifest file named postgres.yaml with the following content:</p><pre>apiVersion: &quot;acid.zalan.do/v1&quot;<br>kind: postgresql<br>metadata:<br>  name: postgres-postgresql<br>spec:<br>  teamId: &quot;postgres&quot;<br>  numberOfInstances: 3<br>  users:<br>    zalando:  <br>    - superuser<br>    - createdb <br>  databases:<br>    zalando: zalando<br>  postgresql:<br>    version: &quot;16&quot;<br>  volume:<br>    size: 10Gi<br>  resources:<br>    requests:<br>      cpu: &quot;1&quot;<br>      memory: 5Gi<br>    limits:<br>      cpu: &quot;2&quot;<br>      memory: 10Gi</pre><blockquote><em>This configuration sets up a minimal HA cluster with 2 instances and logical backups enabled.</em></blockquote><pre>kubectl apply -f postgres.yaml -n postgres</pre><h3>Step 3: Expose PostgreSQL with a NodePort Service</h3><p>By default, the Zalando Postgres Operator creates a <strong>ClusterIP and Loadbalancer </strong>service for your PostgreSQL instance. Create a nodeport service for primary postgres.</p><p>Create service.yaml as given below:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: postgres-postgresql-nodeport<br>  namespace: postgres<br>spec:<br>  type: NodePort<br>  selector:<br>    spilo-role: master<br>  ports:<br>    - protocol: TCP<br>      port: 5432<br>      targetPort: 5432<br>      nodePort: 30003</pre><pre>kubectl apply -f service.yaml</pre><h3>Step 3: Setup Cross-Cluster Replication (Disaster Recovery)</h3><p>If you want to set up a standby cluster in another Kubernetes cluster (for DR purposes), follow the steps below.</p><h3>Assumptions</h3><ul><li>Both clusters are either on the same network or are connected through a secure tunnel (e.g., VPN or WireGuard), allowing direct communication between them.</li><li>Primary postgres can be reached by standby postgres over nodePort</li></ul><h3>3.1 Primary Cluster Config</h3><p>Ensure that the PostgreSQL HBA config in the primary cluster allows replication connections, for that add the following configuration in postgresql resource manifest :</p><pre>spec:<br>  patroni:<br>    pg_hba: <br>      - local all all md5<br>      - host all all 0.0.0.0/0 md5<br>      - host replication standby 10.250.0.0/16 md5<br>      - local replication standby md5</pre><h3>3.2 Standby Cluster Manifest</h3><p>Create a standby-postgres.yaml like below:</p><pre>apiVersion: &quot;acid.zalan.do/v1&quot;<br>kind: postgresql<br>metadata:<br>  name: postgres-postgresql<br>spec:<br>  teamId: &quot;postgres&quot;<br>  volume:<br>    size: 10Gi<br>  numberOfInstances: 1<br>  postgresql:<br>    version: &quot;16&quot;<br>  standby:<br>    standby_host: &quot;&lt;node_ip&gt;&quot;       # IP of primary postgres<br>    standby_port: &quot;30840&quot;             # NodePort of primary postgres</pre><h3>3.3 Standby Secret</h3><p>Create a Kubernetes standby-secret.yaml in the <strong>standby cluster</strong>, copy the standby user’s credentials from the primary cluster:</p><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: standby.postgres-postgresql.credentials.postgresql.acid.zalan.do<br>  namespace: postgres<br>  labels:<br>    application: spilo<br>    cluster-name: postgres-postgresql<br>    team: postgres<br>type: Opaque<br>data:<br>  username: c3RhbmRieQ== # base64 of &#39;standby&#39;<br>  password: &lt;base64_encoded_password_of_standby_user_from_primary&gt;</pre><p>Apply the manifests:</p><pre>bash<br>CopyEdit<br>kubectl apply -f standby-postgres.yaml -n postgres<br>kubectl apply -f standby-secret.yaml -n postgres</pre><h3>Bonus: PostgreSQL Logical Backups to S3 using Zalando Operator</h3><p>The Zalando Postgres Operator supports <strong>scheduled logical backups</strong> to S3-compatible storage. To enable this feature, do the following:</p><h3>1. Add backup config to the operator Helm values</h3><p>Upgrade the postgres operator:</p><pre>helm upgrade postgres-operator postgres-operator-charts/postgres-operator \\<br>  --namespace postgres-operator \\<br>  --set configLogicalBackup.logical_backup_s3_access_key_id={access_key} \\<br>  --set configLogicalBackup.logical_backup_s3_secret_access_key={secret_access_key} \\<br>  --set configLogicalBackup.logical_backup_s3_bucket={bucket_name} \\<br>  --set configLogicalBackup.logical_backup_s3_region={region} \\<br>  --set configLogicalBackup.logical_backup_schedule=&quot;*/15 * * * *&quot; #schedule</pre><h3>2. Ensure the Postgres cluster manifest has backups enabled</h3><p>You already have this in postgres.yaml:</p><pre>spec:<br>  enableLogicalBackup: true</pre><p>This tells the operator to enable backups for this cluster using the S3 settings above.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d131461a105" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to restore a failed k8s cluster using etcd : HA and non HA]]></title>
            <link>https://medium.com/@kavyabhalodia22/how-to-restore-a-failed-k8s-cluster-using-etcd-ha-and-non-ha-525f36c3ef0a?source=rss-a7f378b79b40------2</link>
            <guid isPermaLink="false">https://medium.com/p/525f36c3ef0a</guid>
            <category><![CDATA[cluster-restore]]></category>
            <category><![CDATA[etcd-backup-and-restore]]></category>
            <category><![CDATA[etcd-restore]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cluster-recovery]]></category>
            <dc:creator><![CDATA[Kavya Bhalodia]]></dc:creator>
            <pubDate>Wed, 19 Feb 2025 17:53:24 GMT</pubDate>
            <atom:updated>2025-02-19T17:53:24.039Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to restore a failed k8s cluster using etcd : HA and non HA</h3><p>Restoring a Kubernetes cluster after a failure is crucial to maintain availability and prevent data loss. This guide provides step-by-step instructions to restore both High-Availability (HA) and non-HA clusters using etcd backups.</p><h3>Restoring a Non-HA (Single Master Node) Cluster</h3><p>A non-HA Kubernetes cluster has a single master node. If this node fails completely, the only way to restore the cluster is through an etcd backup. This backup can be taken using Velero, etcdctl, or other backup utilities.</p><h4>Method 1: Restoring etcd from Backup</h4><p><strong>Step 1: Install etcdctl</strong></p><ul><li>To interact with etcd, install the etcdctl utility:</li></ul><pre>wget &lt;https://github.com/etcd-io/etcd/releases/download/v3.5.17/etcd-v3.5.17-linux-amd64.tar.gz&gt;<br>tar -xvf etcd-v3.5.17-linux-amd64.tar.gz<br>sudo mv etcd-v3.5.17-linux-amd64/etcdctl /usr/local/bin/<br>etcdctl --version</pre><p><strong>Step 2: Take an etcd Backup</strong></p><ul><li>If you have not taken a backup earlier, use the following command:</li></ul><pre>ETCDCTL_API=3 etcdctl --endpoints &lt;node-ip&gt;:2379 --cert=/etc/kubernetes/pki/etcd/server.crt \\<br>--key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt snapshot save /var/lib/etcd/backup.db</pre><p><strong>Step 3: Temporarily Move the Static Pod Manifests</strong></p><ul><li>Since etcd runs as a static pod controlled by kubelet, we must prevent it from being restarted while restoring:</li></ul><pre>mkdir /tmp/manifest-backup<br>mv /etc/kubernetes/manifests/* /tmp/manifest-backup/</pre><p><strong>Step 4: Remove Existing etcd Data</strong></p><ul><li>Before restoring, we must clear the existing etcd data:</li></ul><pre>mkdir /tmp/etcd<br>mv /var/lib/etcd /tmp/etcd<br>rm -rf /var/lib/etcd/*</pre><p><strong>Step 5: Restore etcd from Backup</strong></p><pre>ETCDCTL_API=3 etcdctl snapshot restore /var/lib/etcd/backup.db --data-dir /var/lib/etcd</pre><p><strong>Step 6: Move Manifests Back &amp; Restart kubelet</strong></p><pre>mv /tmp/manifest-backup/* /etc/kubernetes/manifests/<br>systemctl restart kubelet</pre><p>This will restart etcd, and the Kubernetes control plane should become available.</p><h4>Method 2: Restoring etcd to a New Data Directory</h4><p>This method is useful if you want to restore etcd without overwriting the existing directory.</p><p><strong>Step 1: Restore etcd to a New Directory</strong></p><pre>ETCDCTL_API=3 etcdctl snapshot restore /var/lib/etcd/backup.db --data-dir /var/lib/etcd-new</pre><p><strong>Step 2: Stop kubelet</strong></p><pre>systemctl stop kubelet</pre><p><strong>Step 3: Modify etcd Pod Manifest</strong></p><ul><li>Modify the hostPath in /etc/kubernetes/manifests/etcd.yaml to point to the new directory:</li></ul><pre>- hostPath:<br>    path: /var/lib/etcd-new<br>    type: DirectoryOrCreate<br>  name: etcd-data</pre><p><strong>Step 4: Restart kubelet</strong></p><pre>systemctl start kubelet</pre><h3>Recovering a High Availability (HA) Kubernetes Cluster</h3><p>Recovering an HA cluster is similar to recovering a non-HA one, but with an added advantage: you can restore a failed HA cluster even without a backup — provided at least one control plane node remains functional.</p><h4>Understanding the Failure Scenario</h4><p>If two master nodes fail, their corresponding etcd instances also go down. Since etcd requires a quorum (majority) to function, the Kubernetes API server will become inaccessible, preventing kubectl commands from working.</p><h4>Recovery Steps</h4><p>If at least one master node has an intact /var/lib/etcd data directory or a backup, you can restore the cluster. Follow these steps:</p><p>If at least one master node is running and has an intact /var/lib/etcd directory, the cluster can be restored.</p><p><strong>Step 1: Take an etcd Backup</strong></p><ul><li>Run the following command on a functional master node(you will be able to take backup using etcdctl if you have one node that has /var/lib/etcd data directory intact)</li></ul><pre>ETCDCTL_API=3 etcdctl --endpoints &lt;node-ip&gt;:2379 --cert=/etc/kubernetes/pki/etcd/server.crt \\<br>--key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt snapshot save /var/lib/etcd/backup.db</pre><p><strong>Step 2: Move Back Manifests &amp; Restart kubelet</strong></p><pre>mv /tmp/manifest-backup/* /etc/kubernetes/manifests/<br>systemctl restart kubelet</pre><p><strong>Step 3: Modify etcd Pod Manifest</strong></p><p>Modify /etc/kubernetes/manifests/etcd.yaml and set the --initial-cluster flag to include only the current node:</p><pre>- --initial-cluster=&quot;&lt;current-node-name&gt;=&lt;current-node-ip&gt;:2380&quot;</pre><p><strong>Step 4: Restore etcd from Backup</strong></p><ul><li>This will convert the multi-node etcd cluster to a single-node cluster. This command effectively promotes the three-node etcd cluster to a single-node cluster, eliminating the quorum requirement for it to start.</li><li>The --initial-cluster flag plays a crucial role in this process, as it reconfigures etcd to operate as a standalone node. During restoration, etcd overrides the existing cluster metadata and restores the data from the specified backup directory to the designated location.</li></ul><pre>ETCDCTL_API=3 etcdctl snapshot restore /var/lib/etcd/backup.db --data-dir /var/lib/etcd</pre><p><strong>Step 5: Rejoin Other Master Nodes</strong></p><p>Once the first master node is restored, the remaining masters must be rejoined.</p><ul><li>Generate the Join Command</li></ul><pre>kubeadm init phase upload-certs --upload-certs<br>kubeadm token create --print-join-command</pre><ul><li>Run on Other Master Nodes</li></ul><pre>kubeadm join &lt;master-node-ip&gt;:6443 --control-plane --certificate-key &lt;key&gt;</pre><p>After all master nodes are restored, the cluster should be fully functional again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=525f36c3ef0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>