<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vikas Badoni</title>
    <link>https://vikasbadoni031.github.io/blog/</link>
    <description>Recent content on Vikas Badoni</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 10 Dec 2024 11:41:47 +0530</lastBuildDate>
    <atom:link href="https://vikasbadoni031.github.io/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Kubernetes Service Networking using IPtables</title>
      <link>https://vikasbadoni031.github.io/blog/posts/kube-service-networking.html</link>
      <pubDate>Tue, 10 Dec 2024 11:41:47 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/kube-service-networking.html</guid>
      <description>&lt;p&gt;How Kubenetes services like ClusterIP or NodePort work behind the scenes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Kube-Proxy&lt;/strong&gt; is the component responsible for setting up all the networking for your service. It runs as a daemon set on each node and configures the routing rules for kubernetes services.&lt;/p&gt;&#xA;&lt;p&gt;Behind the scene the kube-proxy works with the kernel&amp;rsquo;s iptable rules (If the proxy is running in iptable mode) and modifies the prerouting chain. Any ip packet that enters the kernel stack first goes through this chain where the service ip is resolved to the pod ip.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Webserver and Kernel Interaction</title>
      <link>https://vikasbadoni031.github.io/blog/posts/kernel-tcp.html</link>
      <pubDate>Sun, 01 Dec 2024 07:38:31 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/kernel-tcp.html</guid>
      <description>&lt;p&gt;In this blog we see how a webserver or any other such process picks up connection from the kernel and serves it?&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;./images/kernel-tcp.png&#34;&gt;&lt;img src=&#34;./images/kernel-tcp.png&#34; alt=&#34;Sample Output&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;NIC card is where the connection is received and convertion happens from physical layer (Electricity etc) to data link layer (Binary digital) signals. This can be a ethernet port or a wifi port.&#xA;Once the data is inside, it is processed at other layers by kernel networking stack.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Containers Demystified !!</title>
      <link>https://vikasbadoni031.github.io/blog/posts/container.html</link>
      <pubDate>Sat, 30 Nov 2024 08:38:31 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/container.html</guid>
      <description>&lt;h3 id=&#34;what-is-a-container&#34;&gt;What is a container?&lt;/h3&gt;&#xA;&lt;p&gt;Its simply a process running on the host machine. When u search for the processes in the host machine you will find the container&amp;rsquo;s application process running on the host machine.&lt;/p&gt;&#xA;&lt;p&gt;Now there are several issue with this approach.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;strong&gt;first problem&lt;/strong&gt; here is the &lt;strong&gt;process isolation&lt;/strong&gt;. These are processes from different applications running on  the same machine.&lt;/p&gt;&#xA;&lt;p&gt;To provide isolation at the resource level these process are assigned namespaced slice of the different resources required. Linux namespaces are a way for the system to assign separate resources for network, userspace, pid space etc to a process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes Operator to scale applications based on custom CRD</title>
      <link>https://vikasbadoni031.github.io/blog/posts/kube-crd.html</link>
      <pubDate>Fri, 29 Nov 2024 19:23:09 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/kube-crd.html</guid>
      <description>&lt;p&gt;Kubernetes Operators allow you to extend the native functionality of Kubernetes by integrating custom logic into the control plane. You can codify application-specific operational knowledge directly into Kubernetes. Using Operarators you can automate application specific operational tasks.&lt;/p&gt;&#xA;&lt;p&gt;In this project we have created a custom operator from scratch using operator-sdk to create the boilerplate code, defining you own CRD&amp;rsquo;s and then providing the custom logic for reconciling the required objects in the cluster. This opearor allows you to scale up or down the no of replicas for a list of deployments based on the time and count in the inputs from crd.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Shell using Linux System calls in C</title>
      <link>https://vikasbadoni031.github.io/blog/posts/shell.html</link>
      <pubDate>Fri, 29 Nov 2024 07:38:31 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/shell.html</guid>
      <description>&lt;p&gt;In this article we will be creating our own version of linux shell binary which provides the output based on the input commands provided.&lt;/p&gt;&#xA;&lt;p&gt;Essentially we will be using the &lt;strong&gt;fork()&lt;/strong&gt; system call to create a new process from the current shell which then execute the command passed. Once a new process is created &lt;strong&gt;execvp()&lt;/strong&gt; func is used for replacing the complete current process stack with thew new command which is passed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>TCP load Balancer using socket programming</title>
      <link>https://vikasbadoni031.github.io/blog/posts/tcp-lb.html</link>
      <pubDate>Tue, 24 Sep 2024 19:23:12 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/tcp-lb.html</guid>
      <description>&lt;p&gt;In this project we will be creating a load balancer and a group of backend servers using python socket programming. We will redirect/ load balance the request coming from client to load balancer to the different backend server choosen based on an algorithm.&lt;/p&gt;&#xA;&lt;p&gt;For both backend server and load balancer, we first start by initialising the socket. Then bind that socket to a ip address and port pair (This is where the process listens on).&#xA;We then finally start listening for the connection.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Golang CLI plugin to extend kubectl functionality</title>
      <link>https://vikasbadoni031.github.io/blog/posts/kubectl-plugin.html</link>
      <pubDate>Wed, 29 Nov 2023 19:23:09 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/kubectl-plugin.html</guid>
      <description>&lt;p&gt;Extending the functionality of kubectl by creating a custom plugin using the popular Go package, Cobra. Kubernetes offers extensive command-line tools, but sometimes you need additional commands tailored to your specific workflow. By using Go and Cobra, you can easily add your own commands to kubectl, helping with automating repetitive tasks.&lt;/p&gt;&#xA;&lt;p&gt;This application shows how to use the Cobra package, focusing on implementing a simple use case: retrieving deployments based on user input parameters. Based on the provided input, the app queries the cluster to find matching deployments and displays the requested memory and CPU. If no resource requests are set, it will display &amp;ldquo;None.&amp;rdquo; This functionality helps easily identify problematic deployments within the system. Additionally, the functionality is extensible to support other object types and custom requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kubernetes interactions using client-go library</title>
      <link>https://vikasbadoni031.github.io/blog/posts/client-go.html</link>
      <pubDate>Thu, 24 Aug 2023 19:23:15 +0530</pubDate>
      <guid>https://vikasbadoni031.github.io/blog/posts/client-go.html</guid>
      <description>&lt;h3 id=&#34;sample-application-deployment-using-golang&#34;&gt;Sample application Deployment using Golang.&lt;/h3&gt;&#xA;&lt;p&gt;Creates nginx Deployment, Service, Ingress which is accessible on the localhost.&lt;/p&gt;&#xA;&lt;p&gt;we create a deployment by defining the deployment struct and then creating it using create method from the deployment interface.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;deployment&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;appsv1&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Deployment&lt;/span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;...&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;clientSet&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;AppsV1&lt;/span&gt;().&lt;span style=&#34;color:#a6e22e&#34;&gt;Deployments&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;namespace&lt;/span&gt;).&lt;span style=&#34;color:#a6e22e&#34;&gt;Create&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We then wait for the replicas to come online. by first getting the deployment using get method and checking the status field for the readyrelplicas.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;checkForReadyReplicas&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;currentReadyReplicas&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; (&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;deployment&lt;/span&gt;).&lt;span style=&#34;color:#a6e22e&#34;&gt;Status&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;ReadyReplicas&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;once the replicas are ready we then create the kubenetes service by defining a service struct and using create metod on the services interface.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
