<?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: V A I S H A L i</title>
    <description>The latest articles on DEV Community by V A I S H A L i (@maveraw).</description>
    <link>https://dev.to/maveraw</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2907990%2Fc73b8c40-afbb-414e-a10b-d5bd9ddee162.png</url>
      <title>DEV Community: V A I S H A L i</title>
      <link>https://dev.to/maveraw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maveraw"/>
    <language>en</language>
    <item>
      <title>Kubernetes Networking: Services, Ingress, and Load Balancers</title>
      <dc:creator>V A I S H A L i</dc:creator>
      <pubDate>Mon, 17 Mar 2025 09:56:42 +0000</pubDate>
      <link>https://dev.to/maveraw/kubernetes-networking-services-ingress-and-load-balancers-1h28</link>
      <guid>https://dev.to/maveraw/kubernetes-networking-services-ingress-and-load-balancers-1h28</guid>
      <description>&lt;p&gt;Kubernetes networking is a fundamental aspect of managing and scaling applications effectively. Understanding Services, Ingress, and Load Balancers helps in ensuring seamless communication between pods, exposing applications to the outside world, and managing traffic efficiently.&lt;/p&gt;

&lt;p&gt;This blog post explores these concepts in depth, drawing insights from &lt;a href="https://www.youtube.com/watch?v=ASZCy5LDWvw&amp;amp;list=PLnKy4XevqUM8fWHuvpcgHwA8tmmvd5WLZ" rel="noopener noreferrer"&gt;Drew's Kubernetes networking series.&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Why Kubernetes Networking is Used
&lt;/h2&gt;

&lt;p&gt;In traditional infrastructure, networking can be complex due to manual configurations, IP management, and dependency on static environments. Kubernetes abstracts these complexities by providing dynamic service discovery, load balancing, and seamless communication between microservices. Kubernetes networking is used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Ensure reliable communication between microservices across different nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable external access to applications with controlled traffic management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Support scalability by dynamically routing traffic to healthy pods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Facilitate security through network policies, ingress rules, and TLS encryption.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  2. Kubernetes Networking Basics
&lt;/h2&gt;

&lt;p&gt;Kubernetes provides a flat, cluster-wide network model, ensuring that every pod can communicate with other pods regardless of the node they reside on. However, Kubernetes networking does not manage external access by default, which is where Services, Ingress, and Load Balancers come into play.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Kubernetes Services
&lt;/h2&gt;

&lt;p&gt;A Service in Kubernetes is an abstraction that defines a logical set of pods and a policy for accessing them. Since pods are ephemeral and have dynamic IPs, services provide a stable endpoint for communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Services:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ClusterIP (Default): Exposes the service on an internal IP within the cluster, making it accessible only from within Kubernetes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NodePort: Exposes the service on each node’s IP at a static port, allowing external access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LoadBalancer: Provisions an external load balancer (on cloud providers) to expose the service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ExternalName: Maps the service to an external DNS name, useful for redirecting requests outside the cluster.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example YAML for a ClusterIP Service:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: my-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration routes requests from port 80 to the target port 8080 of the associated pods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-World Use Case for Services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;E-commerce Platform: In an e-commerce application, different microservices such as payment, inventory, and user authentication need stable connectivity. Kubernetes Services ensure these microservices can reliably communicate with each other, even as pods scale up and down.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Ingress: Managing External Access
&lt;/h2&gt;

&lt;p&gt;While Services expose applications, they do not provide flexible traffic routing or domain-based access. This is where Ingress comes in.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Ingress?
&lt;/h3&gt;

&lt;p&gt;Ingress is an API object that manages external access, typically HTTP/HTTPS, to services within a cluster. It provides capabilities like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Path-based routing (e.g., example.com/app1 → Service A, example.com/app2 → Service B)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Name-based virtual hosting&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSL/TLS termination&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Load balancing&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example YAML for an Ingress Resource:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Ingress routes traffic from example.com/app to my-service on port 80.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-World Use Case for Ingress&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-Tenant SaaS Application:&lt;/strong&gt; A SaaS platform serving multiple clients under different domains (client1.example.com, client2.example.com) can use Kubernetes Ingress to route traffic to the correct backend service based on the requested domain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ingress Controllers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ingress requires an Ingress Controller (e.g., Nginx Ingress Controller, Traefik, HAProxy) to function. These controllers watch for Ingress resources and update their routing configurations accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Load Balancers: Scaling Traffic Efficiently
&lt;/h2&gt;

