<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chisom Uma</title>
    <description>The latest articles on DEV Community by Chisom Uma (@chisom_uma_f5778f8ee951bd).</description>
    <link>https://dev.to/chisom_uma_f5778f8ee951bd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2889254%2Ffa51d65f-9fbe-4989-ab5b-ca711729eaeb.png</url>
      <title>DEV Community: Chisom Uma</title>
      <link>https://dev.to/chisom_uma_f5778f8ee951bd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chisom_uma_f5778f8ee951bd"/>
    <language>en</language>
    <item>
      <title>Setting Up a Kubernetes (K8s) Cluster Home Lab on Ubuntu Server 24.04</title>
      <dc:creator>Chisom Uma</dc:creator>
      <pubDate>Thu, 20 Feb 2025 19:28:45 +0000</pubDate>
      <link>https://dev.to/chisom_uma_f5778f8ee951bd/setting-up-a-kubernetes-k8s-cluster-home-lab-on-ubuntu-server-2404-1b6c</link>
      <guid>https://dev.to/chisom_uma_f5778f8ee951bd/setting-up-a-kubernetes-k8s-cluster-home-lab-on-ubuntu-server-2404-1b6c</guid>
      <description>&lt;p&gt;&lt;a href="https://aws.amazon.com/pm/eks-anywhere/?gclid=Cj0KCQiAwtu9BhC8ARIsAI9JHanTYi1b6m-LapQOd2bV-PFHrmK_AeE5JQOB2oqoT83nEC3CB_esgugaAhHzEALw_wcB&amp;amp;trk=f3317641-a4d4-460f-bdf7-25ef2d518525&amp;amp;sc_channel=ps&amp;amp;ef_id=Cj0KCQiAwtu9BhC8ARIsAI9JHanTYi1b6m-LapQOd2bV-PFHrmK_AeE5JQOB2oqoT83nEC3CB_esgugaAhHzEALw_wcB:G:s&amp;amp;s_kwcid=AL!4422!3!669047416779!p!!g!!kubernetes%20cluster!20433874254!152600767815" rel="noopener noreferrer"&gt;Kubernetes (K8s)&lt;/a&gt; is an open-source container orchestration platform that allows you to manage containerized applications across a cluster of nodes efficiently. Setting up a home lab provides a practical way to learn Kubernetes and test deployments in a controlled environment.&lt;/p&gt;

&lt;p&gt;This guide walks you through the process of setting up a Kubernetes cluster using Ubuntu Server 24.04 with two nodes: one master (kb1) and one worker (kb2).&lt;/p&gt;

&lt;h2&gt;
  
  
  System Requirements
&lt;/h2&gt;

&lt;p&gt;Each node should have the following specifications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU&lt;/strong&gt;: 2 cores
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory&lt;/strong&gt;: 3GB RAM
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage&lt;/strong&gt;: 20GB
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node IP Addresses&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;kb1 (Master): &lt;code&gt;192.168.0.112&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;kb2 (Worker): &lt;code&gt;192.168.0.113&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Ensure SSH connectivity between both nodes is configured properly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Setting Up a Kubernetes (K8s) Cluster Home Lab on Ubuntu Server 24.04
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Step 1: Configure Hostnames and Networking
&lt;/h3&gt;

&lt;p&gt;First thing first, modify the hostname (optional) and update the host file to enable network communication.&lt;/p&gt;

&lt;p&gt;To assign a hostname to each node, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo hostnamectl set-hostname \&amp;lt;new-hostname\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example for the master node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo hostnamectl set-hostname kb1 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the IP-to-hostname mapping on each node to update network communication.&lt;/p&gt;

&lt;p&gt;Next, modify the &lt;code&gt;/etc/hosts&lt;/code&gt; file on each node to enable network communication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/hosts 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, include the mapping:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.112  kb1192.168.0.113  kb2 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you should save and exit the file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Disable Swap and Load Kernel Modules
&lt;/h3&gt;

