<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saad Jafar on Medium]]></title>
        <description><![CDATA[Stories by Saad Jafar on Medium]]></description>
        <link>https://medium.com/@SaadJafar?source=rss-97b42fcc4af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*J1anQtEmEnr3MMnB</url>
            <title>Stories by Saad Jafar on Medium</title>
            <link>https://medium.com/@SaadJafar?source=rss-97b42fcc4af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:43:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@SaadJafar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Argo CD: Making Continuous Delivery to Kubernetes clusters more efficient]]></title>
            <link>https://medium.com/@SaadJafar/argo-cd-making-continuous-delivery-to-kubernetes-clusters-more-efficient-5d311ec95c49?source=rss-97b42fcc4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d311ec95c49</guid>
            <dc:creator><![CDATA[Saad Jafar]]></dc:creator>
            <pubDate>Tue, 06 Dec 2022 23:09:46 GMT</pubDate>
            <atom:updated>2022-12-07T15:31:33.243Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, the sequence of discussion is as follows:</p><ul><li>Background</li><li>Why the need for Argo CD?</li><li>CD workflow with Argo CD</li><li>What are the advantages of using Argo CD?</li><li>How to configure Argo CD?</li><li>How to install Argo CD and create an application?</li><li>Conclusion</li></ul><p>Before jumping onto Argo CD, let’s have some background<strong> </strong>check.</p><h4><strong>Background</strong></h4><p>GitOps makes use of Argo CD as a continuous delivery tool. GitOps has 2 features:</p><ol><li>It is version controlled</li><li>It makes use of team collaboration</li></ol><p>In GitOps flow as seen in the diagram below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*bl-vFFoVA70QGNYwiB2_qA.jpeg" /><figcaption>source: <a href="http://shorturl.at/iBOY8">image</a></figcaption></figure><p><strong>CD Pipeline</strong> is the last step where the changes get deployed to the environment e.g changing something in the Kubernetes cluster.</p><p>In GitOps, there are 2 ways of applying these changes:</p><blockquote><strong>Push based deployment</strong> — the application is built and a command is executed by the pipeline to deploy the new application version to the environment</blockquote><blockquote><strong>Pull based deployment</strong> — there is an <strong>Agent</strong> in the environment that pulls the changes from the Git Repository. The main purpose of an agent is to actively monitor the state of the infrastructure code (desired state) and compare it with the actual state in the environment. Now if it notices that there is indeed a difference in the repository, it will pull and apply the changes in order for the environment to go from the actual state to the desired state</blockquote><p>This exact Agent is <strong>Argo CD</strong>: the GitOps tool that works with the pull-based models to manage the changes from Git Repository to the Kubernetes cluster.</p><h3>Why the need for Argo CD?</h3><p>It is essential to understand purpose of Argo CD and for that, we will first discuss how CD is implemented in other projects.</p><p>Let’s take an example of <strong>Jenkins</strong>.</p><p>Suppose there is a microservices application that we are running in a Kubernetes cluster. If there has to be something changed in the application code / Git repository, Jenkin’s CI pipeline will be triggered automatically and will perform the following actions:</p><p>Test the changes → Build the image → Push it to Docker Hub</p><p>Now the way it gets deployed to a Kubernetes cluster is that you update the image tag in the deployment yaml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*0ZgcsocsEGu6-VqDchVLuQ.png" /><figcaption>source:<a href="http://shorturl.at/ik345"> image</a></figcaption></figure><p>So in the above case, as you can see in line 26 there is an image tag, just update it to something else.</p><p>So the whole CI/CD pipeline then becomes:</p><p>Test the changes → Build the image → Push it to Docker Hub → Jenkins will Update yaml file → kubetcl apply to apply updated deployment file to Kubernetes.</p><p><em>There were issues with this approach:</em></p><ul><li>Kubectl needs to be set-up and installed</li><li>Access to Kubernetes needs to be configured — in order for kubectl to communicate with Kubernetes you’ll need credentials</li><li>If you are using EKS on AWS, then you’ll need access to AWS / other cloud platform</li><li>Hence it becomes a security concern as you’ll need to provide cluster credentials to external tools</li><li>Jenkins does not know state of cluster when it deploys application to Kubernetes or applies chances.</li></ul><blockquote>That is where Argo CD comes in play</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*SRW0UOkoFm5EK4yRkbmMNg.jpeg" /><figcaption>source: <a href="http://shorturl.at/kqwBL">image</a></figcaption></figure><blockquote><strong>Argo CD</strong> is part of the Kubernetes cluster itself, as per the idea of an Agent that we discussed previously so you do not have to give cluster credentials to external tools.</blockquote><blockquote><strong>Argo CD</strong> also pulls the changes in Kubernetes manifest and applies those changes</blockquote><h4>CD Workflow with Argo CD</h4><ol><li>First, we deploy Argo CD in Kubernetes cluster.</li><li>Next, we configure Argo CD and tell it to connect it to a git repository and monitor it for any changes.</li></ol><p>and the CI pipeline: Test the changes → Build the image → Push it to Docker Hub → Update Kubernetes manifest file</p><p>Therefore in this way, CI and CD pipelines are separate.</p><h3>What are the advantages of using Argo CD?</h3><p>Following are its advantages:</p><ul><li>Kubernetes configuration is defined as code in Git Repo</li><li>You do not need to manually apply configuration files</li><li>To update the cluster, everyone uses the same interface aka git commit.</li></ul><blockquote>Argo CD makes use of already existing Kubernetes functionality, e.g it uses etcd to store the data and uses Kubernetes controllers to monitor the actual and desired state → which provides visibility of the cluster that was not initially possible with Jenkins</blockquote><h4>How to configure Argo CD?</h4><p>Deploy Argo CD to Kubernetes cluster and this extends Kubernetes API with CRD (Custom Resource Definition) which lets us to configure argo cd with kubernetes yaml file.</p><p>In Kubernetes, the main resource is application which is defined in application.yaml file. Here is an example of such a yaml file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*5DYao0p-_00oH4gy4a7_Hw.png" /><figcaption>source: <a href="http://shorturl.at/eU178">image</a></figcaption></figure><p>The “<strong>source</strong>” tag gives you information about the Git repository while the “<strong>destination</strong>” tag gives you information about the Kubernetes cluster. All in all, which git repository should be linked with which cluster in Kubernetes.</p><h3>How to install Argo CD and create an application?</h3><p>We paste these commands in the terminal with “argocd” as the namespace:</p><pre>$ kubectl create namespace argocd<br>$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</pre><p>Here we are applying this yaml file which will install everything needed by Argo CD.</p><p>If you want to know what is in the yaml file, you can first download and see for yourself before applying it.</p><p>Then run this command to see the pods in the argocd namespace:</p><pre>$ kubectl get pod -n argocd</pre><p>Check the services that are created with the command “<strong>kubectl get svc -n argocd</strong>”</p><p>It will show an output similar to this:</p><pre>NAME                    TYPE        CLUSTER-IP   EXTERNAL-IP  PORT(S)      AGE<br>argocd-dex-server     ClusterIP   10.103.44.123   &lt;none&gt;      5556/TCP,<br>                                                              5557/TCP,<br>                                                              5558/TCP    `3m43s<br>argocd-metrics        ClusterIP   10.107.89.112  &lt;none&gt;       8082/TCP     3m44s<br>argocd-redis          ClusterIP   10.98.36.223   &lt;none&gt;       6379/TCP     3m44s<br>argocd-repo-server    ClusterIP   10.99.132.114   &lt;none&gt;      8081/TCP,<br>                                                              8084/TCP     3m44s<br>argocd-server         ClusterIP   10.105.66.211    &lt;none&gt;     80/TCP,<br>                                                              443/TCP      3m44s<br>argocd-server-metrics ClusterIP   10.104.126.236  &lt;none&gt;      8083/TCP     3m44s</pre><ul><li><strong>argocd-server</strong> service is accessible on http and https ports as you can see above (80 and 443)</li></ul><p>Now, we will use use kubectl port forwarding to access the argocd-server:</p><pre>$ kubectl port-forward -n argocd svc/argocd-server 8080:443</pre><p>At this point you will be shown an <strong><em>output</em></strong> like this:</p><pre>Forwarding from 127.0.0.1:8080 -&gt; 8080</pre><p>Copy the URL <strong>127.0.0.1:8080</strong> and paste this into the browser</p><p>You would probably first get a warning, as the connection would not be secure but it would be https, just proceed further anyway by clicking on “Advanced” and viola, this would then be displayed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clfOUjJsDenepP9ln-9rSA.png" /><figcaption>source: <a href="http://shorturl.at/akr58">image</a></figcaption></figure><p>As per the documentation of argocd, it states that at this point, the username used is “admin” and the password is auto-generated and saved in <strong>argocd-initial-admin-secret </strong>— which by name is a secret itself</p><p><strong>How to get the secret?</strong></p><p>Run this command:</p><pre>$ kubectl get secret argocd-initial-admin-secret-n argocd -o yaml</pre><blockquote>Note: the “yaml” in the end is to give the output in yaml</blockquote><p><em>This will give you a bunch of key value pair output. The password is stored in the password attribute. </em><strong><em>Copy the random string (password) because we will now decode it</em></strong></p><p>To decode the password, run the command below. <strong>In the command, replace “password” with the password string that you copied</strong>.</p><pre>$ echo password | base64 --decode</pre><p>Now, after running the command, you will get a decoded string.<strong> Copy that value now without the % sign and paste it into the password field with username “admin” and sign in.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6Nl303W7UMWdKcsF_ztww.png" /><figcaption>source: <a href="http://shorturl.at/exBHQ">image</a></figcaption></figure><p>It shows <strong>No applications yet </strong>because we have not yet configured argocd.</p><p>If you want to create an application, <strong>here is how to do with the UI</strong>:</p><p>Click on <strong>+ NEW APP </strong>and then fill in the details like this:</p><ul><li><strong>application name -</strong> test</li><li><strong>project -</strong> default</li><li><strong>sync policy -</strong> manual</li><li><strong>repository URL -</strong> where exactly your application is residing</li><li><strong>path -</strong> path where the YAML files are located</li><li><strong>cluster URL -</strong> select the cluster URL that you are using</li><li><strong>namespace -</strong> default</li></ul><p>After this, your application will be created. You will probably get an <strong>outofsync</strong> status shown on the side. To deal with that, <strong>you have to enable the auto-sync policy</strong> which is present inside the <strong>app details</strong> by clicking on this test application. Your application will now be HEALTHY!</p><h3>Conclusion</h3><p>Argo CD is a tool with many positives. Some listed as:</p><p>Argo has a robust user interface that makes it easier to see connections between various things and keep track of them. Argo supports multi-tenancy. With Argo, you may link numerous repositories by including additional applications to an existing project. Argo also supports Kubernetes manifests (YAML), Kustomize and Helm. GitOps practitioners can choose from a variety of tools thanks to Argo CD.</p><p>Hopefully, there are more advancements to be made in this field of DevOps and the branch of GitOps.</p><p>Here’s to making our tasks easier with Argo CD! :)</p><h4>References</h4><ol><li><a href="https://www.youtube.com/watch?v=MeU5_k9ssrs">Argo CD for beginners</a></li><li><a href="https://argo-cd.readthedocs.io/en/stable/?_gl=1*fx7ny0*_ga*OTE2Njc5NTIzLjE2NzAzNjU4OTI.*_ga_5Z1VTPDL73*MTY3MDM2NTg5MS4xLjAuMTY3MDM2NTg5NC4wLjAuMA..">Argo CD documentation</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d311ec95c49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes vs Nomad: What are you choosing?]]></title>
            <link>https://medium.com/@SaadJafar/kubernetes-vs-nomad-what-are-you-choosing-fc0d17dd50ec?source=rss-97b42fcc4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc0d17dd50ec</guid>
            <dc:creator><![CDATA[Saad Jafar]]></dc:creator>
            <pubDate>Thu, 27 Oct 2022 00:30:09 GMT</pubDate>
            <atom:updated>2022-10-27T00:30:09.346Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>The sequence of events for this blog is as follows:</em></strong></p><ol><li>What is Nomad?</li><li>Kubernetes vs Nomad — Similarities</li><li>Kubernetes vs Nomad — Differences</li><li>Differences in Architectural components</li><li>Production Deployment scenario</li><li>Pros and Cons of each</li><li>Conclusion</li></ol><p>I have already made a blog about “<strong>Introduction to Kubernetes</strong>”. So if you want to have a background of what Kubernetes is and its components, feel free to click <a href="https://medium.com/@SaadJafar/introduction-to-kubernetes-a408bc848f95">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTNcSvO-VVMO9fXs_aQ0cA.png" /><figcaption>source: <a href="https://tinyurl.com/kubenomad">image</a></figcaption></figure><h3>What is Nomad?</h3><p>There seems to be a lot unknown about what Nomad actually is, as it is not as popular as Kubernetes. So we begin with the question, <em>what is Nomad?</em> In simple words, Nomad is basically a flexible workload orchestrator. <strong><em>The basis for Nomad was to focus only on cluster management and scheduling</em></strong><em>.</em> It was developed by<strong> HashiCorp</strong> in 2015. Now we know that both Kubernetes and Nomad are technologies that are still relatively new!</p><p>The <strong><em>flexibility</em></strong> in <strong>Nomad</strong> comes from its ability to be useful in many ways; it is general purpose. Nomad supports virtualized, containerized, standalone applications like Docker, Java, and IIS on Windows while <strong>Kubernetes</strong> is mainly concentrated on Linux containers.</p><h3>Kubernetes vs Nomad — Similarities</h3><p>Before we jump into the differences, it is imperative to see the common ground both confine in.</p><ol><li>Automated Scheduling</li><li>Auto-Recovery and Self-Healing Deployments</li><li>Rollout and Rollback Strategies</li><li>Kubernetes and Nomad Storage Orchestration</li></ol><h3><strong>Kubernetes vs Nomad — Differences</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJDr7TcMYBFqqqmxQakmFg.png" /><figcaption>source: <a href="https://tinyurl.com/diff100">image</a></figcaption></figure><p>Let’s dive into the differences between the two to make our understanding even better!</p><blockquote><strong>Online Community Size</strong></blockquote><p>It must be no surprise that Kubernetes, because of its popularity, has a bigger online community presence compared to Nomad. On Twitter and GitHub Repo, it is evident that Kubernetes leads the way with 295.5K followers, and 3.3k watch, 93k starts respectively as of right now. <strong>Though, one thing to take into consideration is that we are comparing HashiCorp’s Twitter following with Kubernetes’ Twitter following</strong>. <em>Interesting fact: Kubernetes has its own exclusive event KubeCon, while Nomad on the other hand does not.</em> This automatically tells you that <em>Kubernetes is already a bigger player when it comes to community size.</em></p><blockquote><strong>Simplicity</strong></blockquote><p>Kubernetes is complex to set up because it uses all the components together to provide complete functionality. The components here are the in the master node and the worker node. The master node as a set of components such as controller manager, API server, scheduler etc.</p><p>On the other hand, <em>downloading and installation of Nomad is relatively simpler</em> because it is a single binary. This is an important point because this emphasises that Nomad can be run as both client and servers.</p><blockquote><strong>Scalability</strong></blockquote><p>There is some difference when it comes to how many nodes can each container orchestrator scale. Clusters up to 5000 node can be supported with Kubernetes, while clusters with more than 10000 nodes can be supported by Nomad. You can also deploy it across multiple regions and availability zones. <em>Hence scaling across multiple regions becomes way easier with Nomad.</em></p><blockquote>You may find that discovering talent in Nomad is an uphill task because of the lack of training opportunities, while you can comparatively find many that have a strong grip on Kubernetes and are specialized in it.</blockquote><h4>Differences in Architectural components:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*Tm2tbyVRGjJFGUwFfEMNlg.png" /><figcaption>source: author</figcaption></figure><p>In the above diagram, you can see the terms that are being compared in both the technologies are the ones that have relatively almost the same working. In the table you can see that a Control Plane and Node in Kubernetes is referred to as “<strong><em>Server and Client</em></strong>” in Nomad, each of which requires a single process to be installed. Similarly a <strong><em>Region</em></strong> in Nomad consists of both server and client nodes working together. It is similar to a cluster in Kubernetes.</p><p><strong>Client agent </strong>is something<strong> </strong>that<strong> </strong>provides scheduling information to the Nomad servers. It is therefore similar to Kubelet in Kubernetes</p><p>In the Nomad <strong>Server agent,</strong></p><ul><li>Nomad makes use of two API protocols: an RPC API which makes use of internal server-server and server-client communication and an HTTP API.</li><li>Kubernetes relies on <strong>etcd, </strong>which is a key value store<strong> </strong>to maintain cluster state. Nomad implements the Raft algorithm internally to do the same task.</li></ul><p>Pod in Kubernetes is a set of running containers in a cluster. It is the smallest unit of deployment in Kubernetes. In Nomad, the smallest unit of deployment is a task. Tasks are part of a Nomad<strong> Job. </strong>A job is written in JSON format and in this the<strong> </strong>users specify declaratively how apps should be deployed. A task, as shown in the diagram, can be a single container in a pod.</p><blockquote>In the case where a region fails, clients can still submit jobs to another region, provided that it is federated.</blockquote><p>Similar to number pods in a replica set, tasks within a group are called a <strong>Task Group. </strong>Tasks here share storage and network resources. To make known the number of instances, count variable is used. Let’s suppose that count = 2. When all this is configured, Nomad creates 2 <strong>allocations</strong>. So in this case, allocation = pod.</p><blockquote><strong>Nomad Job — — → Task Group — — → Task</strong></blockquote><p>In Kubernetes, <strong>Kube-proxy</strong> tracks the pods and acts as a load balancer between them. In Nomad, this work is done by <strong>Consul</strong>, a HashiCorp product.</p><p>In a <strong>Production Deployment</strong> scenario:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgfuMa3QOjVJMat_QMDpUA.png" /><figcaption>source: <a href="https://tinyurl.com/produc101">image</a></figcaption></figure><p>In Kubernetes, making the control plane highly available is imperative. We typically need to run multiple instances of a control plane, all supported by a load balancer.</p><p>In Nomad, the server node is by default highly available. They are made in a way to make this possible. They are used to schedule different tasks. These servers select a <strong>leader</strong> within themselves. The others server agents are referred to as a “<strong>follower</strong>”. The leader’s task is to manage the changes in cluster state and also communicate that to the followers. A scenario in which the leader halts or fails, one of the followers is automatically appointed as a leader.</p><h4>Finally, with all of this in mind, pros and cons of each listed out:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IREG8gNR2iPYJMbLxfxwfQ.png" /><figcaption>source: <a href="https://tinyurl.com/compar101">image</a></figcaption></figure><h4><strong>Conclusion:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzZmVxXM0u3OmHVFsg8mTA.png" /></figure><p>Choosing your container orchestrator between these requires critical assessment. It is important to keep in mind that Nomad can also manage non-containerized applications. <strong>Ultimately, it all comes down to what you want to use it for</strong>. You should typically choose Nomad when there are multiple workloads in your use-case. If you want a tool that has more involvement in third-party integration, then Kubernetes should typically be preferred. Or if your environment is on premise or hybrid, then Nomad is the way to go. If it is on public cloud, then Kubernetes leads the way. Lastly, for server-less, ML/AI use-cases, Kubernetes is preferred.</p><p>If you liked the content of the blog, don’t forget to clap! I would also appreciate genuine feedback. Thank you for reading, until next time ! :)</p><p><strong>References</strong></p><p>[1] <a href="https://www.hashicorp.com/blog/a-kubernetes-user-s-guide-to-hashicorp-nomad">Kubernetes vs Nomad</a></p><p>[2] <a href="https://loft.sh/blog/nomad-vs-kubernetes-picking-the-right-tool-in-2022/">Picking the right tool</a></p><p>[3] <a href="https://developer.hashicorp.com/nomad/intro/vs">Nomad vs Other Software</a></p><p>[4] <a href="https://developer.hashicorp.com/nomad/docs/nomad-vs-kubernetes/supplement">Supplement to Kubernetes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc0d17dd50ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kubernetes]]></title>
            <link>https://medium.com/@SaadJafar/introduction-to-kubernetes-a408bc848f95?source=rss-97b42fcc4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/a408bc848f95</guid>
            <dc:creator><![CDATA[Saad Jafar]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 12:47:02 GMT</pubDate>
            <atom:updated>2022-09-17T16:54:08.190Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>In this blog the sequence of our discussion will be as follows:</strong></p><ol><li>What is Kubernetes?</li><li>Background on Container</li><li>Why did we need Kubernetes in the first place?</li><li>Discussion over Kubernetes architecture</li><li>Kubernetes Benefits</li><li>Conclusion</li></ol><h3><strong>What is Kubernetes?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*-v7aUpje1lN9cisuRvmZiA.png" /><figcaption>source:<a href="https://www.a10networks.com/wp-content/uploads/OnDemandWebinar-Kubernetes-KeyGraphic-@2x-768x422.png"> image</a></figcaption></figure><p>In simple words, <strong>Kubernetes</strong> is an open source platform which is actually a container orchestrating service. It is written in Go programming language and was originally designed by engineers at Google.</p><p>To further elaborate on this point, it automates the process of deployment and scaling of the <strong>containers</strong>. <em>Interesting right? </em>We will dive deep into how Kubernetes actually does this later on in the section. First let’s get a quick overview of what a container is so we have our basics correct.</p><blockquote>What is a <strong>Container</strong>?</blockquote><p><strong>Container</strong> is basically a process that virtualises your OS in the way that several workloads can be handled with a single OS instance. This takes up only the space required by your application and nothing more, which is why it can be preferred over Virtual Machines. Containers are also more portable — which means that it is easy to move the application from one host environment to another, given that it is from the same family of operating systems, and hence, you do not need to re-compline anything. A container is isolated from all other processes. It packages all of the dependencies and code so that the application works faster. <strong>An interesting fact:</strong> <em>It was in 2013 that Docker Container technology was actually launched!</em> More about Docker Containers is available on <a href="https://docs.docker.com/get-started/#what-is-a-container">this link</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DV80EPvqFv6pkT6auMUWuQ.png" /><figcaption>source:<a href="https://www.docker.com/resources/what-container/"> docker.com/resources</a></figcaption></figure><h4><strong><em>Why did we need Kubernetes in the first place?</em></strong></h4><p>The need for Kubernetes can be explained in the points given below. The architecture diagram will illustrate the concept.</p><ol><li>Suppose you have set-up your containers and there are containers already running.</li><li>There is an application running in a container and there are 2 nodes (a node is a physical or virtual machine) . Now, if the application is down in one node, how do we make sure that application is deployed on the other node?</li></ol><blockquote><strong><em>One possible solution</em></strong> could be to change the namespace in the application so it now belongs to the other node. However.. the issue is that you would still have to do this manually each time. Looking for server requests to see if it working fine and deploying another node would take time and incur costs. How do we automate this? Wouldn’t it be simpler if a machine did this for us?</blockquote><p><strong>Another challenge:</strong> running several containers on several nodes in a production environment.</p><p>With this, you have to <strong><em>schedule</em></strong> which container runs on which node. This is because you might need different types of containers for different nodes, e.g a memory-hungry node. You also have to maintain <strong><em>networking </em></strong>between containers on different nodes. Finally, you might also want to ensure your application is <strong>always up and running</strong> and can handle <strong>concurrent users</strong> at a given time. What solves these problems?</p><p><em>That is where </em><strong><em>Kubernetes</em></strong><em> comes into play</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*9-wcLW_OSzBFvZcg7SF5FQ.png" /><figcaption><strong>Kubernetes architecture</strong>, source : <a href="https://tinyurl.com/simplilearn101">https://tinyurl.com/simplilearn101</a></figcaption></figure><p>Kubernetes has two nodes — a <strong>master node</strong>, and a set of <strong>worker nodes</strong>. When you make use of Kubernetes, the nodes are in an entity called a <strong>cluster. </strong>Every cluster requires at least one node. Each worker node consists of a <strong>pod</strong>, which is a set of running containers in the cluster.</p><h3>Let’s now discuss the Kubernetes architecture shown above with respect to the components of the master node.</h3><ol><li><strong>Control Manager</strong></li></ol><ul><li>It is a component in the control plane that gathers information and sends it to the API server.</li><li>It controls the controller processes, namely Node controller, Replication controller, Endpoints controller, and Service Account controllers.</li><li>For example, replication controller ensures that a certain number of containers are running at all times and a node controller is responsible for on-boarding new nodes to a cluster and handling situations where nodes become unavailable.</li></ul><p>2.<strong> Control Scheduler</strong></p><ul><li>It picks out what node to place the container based on a number of things, including the worker node’s capacity and the container’s resource requirements.</li><li>Gives out tasks to the worker nodes.</li><li>It is responsible for distribution of workload between nodes.</li></ul><p>3. <strong>API Server</strong></p><ul><li>It manages all the components. This means that it makes communication between the components possible.</li><li>It is responsible for performing all operations within the cluster.</li><li>It observes the state of the cluster and make changes if required.</li><li>For example, consider a case where there are 3 worker nodes. If one node is down, then the <strong>replica set</strong> is transferred to another node. If all 3 nodes are down, <strong>API Server</strong> sees this and creates 3 more nodes.</li></ul><blockquote>A <strong>replica set</strong> is another abstraction layer on top of Pods. It is there to make sure that there are a given number of similar pods running at a certain time.</blockquote><p>4. <strong>ETCD</strong></p><ul><li>At any given point of time, containers get loaded to a worker node or unloaded from a worker node. To track intricate details such as what container was on which node and the time the container was on-boarded, etcd is needed.</li><li>It is a key-value store.</li><li>It is based on the Raft Consensus Algorithm.</li><li>The algorithm basically makes sure that even if some members fail it can still work.</li><li>Stores configuration details such as subnets etc.</li></ul><p>5. <strong>Kubetcl</strong></p><ul><li>This is a Kubernetes command line tool.</li><li>Kubernetes cluster manager — assists in interacting with the Kubernetes cluster.</li></ul><h3>With all of this in mind, what are the benefits Kubernetes provides?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLDBDioc_oCP263mVaVcgQ.png" /><figcaption>source:<a href="https://tinyurl.com/cloudstackgroup"> https://tinyurl.com/cloudstackgroup</a></figcaption></figure><p><strong>Autoscaling: </strong>Even when several users use the application at the same time, the application runs perfectly fine. Kubernetes makes use of horizontal scaling — automatically scaling the number of pods.</p><p><strong>Load Balancing</strong>: Incase of high traffic to a container, Kubernetes distributes the workload and traffic so that everything remains firm.</p><p><strong>Storage orchestration</strong>: Kubernetes is flexible in the way that it allows you to use your own storage, be it from a cloud provider or from your own machine.</p><p><strong>Self-healing: </strong>Kubernetes replaces containers, restarts the failed containers, and kills the containers if they do not meet a set requirement.</p><p><strong>Automated bin packing: </strong>If you tell Kubernetes that you have a cluster of nodes and the amount of memory each container needs, Kubernetes will automatically set the containers in the nodes for you based upon your requirement.</p><p><strong>Secret and configuration management: </strong>You can store and manage classified information on Kubernetes, such as passwords.</p><h3>Conclusion</h3><p>It is not hard to guess why many organisations are starting to familiarise themselves with a powerful tool that Kubernetes is. It is definitely the next big thing! Hoping the content was easy to digest! More information about Kubernetes is available on their <a href="https://kubernetes.io/docs/home/">documentation</a>. Support me if you liked the content :) Thank you for reading!</p><h4><strong>References</strong></h4><p>[1] <a href="https://www.simplilearn.com/tutorials/kubernetes-tutorial/kubernetes-architecture">Kubernetes Architecture Simplilearn</a></p><p>[2] <a href="https://kubernetes.io/docs/home/">Documentation for Kubernetes</a></p><p>[3] <a href="https://cloudstackgroup.com/4-major-benefits-of-using-kubernetes/">Kubernetes Benefits</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a408bc848f95" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>