&lt;p&gt;A Load Balancer distributes network traffic across multiple backend instances to ensure high availability and reliability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kubernetes LoadBalancer Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On cloud environments (AWS, GCP, Azure), Kubernetes automatically provisions an external load balancer when you define a LoadBalancer type service.&lt;/p&gt;

&lt;p&gt;Example YAML for a LoadBalancer Service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Service
metadata:
  name: my-loadbalancer-service
spec:
  type: LoadBalancer
  selector:
    app: my-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In on-premise clusters, tools like MetalLB can be used to enable LoadBalancer functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-World Use Case for Load Balancers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Streaming Platform: A video streaming service like YouTube or Netflix requires efficient traffic distribution to handle millions of concurrent users. Kubernetes Load Balancers ensure that incoming requests are evenly distributed across multiple backend instances to prevent overload.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Choosing the Right Networking Strategy
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use Case&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Internal pod-to-pod communication&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;External access to a single service&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Load balancing across multiple backends&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Routing traffic based on domain/path&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best Option&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ClusterIP Service&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NodePort or LoadBalancer Service&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ingress with an Ingress Controller&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LoadBalancer or Ingress&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Understanding Kubernetes networking through Services, Ingress, and Load Balancers is key to efficiently managing traffic and exposing applications. Services handle internal and external connectivity, Ingress provides advanced traffic management, and Load Balancers ensure scalability. By implementing these effectively, you can optimize the availability and reliability of your Kubernetes workloads.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Install A Kubernetes Cluster | How to setup a basic Kubernetes Cluster using KubeADM</title>
      <dc:creator>V A I S H A L i</dc:creator>
      <pubDate>Fri, 07 Mar 2025 10:05:58 +0000</pubDate>
      <link>https://dev.to/maveraw/setting-up-a-kubernetes-cluster-using-kubeadm-568c</link>
      <guid>https://dev.to/maveraw/setting-up-a-kubernetes-cluster-using-kubeadm-568c</guid>
      <description>&lt;p&gt;In this tutorial, we're going to set up our first cluster using KubeADM. KubeADM is probably one of the most popular tools for setting up a cluster that's production-ready. This is going to be our start for the production-ready ones. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't use this one in production because it's going to have only one control plane.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the next tutorial of this series, we will add more control planes, and that's when it's going to be production-ready.This blog is an extension of &lt;a href="https://www.youtube.com/watch?v=O496FFcpGeQ&amp;amp;list=PLnKy4XevqUM8fWHuvpcgHwA8tmmvd5WLZ&amp;amp;index=5" rel="noopener noreferrer"&gt;Drew's Playlist&lt;/a&gt;, kindly check out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Kubeadm is a powerful tool that simplifies Kubernetes cluster setup. It provides best-practice defaults while ensuring a secure and production-ready environment. In this guide, we will walk through setting up a Kubernetes cluster using Kubeadm, discuss networking options, security considerations, common pitfalls, and next steps for deploying workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  SCENE 1: Pre-requisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Taking the help of Virtual Box for these tutorials, there's no need to install them on physical servers. In terms of just setting things up unless you're using managed servers this should get you going!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1.&lt;strong&gt;Setting up the VM&lt;/strong&gt;&lt;br&gt;
We're going to start with 1 control plane node and 3 worker nodes (they are all being set up using the &lt;a href="https://www.youtube.com/watch?v=QQKMlRsEWRE" rel="noopener noreferrer"&gt;Ubuntu Tutorial&lt;/a&gt;. The only difference between these 4 sets and the tutorial is that these are not set up using RAID, and there is no swap partition. We only have a root partition and a boot partition. That's it.&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL1ZNX2s4c19ub2Rlcy5wbmc%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL1ZNX2s4c19ub2Rlcy5wbmc%253D" alt="VM_k8s_nodes" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out official &lt;a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/" rel="noopener noreferrer"&gt;Kubernetes Docs&lt;/a&gt; to keep up with the prerequites for creating a cluster using kubeadm.&lt;/p&gt;

