<?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"><channel><title><![CDATA[Chandan.CloudOps]]></title><description><![CDATA[Chandan.CloudOps]]></description><link>https://air-gap-kubernetes-cluster-setup.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 12:58:55 GMT</lastBuildDate><atom:link href="https://air-gap-kubernetes-cluster-setup.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Setting Up an Air-Gapped Kubernetes Cluster]]></title><description><![CDATA[Overview:
This comprehensive guide walks you through the setup of an air-gapped Kubernetes cluster. We’ll begin by provisioning the necessary infrastructure using Terraform, followed by configuring Kubernetes in an isolated environment.  
Why Air-Gap...]]></description><link>https://air-gap-kubernetes-cluster-setup.hashnode.dev/setting-up-an-air-gapped-kubernetes-cluster</link><guid isPermaLink="true">https://air-gap-kubernetes-cluster-setup.hashnode.dev/setting-up-an-air-gapped-kubernetes-cluster</guid><dc:creator><![CDATA[chandan kumar]]></dc:creator><pubDate>Sat, 28 Sep 2024 06:19:39 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-overview">Overview:</h1>
<p>This comprehensive guide walks you through the setup of an air-gapped Kubernetes cluster. We’ll begin by provisioning the necessary infrastructure using Terraform, followed by configuring Kubernetes in an isolated environment.  </p>
<h2 id="heading-why-air-gapped"><strong>Why Air-Gapped?</strong></h2>
<p>Air-gapped Kubernetes clusters are deployed in environments without direct internet access, ensuring maximum security by minimizing external threats. This setup is ideal for industries such as finance, healthcare, or government, where data sensitivity is a priority.</p>
<h3 id="heading-step-1-provisioning-the-infrastructure"><strong>Step 1: Provisioning the Infrastructure</strong></h3>
<p>To kickstart the setup, we'll first provision the infrastructure using Terraform. The following steps will guide you through initializing, planning, and applying the Terraform configuration to build a robust and secure environment for your air-gapped cluster.</p>
<h4 id="heading-instructions"><strong>Instructions:</strong></h4>
<ol>
<li><p><strong>Navigate to the Terraform Configuration Directory:</strong><br /> Open your terminal and navigate to the directory containing the Terraform configuration files:</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">cd</span> infrastructure
</code></pre>
</li>
<li><p><strong>Initialize Terraform:</strong><br /> This command downloads necessary provider plugins and sets up your working environment.</p>
<pre><code class="lang-bash"> terraform init
</code></pre>
</li>
<li><p><strong>Generate the Execution Plan:</strong><br /> Create an execution plan to verify the resources that Terraform will create or modify:</p>
<pre><code class="lang-bash"> terraform plan
</code></pre>
</li>
<li><p><strong>Apply the Execution Plan:</strong><br /> Once you've reviewed and verified the plan, apply it to provision the infrastructure:</p>
<pre><code class="lang-bash"> terraform apply --auto-approve
</code></pre>
</li>
</ol>
<h4 id="heading-infrastructure-overview"><strong>Infrastructure Overview:</strong></h4>
<p>Upon successful completion, the following infrastructure will be provisioned:</p>
<ul>
<li><p><strong>Virtual Private Cloud (VPC):</strong><br />  Segmented for network isolation.</p>
</li>
<li><p><strong>Public and Private Subnets:</strong><br />  Public subnet for the Bastion host and private subnets for your Kubernetes nodes.</p>
</li>
<li><p><strong>Security Groups:</strong><br />  To control inbound and outbound traffic.</p>
</li>
<li><p><strong>Bastion Host:</strong><br />  Serves as a secure gateway for accessing the private network.</p>
</li>
<li><p><strong>Kubernetes Master and Worker Nodes:</strong><br />  Deployed in the private subnet for enhanced security.</p>
</li>
</ul>
<hr />
<h3 id="heading-step-2-configuring-the-kubernetes-cluster"><strong>Step 2: Configuring the Kubernetes Cluster</strong></h3>
<p>With the infrastructure in place, the next step is to set up your air-gapped Kubernetes cluster. For detailed configuration instructions, please refer to the <a target="_blank" href="https://drive.google.com/file/d/14Yn4qx_wh5MN8DdcAQs7nwCamqy20Zo9/view?usp=sharing">Kubernetes Installation Documentation</a>.</p>
<p>Document Link: <a target="_blank" href="https://drive.google.com/file/d/14Yn4qx_wh5MN8DdcAQs7nwCamqy20Zo9/view?usp=sharing">https://drive.google.com/file/d/14Yn4qx_wh5MN8DdcAQs7nwCamqy20Zo9/view?usp=sharing</a></p>
<h3 id="heading-step-3-configuring-nodes-and-system-components"><strong>Step 3: Configuring Nodes and System Components</strong></h3>
<ul>
<li><p><strong>Master Node Configuration:</strong><br />  Install and configure the necessary Kubernetes components (<code>kube-apiserver</code>, <code>kube-controller-manager</code>, <code>kube-scheduler</code>, etc.).</p>
</li>
<li><p><strong>Worker Node Setup:</strong><br />  Deploy and configure <code>kubelet</code> and <code>kube-proxy</code> services.</p>
</li>
<li><p><strong>Install Core DNS and Network Plugins:</strong><br />  Choose and configure the appropriate CNI (Container Network Interface) plugin (e.g., Calico, Weave).</p>
</li>
<li><p><strong>Deploy Custom Container Registry:</strong><br />  An essential step for pulling images in an offline environment.</p>
</li>
</ul>
<h3 id="heading-why-use-terraform-for-provisioning"><strong>Why Use Terraform for Provisioning?</strong></h3>
<p>Terraform is an infrastructure-as-code tool that allows you to define, manage, and automate cloud infrastructure using simple and declarative configuration files. Its benefits include:</p>
<ul>
<li><p><strong>Version Control:</strong> Maintain history and easily track changes.</p>
</li>
<li><p><strong>Reusability:</strong> Use the same configuration to replicate environments.</p>
</li>
<li><p><strong>Multi-Cloud Capability:</strong> Deploy infrastructure across different providers.</p>
</li>
</ul>
<hr />
<h3 id="heading-final-steps-cluster-validation-and-testing"><strong>Final Steps: Cluster Validation and Testing</strong></h3>
<ol>
<li><p><strong>Access the Bastion Host:</strong><br /> Use SSH to connect to the Bastion host and verify that all nodes are up and running:</p>
<pre><code class="lang-bash"> ssh -i /path/to/private-key.pem ubuntu@bastion-host-ip
</code></pre>
</li>
<li><p><strong>Run Connectivity Tests:</strong><br /> Verify that master and worker nodes can communicate properly.</p>
</li>
<li><p><strong>Deploy a Sample Application:</strong><br /> Deploy a sample application to test the cluster functionality in the air-gapped environment.</p>
</li>
<li><p><strong>Monitor the Cluster:</strong><br /> Use monitoring tools such as Prometheus and Grafana for insights into cluster performance and health.</p>
</li>
</ol>
<hr />
<h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
<p>Setting up an air-gapped Kubernetes cluster involves a series of well-coordinated steps, from infrastructure provisioning to node configuration. While the process can be complex, the benefits of maintaining a highly secure and isolated environment are substantial.</p>
<p>By following this guide, you can establish a solid foundation for your air-gapped Kubernetes deployments, ensuring that your critical workloads remain secure and accessible only through approved channels.</p>
<h4 id="heading-for-more-content-like-this"><strong>For More Content Like This</strong></h4>
<p>If you found this article helpful, be sure to <a target="_blank" href="https://hasnode.com"><strong>subscribe to my channel</strong></a> for more DevOps and cloud engineering tutorials!</p>
<h4 id="heading-connect-with-me"><strong>Connect With Me:</strong></h4>
<p>Stay up to date with the latest cloud trends and best practices:</p>
<ul>
<li><p><a target="_blank" href="https://linkedin.com/in/chandan-kumar">LinkedIn</a>: <a target="_blank" href="https://www.linkedin.com/in/chandan-kumar-0769ab21b/">https://www.linkedin.com/in/chandan-kumar-0769ab21b/</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/chandan-kumar">GitHub</a>: <a target="_blank" href="https://github.com/chandan-cloudops">https://github.com/chandan-cloudops</a></p>
</li>
<li><p><strong>Website</strong>: <a target="_blank" href="https://chandan-cloudops.github.io/chandan.cloudops_github.io/">https://chandan-cloudops.github.io/chandan.cloudops_github.io/</a></p>
</li>
</ul>
<hr />
<p>By presenting the technical content in a structured and visually appealing way, you ensure that your readers can follow along easily. Make sure to include diagrams, screenshots, or code samples where appropriate for a more immersive learning experience.</p>
]]></content:encoded></item></channel></rss>