&lt;p&gt;In this next, the first thing to do is disable the Swap and Load Kernel Modules, using the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo swapoff \-a &amp;amp;&amp;amp; sudo sed \-i '/ swap / s/^\\(.\*\\)$/\#\\1/g' /etc/fstab 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To load the kernel modules using &lt;code&gt;modpobe&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo modprobe overlay &amp;amp;&amp;amp; sudo modprobe br\_netfilter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make these changes persistent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo modprobe overlay &amp;amp;&amp;amp; sudo modprobe br\_netfilter 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, add kernel parameters such as IP forwarding. Create a file and apply the parameters using the &lt;code&gt;sysctl&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tee /etc/sysctl.d/kubernetes.conf \&amp;lt;\&amp;lt;EOFnet.bridge.bridge-nf-call-ip6tables \= 1net.bridge.bridge-nf-call-iptables \= 1net.ipv4.ip\_forward \= 1EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next step is to load the above kernel parameters using the command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo sysctl \--system 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Install &lt;code&gt;Containerd&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://containerd.io/" rel="noopener noreferrer"&gt;Containerd&lt;/a&gt; is a container runtime that manages the complete container lifecycle on a host system. It's an industry-standard core container runtime that was originally developed by Docker and later donated to the Cloud Native Computing Foundation (CNCF). &lt;/p&gt;

&lt;p&gt;To get started with its installation, first, install the required dependencies using the commands below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install \-y curl gnupg2 software-properties-common apt-transport-https ca-certificates 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, add the containerd repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl \-fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg \--dearmor \-o /etc/apt/trusted.gpg.d/containerd.gpgsudo add-apt-repository "deb \[arch=amd64\] https://download.docker.com/linux/ubuntu $(lsb\_release \-cs) stable" 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, its time to install containerd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install containerd.io \-y 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, configure containerd to use &lt;code&gt;SystemdCgroup&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;containerd config default | sudo tee /etc/containerd/config.toml \&amp;gt;/dev/nullsudo sed \-i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart containerd to see effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart containerd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status containerd 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;● containerd.service - containerd container runtime
     Loaded: loaded (/usr/lib/systemd/system/containerd.service; enabled; preset: enabled)
     Active: active (running) since Mon 2025-02-17 16:20:34 UTC; 2h 17min ago
       Docs: https://containerd.io
    Process: 738 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
   Main PID: 741 (containerd)
      Tasks: 156
     Memory: 201.3M (peak: 229.5M)
        CPU: 20min 13.594s
     CGroup: /system.slice/containerd.service
             ├─  741 /usr/bin/containerd
             ├─ 1138 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 53e05d7bda37772f5869ec026de03b40d4ce532ba0303c42be5184994439b3bf -address /run/containerd/containerd.sock
             ├─ 1139 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 5398ebda2355cad57be69e19bf098e4202fe259a61270ea9cc274b81f77977ab -address /run/containerd/containerd.sock
             ├─ 1140 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id e4f1f987a5fb8db03db049b518fdfe6680b8c83617733de91620948c6bc00c95 -address /run/containerd/containerd.sock
             ├─ 1150 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 24d231aefec7bde2646ae123758907e5d464973705d8c0cd9d8db67756c19ef2 -address /run/containerd/containerd.sock
             ├─ 1547 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 4d7ddac790ef53cb30823d45ed4b675d54cf66694833158f8d15f0ba93b93e2c -address /run/containerd/containerd.sock
             ├─ 2267 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 72b50ae3cea036f3b51e18bf9b900ccd46399fed052bf51a41bcea735062f413 -address /run/containerd/containerd.sock
             ├─ 2377 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 2fcb5f2766fc1ff28a8a020c10eb1aff4b1895eb7ade8af65c72bedd0a634ead -address /run/containerd/containerd.sock
             ├─ 2434 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id d6f43f441495e4a00387114d5d7462bc54b1a592bd41bc1ee1709d16d507633b -address /run/containerd/containerd.sock
             └─27675 /usr/bin/containerd-shim-runc-v2 -namespace k8s.io -id 2b645f1523cda54eb099d35542d77347071c2cdaef648a7e5559ec01779bac29 -address /run/containerd/containerd.sock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Add Kubernetes Package Repository
&lt;/h3&gt;

&lt;p&gt;Kubernetes packages are not included in the default package repositories of Ubuntu 24.04. To install them, first, add the Kubernetes repository.&lt;/p&gt;

&lt;p&gt;Start by downloading the public signing key for the repository using the &lt;code&gt;curl&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl \-fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg \--dearmor \-o /etc/apt/keyrings/k8s.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, add the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo 'deb \[signed-by=/etc/apt/keyrings/k8s.gpg\] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /' | sudo tee /etc/apt/sources.list.d/k8s.list 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Install Kubernetes Components
&lt;/h3&gt;

&lt;p&gt;Install essential Kubernetes components such as &lt;code&gt;kubeadm&lt;/code&gt;, &lt;code&gt;kubelet&lt;/code&gt;, and &lt;code&gt;kubectl&lt;/code&gt; to manage the Kubernetes cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt updatesudo apt install kubelet kubeadm kubectl \-y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Initialize the Kubernetes Cluster (Master Node Only)
&lt;/h3&gt;