&lt;p&gt;2.&lt;strong&gt;Time to play with the Terminal(ssss)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are using 4 nodes altogether (The author of the blog has ADHD hence they often recommend &lt;em&gt;multi-tasking&lt;/em&gt;). To view and use them in sync follow the &lt;a href="https://www.youtube.com/watch?v=JUQfi3JYGjY&amp;amp;list=PLnKy4XevqUM--FTqXeL2GTOIMc2uoBJnr&amp;amp;index=11" rel="noopener noreferrer"&gt;TMUX tutorial&lt;/a&gt;. After following up with this tutorial, your terminal screen should look like this:&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL1RNVVhfbXVsdGl0YXNrX3NjcmVlbnMucG5n" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL1RNVVhfbXVsdGl0YXNrX3NjcmVlbnMucG5n" alt="TMUX Screen" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of them are synchronized by panes so we can run the same commands as we need to across all four machines.&lt;/p&gt;

&lt;p&gt;3.&lt;strong&gt;Looking at KubeADM doc&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Head over to &lt;a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" rel="noopener noreferrer"&gt;KubeADM official doc&lt;/a&gt; for setting up our system accordingly.&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL0luc3RhbGxfS3ViZWFkbV9kb2MucG5n" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL0luc3RhbGxfS3ViZWFkbV9kb2MucG5n" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Checking all these up will help us install all of the requirements efficiently. Let's go!&lt;/p&gt;
&lt;h2&gt;
  
  
  SCENE 2: Installing a Container Runtime (ContainerD)
&lt;/h2&gt;

&lt;p&gt;One thing that's gonna be common in every tutorial and installations is pre-requisites, which will appear again and again and again specially when we're setting up Kubernetes cluster. So bare with me coz I'm dropping another pre-req but it's important to look out for any.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 Install and Configure Pre-requisites for containerD&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To manually enable IPv4 packet forwarding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# sysctl params required by setup, params persist across reboots
cat &amp;lt;&amp;lt;EOF | sudo tee /etc/sysctl.d/k8s.conf
net.ipv4.ip_forward = 1
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste them onto the Terminal:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL1Rlcm1pbmFsMS5wbmc%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL1Rlcm1pbmFsMS5wbmc%253D" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make sure it's configured and is going to continue with reboot.&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Apply sysctl params without reboot
sudo sysctl --system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, paste this to verify if the above code worked and set everything to 1.&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sysctl net.ipv4.ip_forward
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure the swap is off.&lt;/p&gt;

&lt;p&gt;Run and open the fstab.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;and comment out the &lt;code&gt;/swap.img&lt;/code&gt; by &lt;code&gt;#/swap.img&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, run:&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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That will turn the swap off. Check by running &lt;code&gt;free&lt;/code&gt;, the swap will display 0 all across.&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL3Rlcm1pbmFsMi5wbmc%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL3Rlcm1pbmFsMi5wbmc%253D" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we're ready for KubeADM to run. And if you don't do these things you'll face issue running KubeADM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2 Install ContainerD&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I am bad at pointing out locations when it comes to real-life. LOL. But  I will try to point out the when and where of the documentation. Kindly bare, don't come for me in the comment section 😂&lt;/p&gt;

&lt;p&gt;Head over to: &lt;a href="https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd" rel="noopener noreferrer"&gt;containerD&lt;/a&gt; &amp;gt; &lt;a href="https://github.com/containerd/containerd/blob/main/docs/getting-started.md" rel="noopener noreferrer"&gt;getting started with containerD github repo&lt;/a&gt; &amp;gt; &lt;a href="https://github.com/containerd/containerd/releases" rel="noopener noreferrer"&gt;Install containerD release notes&lt;/a&gt; &amp;gt; scroll down to find assets and choose the one for your machine &amp;gt; don't double click instead copy link address of the release and we're gonna paste it on to the terminal.&lt;/p&gt;

&lt;p&gt;Phew😮‍💨 &lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;wget&lt;/code&gt; with the link address&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL3Rlcm1pbmFsMy5wbmc%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL3Rlcm1pbmFsMy5wbmc%253D" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
Give it a second to download containerD and when it's done.&lt;/p&gt;