&lt;p&gt;To initialize the control plane or master node using &lt;code&gt;Kubeadm&lt;/code&gt;, run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo kubeadm init \--control\-plane\-endpoint=\&amp;lt;master-node-name\&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo kubeadm init \--control\-plane\-endpoint=kb1 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2298iv82p9t3s6ugg5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff2298iv82p9t3s6ugg5z.png" alt="Image description" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set up access to Kubernetes for the current user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7: Join Worker Nodes in the Cluster
&lt;/h3&gt;

&lt;p&gt;Add worker nodes to your Kubernetes cluster using the token generated during initialization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffh5kss8g42qc3vlfdt5n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffh5kss8g42qc3vlfdt5n.jpg" alt="Image description" width="800" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo kubeadm join 192.168.0.112:6443 \--token \&amp;lt;your-token\&amp;gt; \--discovery-token-ca\-cert-hash sha256:\&amp;lt;your-hash\&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify node status on the master node, by running the command below on your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME   STATUS   ROLES           AGE   VERSION
kb1    NotReady    control-plane   10d   v1.31.5
kb2    NotReady    &amp;lt;none&amp;gt;          10d   v1.31.5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If nodes appear as &lt;code&gt;NotReady&lt;/code&gt;, proceed to install a networking solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8: Deploy the Calico Network Plugin
&lt;/h3&gt;

&lt;p&gt;On the master node, run to install the &lt;a href="https://docs.tigera.io/calico/latest/getting-started/kubernetes/hardway/install-cni-plugin" rel="noopener noreferrer"&gt;Calico Network Plugin&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create \-f https://raw.githubusercontent.com/projectcalico/calico/v3\.28.2/manifests/calico.yaml 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm the node status has changed to &lt;code&gt;Ready&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                                      READY   STATUS    RESTARTS      AGE
calico-kube-controllers-b8d8894fb-rz6zx   1/1     Running   3 (24h ago)   7d21h
calico-node-4klgg                         1/1     Running   0             24h
calico-node-9c9lg                         1/1     Running   0             24h
coredns-7c65d6cfc9-8f26s                  1/1     Running   3 (24h ago)   7d21h
coredns-7c65d6cfc9-sgsvc                  1/1     Running   3 (24h ago)   7d21h
etcd-kb1                                  1/1     Running   4 (24h ago)   10d
kube-apiserver-kb1                        1/1     Running   4 (24h ago)   10d
kube-controller-manager-kb1               1/1     Running   9 (24h ago)   10d
kube-proxy-h5fnm                          1/1     Running   2 (25h ago)   10d
kube-proxy-n9zts                          1/1     Running   4 (24h ago)   10d
kube-scheduler-kb1                        1/1     Running   7 (24h ago)   10d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, check the node status using the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME        TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
nginx-app   NodePort   10.110.254.203   &amp;lt;none&amp;gt;        80:31809/TCP   50s

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 9: Deploy and Test an Application
&lt;/h3&gt;

&lt;p&gt;In this section, we will first deploy and expose an NGINX instance to verify the setup.&lt;/p&gt;

&lt;p&gt;Create a Namespace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; kubectl create ns demo-app 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check if namespace was created or not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get namespace 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy NGINX replicas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create deployment nginx\-app \--image nginx \--replicas 2 \--namespace demo\-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get deployment \-n demo\-app 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expose the Deployment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose deployment nginx-app \-n demo-app \--type NodePort \--port 80 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the service port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc \-n demo-app 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Access the application using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://192.168.0.113:\&amp;lt;exposed-port\&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If successful, you should see the default NGINX welcome page.&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Welcome to nginx!&amp;lt;/title&amp;gt;
&amp;lt;style&amp;gt;
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Welcome to nginx!&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;For online documentation and support please refer to
&amp;lt;a href="http://nginx.org/"&amp;gt;nginx.org&amp;lt;/a&amp;gt;.&amp;lt;br/&amp;gt;
Commercial support is available at
&amp;lt;a href="http://nginx.com/"&amp;gt;nginx.com&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Thank you for using nginx.&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following this guide, you've successfully set up a Kubernetes cluster on Ubuntu 24.04, installed essential components, and deployed a test application. This provides a solid foundation for further exploration into Kubernetes features and advanced configurations.&lt;/p&gt;

</description>
      <category>cloudnative</category>
      <category>kubernetes</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