&lt;p&gt;Run this to extract it under &lt;code&gt;/usr/local&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run to be in the current directory:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;then Run:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tar Cxzvf /usr/local containerd-1.6.2-linux-amd64.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Common FAQ&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL0ZBUS5wbmc%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL0ZBUS5wbmc%253D" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you intend to start containerd via systemd, you should also download the containerd.service unit file from &lt;a href="https://raw.githubusercontent.com/containerd/containerd/main/containerd.service" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/containerd/containerd/main/containerd.service&lt;/a&gt; into /usr/local/lib/systemd/system/containerd.service, and run the following commands:&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/containerd/containerd/main/containerd.service -O /usr/lib/systemd/system/containerd.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl daemon-reload
systemctl enable --now containerd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run to see if everything is loaded and active.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3 Install runc&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;runc&lt;/code&gt; is a CLI tool for spawning and running containers on Linux according to the OCI specification.&lt;/p&gt;

&lt;p&gt;Download the right version: for my machine its &lt;a href="https://github.com/opencontainers/runc/releases" rel="noopener noreferrer"&gt;runc.amd64&lt;/a&gt;{Dont double click again, paste into the terminal}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the link address  and RUN:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://github.com/opencontainers/runc/releases/download/v1.2.6/runc.amd64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install runc
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ install -m 755 runc.amd64 /usr/local/sbin/runc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;RUN &lt;code&gt;runc&lt;/code&gt; to check if it's installed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4 Installing CNI Plugin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run&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 /opt/cni/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Head Over to &lt;a href="https://github.com/containerd/containerd/blob/main/docs/getting-started.md" rel="noopener noreferrer"&gt;Getting started with ContainerD&lt;/a&gt;  &amp;gt; Step 3 Install CNI Plugin &amp;gt; &lt;a href="https://github.com/containernetworking/plugins/releases" rel="noopener noreferrer"&gt;Releases&lt;/a&gt; &amp;gt; Choose a plugin for your system &amp;gt; copy the link address for your plugin, mine is &lt;a href="https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-amd64-v1.6.2.tgz" rel="noopener noreferrer"&gt;Plugin Linux-amd64&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-amd64-v1.6.2.tgz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.6.2.tgz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Make sure everything has an updated version to it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 5 Looking out for &lt;code&gt;config.toml&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you complete step 4 you've now created a valid configuration file, &lt;code&gt;config.toml&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;ContainerD uses a configuration file located in &lt;code&gt;/etc/containerd/config.toml&lt;/code&gt; for specifying daemon level options.&lt;/p&gt;

&lt;p&gt;The default configuration can be generated via &lt;code&gt;containerd config default&lt;/code&gt; &amp;gt; &lt;code&gt;/etc/containerd/config.toml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's roll into our terminal to explore:&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir /etc/containerd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&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 &amp;gt; /etc/containerd/config.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim /etc/container/config.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You've found that file if you land in the world of toml.&lt;br&gt;
We'll configure that further. Exit out of the file and head on to step 6.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6 Configuring the &lt;code&gt;systemd&lt;/code&gt; cgroup driver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To use the &lt;code&gt;systemd&lt;/code&gt; cgroup driver in &lt;code&gt;/etc/containerd/config.toml&lt;/code&gt; with &lt;code&gt;runc&lt;/code&gt;, head over to the &lt;code&gt;config.toml&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim /etc/containerd.config.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find &lt;code&gt;[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]&lt;/code&gt; in the &lt;code&gt;config.toml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Further inside this plugin, find &lt;code&gt;[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]&lt;/code&gt;&lt;br&gt;
and in here you'll find sub-options, choose &lt;code&gt;SystemdCgroup&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Set &lt;code&gt;SystemdCgroup = false&lt;/code&gt; to &lt;code&gt;SystemdCgroup = true&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;systemd&lt;/code&gt; cgroup driver is recommended if you use cgroup v2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How to check?&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stat -fc %T /sys/fs/cgroup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It reflect the exact status.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL2Nncm91cFYyLnBuZw%253D%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL2Nncm91cFYyLnBuZw%253D%253D" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets take a deep breathe along with the nodes, we've come a long way 😮‍💨&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;and you take a pause🍻...&lt;/p&gt;

&lt;p&gt;Let's check the status&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If evrything is active✅&lt;br&gt;
then, everything is up and running . HOORAYYYY!!!&lt;/p&gt;
&lt;h2&gt;
  
  
  SCENE 3: Install KubeADM, Kubelet and Kubectl
&lt;/h2&gt;

&lt;p&gt;Now we've done our warm-up, the workout would be easy. Hope so!!&lt;br&gt;
It's pretty straight forward now. Hope SO!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1 Updating the &lt;code&gt;apt&lt;/code&gt; packages needed to use the Kubernetes &lt;code&gt;apt&lt;/code&gt; repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's Run&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# apt-transport-https may be a dummy package; if so, you can skip that package
apt-get install -y apt-transport-https ca-certificates curl gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2 Download the Google cloud public signing key:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# If the directory `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below.
# sudo mkdir -p -m 755 /etc/apt/keyrings
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3 Add the appropriate Kubernetes apt repository&lt;br&gt;
Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Along with following this tutorial, I would highly suggest opening up the &lt;a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; alongside to get the right version at all times.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 4 Update the apt package index, install kubelet, kubeadm and kubectl, and pin their version:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt-mark hold kubelet kubeadm kubectl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Kubelet: is responsible for making containers real essentially on &lt;br&gt;
  nodes.&lt;br&gt;
 KubeADM: which is responsible for creating a cluster.&lt;br&gt;
 KubeCtl: is responsible for the interaction of the kubenetes API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Scene 4 Creating a CLUSTER finally
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Initializing your control plane mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We would want a control plane set up and add some worker nodes to it. We would be wanting a Highly Available(HA) control plane. We are going to consider a &lt;code&gt;--control-plane-endpoint&lt;/code&gt;. If we were in the cloud we could do that with the IP of a load balancer. &lt;/p&gt;

&lt;p&gt;*We are not in the cloud. We are setting up in our machines at home. We need to set up &lt;code&gt;control-plane-endpoint&lt;/code&gt;. *&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thankfully, KubeVIP enters the chat✨&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;KubeVIP is basically a tool that allows us to use a load balancer out of the cloud. &lt;/p&gt;

&lt;h2&gt;
  
  
  Preparing for HA control plane with KubeVIP
&lt;/h2&gt;

&lt;p&gt;We are going to use &lt;a href="https://kube-vip.io/docs/installation/static/" rel="noopener noreferrer"&gt;KubeVIP documentation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;We need to do this as a part of setting up the KubeADM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
If you're not worried about High Availability (which you should be) then you can go ahead and skip this section, but I recommend you do this section coz if you don't, you'll have to settle external load balancers to manage the traffic going in. In fact, you'll have to reconfigure the cluster bcoz you wont have this &lt;code&gt;--control-plane-endpoint&lt;/code&gt; flag. &lt;/p&gt;

&lt;p&gt;Let's get going fellas 🤖🤖🤖&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Generating a Manifest&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;" In order to create an easier experience of consuming the various functionality within kube-vip, we can use the kube-vip container itself to generate our static Pod manifest. We do this by running the kube-vip image as a container and passing in the various flags for the capabilities we want to enable. " -says the docs &lt;/p&gt;

&lt;p&gt;We need to set a &lt;code&gt;VIP&lt;/code&gt; address to be used for control plane:&lt;/p&gt;

&lt;p&gt;Here I would use an IP that's free. You can use any IP that's free and would not conflict on your network.&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ip a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'm gonna use this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export VIP=xxx.xxx.x.xxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I need to export an interface name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export INTERFACE=interface_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the interface on the control plane that will announce the VIP.&lt;/p&gt;

&lt;p&gt;Get the latest version of the kube-vip release by parsing the GitHub API. This step requires that &lt;code&gt;jq&lt;/code&gt; and &lt;code&gt;curl&lt;/code&gt; are installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install jq -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;KVVERSION=$(curl -sL https://api.github.com/repos/kube-vip/kube-vip/releases | jq -r ".[0].name")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;We don't need to do this kubevip thing on other nodes coz they're not control plane nodes. So the kubevip set-up will be done on one window itself.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Creating a Manifest&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the input values now set, we can pull and run the kube-vip image supplying it the desired flags and values.&lt;/p&gt;

&lt;p&gt;For containerd, run the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias kube-vip="ctr image pull ghcr.io/kube-vip/kube-vip:$KVVERSION; ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$KVVERSION vip /kube-vip"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: ARP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure the location exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir  /etc/kubernetes/manifests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kube-vip manifest pod \
    --interface $INTERFACE \
    --address $VIP \
    --controlplane \
    --services \
    --arp \
    --leaderElection | tee /etc/kubernetes/manifests/kube-vip.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jump back to &lt;a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#initializing-your-control-plane-node" rel="noopener noreferrer"&gt;official docs&lt;/a&gt; &amp;gt; Initializing the control plane&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If you have plans to upgrade this single control-plane kubeadm cluster to high availability you should specify the --control-plane-endpoint to set the shared endpoint for all control-plane nodes. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;2.Choose a Pod network add-on, and verify whether it requires any arguments to be passed to kubeadm init. Depending on which third-party provider you choose, you might need to set the &lt;code&gt;--pod-network-cidr&lt;/code&gt; to a provider-specific value. &lt;/p&gt;

&lt;p&gt;Head over to Calico &amp;gt; &lt;a href="https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises" rel="noopener noreferrer"&gt;https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises&lt;/a&gt; &amp;gt; Manifest &lt;/p&gt;

&lt;p&gt;Download the Calico networking manifest for the Kubernetes API datastore.&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://raw.githubusercontent.com/projectcalico/calico/v3.29.2/manifests/calico.yaml -O

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Explaining POD-CIDR
&lt;/h2&gt;

&lt;p&gt;So, a CIDR (Classless Inter-Domain Routing) is a method of signing IP addresses from a block of IP addresses. Your pod uses a POD-CIDR. If you want the PODs to have a network, we need to provide a CIDR for them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Setting up a DNS record&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Set up a record in our host file.&lt;/p&gt;

&lt;p&gt;Head over to &lt;code&gt;vim /etc/hosts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Write &lt;code&gt;192.168.0.200 kube-api-server&lt;/code&gt; (x.x.x.x domain)in the file.&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install iputils-ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping kube-api-server (ping Domain)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Considerations about apiserver-advertise-address and ControlPlaneEndpoint&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To set the &lt;code&gt;--apiserver-advertise-address&lt;/code&gt; for the particular api server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubeadm init  --control-plane-endpoint DOMAIN --apiserver-advertise-address NODE_IP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My DOMAIN: 192.168.0.200&lt;br&gt;
My NODE_IP: 192.168.0.201&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;&lt;br&gt;
The IP being used for the control plane endpoint (192.168.0.200) is technically wrong. You can use it and it would work, not a problem. But if that IP changes later, you would no longer be able to access your cluster even if you change the IP in kube config. The reason being the IP and the control plane endpoint flag will be encoded into the certificate that is generated when a Kubernetes cluster is spawn up. Now if the IP changes and you change it in kubeconfig and you used it in the control plane endpoint, when you access your cluster, you'll get the error back saying "the IP doesn't exist". We will configure that later.&lt;/p&gt;

&lt;p&gt;Hitting enter to the above code, KubeADM will initialize the cluster.&lt;/p&gt;

&lt;p&gt;Okayyyyyyyyyyy!! &lt;br&gt;
The cluster must be up and running and if there's an error there's a good chance something somewhere went wrong in terms of the way you followed along. Run KubeADM RESET and follow thru the process again to fix.&lt;/p&gt;

&lt;p&gt;Running this will set your kube config and you'll not have to move to root location.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export KUBECONFIG=/etc/kubernetes/admin.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Let's deploy Pod Network into the cluster
&lt;/h2&gt;

&lt;p&gt;Head over to &lt;a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/" rel="noopener noreferrer"&gt;https://kubernetes.io/docs/concepts/cluster-administration/addons/&lt;/a&gt; to look at the options.&lt;/p&gt;

&lt;p&gt;We will be sticking to Calico anyways.&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f calico.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&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 -f calico.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run&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 po -n kube-system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  FINALE: Adding the worker nodes to the cluster
&lt;/h2&gt;

&lt;p&gt;Go to&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;quickly remove the x.x.x.x domain from control planes and reset it by synchronizing all four together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x.x.x.x domain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on all 4 nodes and set it.&lt;/p&gt;

&lt;p&gt;Then you can join any number of worker nodes by running the following on each as root :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubeadm join 192.168.0.200:6443 --token ztr6zr7.vk8q7x8wvdacfonh \-discovery-token-ca-ert-hash sha256:5c3d9d4ab685067731953ecbd8d4369e26e6b926d105289250ca47a3c8b10f2a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After manually writing into all 4. Get rid of this cmd from the control plane. Let it run on all three worker nodes.&lt;/p&gt;

&lt;p&gt;Now all of these 3 will start joining the cluster.&lt;/p&gt;

&lt;p&gt;This is your token key under the init. Might be diff so check and paste.&lt;/p&gt;

&lt;p&gt;Run&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 node -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL2NsdXN0ZXIucG5n" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL2NsdXN0ZXIucG5n" alt="cluster ready" width="800" height="400"&gt;&lt;/a&gt;&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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL3JlYWR5LnBuZw%253D%253D" 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%2Ffiles.gadfly.ai%2F%3Fr%3D%2Fdownload%26path%3DL3JlYWR5LnBuZw%253D%253D" alt="ready" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have all of out nodes running and ready. We're good to go~~&lt;/p&gt;

&lt;p&gt;WE GOT A CLUSTER. THAT'S YOUR CLUSTER SET-UP AND RUNNING🚀&lt;/p&gt;

&lt;p&gt;In theory, this is production-ready ready but we're gonna implement some advanced tooling so that it can be used in production.&lt;/p&gt;

&lt;p&gt;But bravo, &lt;br&gt;
If you stick to the end !!&lt;/p&gt;

&lt;p&gt;See you in the next one.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Kubernetes: A Beginner's Guide</title>
      <dc:creator>V A I S H A L i</dc:creator>
      <pubDate>Mon, 03 Mar 2025 08:57:05 +0000</pubDate>
      <link>https://dev.to/maveraw/what-is-kubernetes-a-beginners-guide-57h3</link>
      <guid>https://dev.to/maveraw/what-is-kubernetes-a-beginners-guide-57h3</guid>
      <description>&lt;p&gt;Welcome to the first post in our Kubernetes learning series! This series is designed to take you from a beginner to a confident Kubernetes user, covering everything from the basics to advanced use cases. If you're new to Kubernetes or just curious about modern application deployment, you're in the right place.&lt;/p&gt;

&lt;p&gt;Before we dive in, a huge shoutout to &lt;a href="https://www.youtube.com/watch?v=ASZCy5LDWvw&amp;amp;list=PLnKy4XevqUM8fWHuvpcgHwA8tmmvd5WLZ" rel="noopener noreferrer"&gt;Drew's Kubernetes Video 🎥&lt;/a&gt;, which played a big role in shaping this guide. If you're more of a visual learner, definitely check it out!&lt;/p&gt;

&lt;p&gt;In today's fast-paced tech world, managing applications efficiently is crucial. Kubernetes has become the gold standard for container orchestration, helping businesses scale and automate their workloads seamlessly. But what exactly is Kubernetes, and why is it so essential? Let’s break it down in simple terms.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Evolution of Infrastructure: From Traditional Servers to Kubernetes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Traditional Server Infrastructure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the early days, applications ran on physical servers. Each server hosted a single application, making resource utilization inefficient. If one application needed more computing power, businesses had to buy and set up new servers, leading to high costs and maintenance overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Virtualization and Cloud Computing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To solve these inefficiencies, virtualization emerged. With virtual machines (VMs), multiple applications could run on a single physical server, sharing resources more effectively. Cloud providers like AWS, Google Cloud, and Azure further simplified infrastructure management by offering on-demand resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The Rise of Containers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Containers took efficiency a step further. Unlike VMs, which require separate operating systems, containers share the host OS but remain isolated from each other. This makes them lightweight, fast, and portable. However, managing hundreds or thousands of containers manually is complex. This is where Kubernetes comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Problems Does Kubernetes Solve?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Scalability Issues:&lt;/strong&gt; Kubernetes automatically adjusts the number of running containers based on demand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Manual Deployments:&lt;/strong&gt; Deploying applications manually is time-consuming and error-prone. Kubernetes automates deployments using YAML configurations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Resource Optimization:&lt;/strong&gt; Kubernetes ensures efficient use of CPU and memory by distributing workloads dynamically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. High Availability:&lt;/strong&gt; If a container crashes, Kubernetes automatically replaces it, ensuring application uptime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Service Discovery &amp;amp; Load Balancing:&lt;/strong&gt; Kubernetes manages network traffic between services, preventing overload on any single instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Features of Kubernetes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Pods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Pod is the smallest deployable unit in Kubernetes. It can contain one or multiple containers that share networking and storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Nodes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nodes are the physical or virtual machines that run containers. A Kubernetes cluster consists of multiple nodes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Cluster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Kubernetes cluster is a set of nodes managed by a control plane, which handles scheduling, scaling, and networking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Deployments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Deployment automates the process of rolling out and updating applications without downtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Service enables communication between different parts of an application, ensuring stability even if containers move between nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience Learning Kubernetes
&lt;/h2&gt;

&lt;p&gt;When I first started exploring Kubernetes, I was overwhelmed by all the new terms—Pods, Deployments, Services, Ingress... It felt like learning a whole new language! But what really helped was thinking of Kubernetes as a well-organized city: Pods are houses, Services are roads, and the control plane is like city management, ensuring everything runs smoothly. Once I made that connection, things started clicking!&lt;/p&gt;

&lt;p&gt;If you're struggling with Kubernetes concepts, don't worry—you're not alone! The key is to experiment and break things in a test environment. Learning by doing is the best way to understand how Kubernetes actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with Kubernetes
&lt;/h2&gt;

&lt;p&gt;For beginners, here are some resources to kickstart your Kubernetes journey:&lt;/p&gt;

&lt;p&gt;📖 Kubernetes Official Docs - Basics&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cncf.io/" rel="noopener noreferrer"&gt;📖 Cloud Native Computing Foundation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/results?search_query=kubernetes+cka" rel="noopener noreferrer"&gt;📺 Kubernetes CKA Playlist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Setting Up Kubernetes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can set up Kubernetes on your local machine using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minikube&lt;/strong&gt; – A lightweight Kubernetes setup for local development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Desktop&lt;/strong&gt; – Provides a built-in Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;K3s&lt;/strong&gt; – A lightweight Kubernetes distribution for edge computing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Deploying Your First Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a Deployment YAML file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80

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

&lt;/div&gt;



&lt;p&gt;Apply the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f nginx-deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify 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 pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Exposing Your Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To make your application accessible, create a Service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: NodePort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f nginx-service.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What’s Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you understand the basics, dive deeper into topics like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scaling Applications with Horizontal Pod Autoscalers (HPA).&lt;/li&gt;
&lt;li&gt;Storage Management using Persistent Volumes (PV) and Persistent Volume Claims (PVC).&lt;/li&gt;
&lt;li&gt;Monitoring &amp;amp; Logging using Prometheus and Grafana.&lt;/li&gt;
&lt;li&gt;Security Best Practices for protecting Kubernetes workloads.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Kubernetes simplifies container management, making it easier to deploy, scale, and manage modern applications. Whether you're a developer, DevOps engineer, or cloud enthusiast, learning Kubernetes is a valuable skill for the future of cloud computing.&lt;/p&gt;

&lt;p&gt;Stay tuned for more insights and discussions on Kubernetes through our social media channels and upcoming YouTube Shorts!&lt;/p&gt;

&lt;p&gt;🚀 Start Learning Today: &lt;a href="https://www.youtube.com/playlist?list=PLnKy4XevqUM8fWHuvpcgHwA8tmmvd5WLZ" rel="noopener noreferrer"&gt;Drew's Kubernetes Playlist&lt;/a&gt;&lt;br&gt;
Let's Connect on &lt;a href="https://www.linkedin.com/in/vaishali-rawat-tech/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cloud</category>
      <category>containers</category>
    </item>
  </channel>
</rss>
