<?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 Haris Jafar on Medium]]></title>
        <description><![CDATA[Stories by Haris Jafar on Medium]]></description>
        <link>https://medium.com/@harisjafar2000?source=rss-a3c809985ac5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6RzkKel2wat2elVhuBbhgQ.jpeg</url>
            <title>Stories by Haris Jafar on Medium</title>
            <link>https://medium.com/@harisjafar2000?source=rss-a3c809985ac5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:07:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harisjafar2000/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[Powerful Deployment Strategies using Argo Rollout]]></title>
            <link>https://medium.com/@harisjafar2000/powerful-deployment-strategies-using-argo-rollout-8c018ce7fba0?source=rss-a3c809985ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c018ce7fba0</guid>
            <category><![CDATA[argo-rollouts]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[argo]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Haris Jafar]]></dc:creator>
            <pubDate>Thu, 01 Dec 2022 15:30:20 GMT</pubDate>
            <atom:updated>2022-12-01T15:35:09.182Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>This blog will feature:</strong></p><ol><li>What is Argo Rollout?</li><li>Rollout Configuration</li><li>How does Argo Rollout work?</li><li>When should we use Blue/Green</li><li>When should we use Canary</li><li>Conclusion</li></ol><h3><strong>What is Argo Rollout?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*tswd91TBrKxkI6-R5Lpqyw.png" /></figure><p>Argo Rollouts is basically a <em>Kubernetes Controller</em> and a set of custom resources which can support advanced deployment capabilities for example- Canary, Blue/Green, Canary Analysis, and much more.</p><p>Argo Rollouts combines with ingress controllers and service meshes, exploiting their traffic shaping abilities to cautiously shift to a newer version during an update. Furthermore, Rollouts can also query and interpret metrics from numerous providers to double-check key KPIs and drive automated promotion or rollback during an update.</p><p>Moreover, Argo Rollouts solve a common problem in deploying to production environments in rolling out new charges by controlling blast radius and automated recovery with rollback on failure. Argo Rollouts provide multiple strategies- here we will discuss their configurations and why we use one over the other.</p><h3><strong>Rollout Configuration</strong></h3><p>Rollout can be used with and without Argo CD. Argo CD is designed to integrate Git configuration with Kubernetes deployment configuration. Argo Rollouts provide the workflow in moving from one revision to another with analysis at each step. It does so while disabling the Argo CD synchronisation during rollout workflow.</p><p>Argo Rollouts can be applied to a replica set in application or even a single deployment object. As discussed before, it is a Custom Resource Definition (CRD) used with Kubernetes Cluster. A rollout spec for an existing application can reference an existing deployment and the strategy to apply.</p><p>In the configuration below, rollout represents an existing deployment manifest “rollout-ref-deployment” and uses a rollout strategy to replace the deployment strategy from the deployment manifest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*wbofmfuN_OwwHBgYTLH3yw.png" /></figure><h3>How does Argo Rollout work?</h3><p>Kubernetes deployment object supports strategies of replacing or rolling updates for the new revision being applied to the application namespace. Rollout’s success depends on the pods’ readiness and liveness probes.</p><p>Argo Rollout works along-with Kubernetes deployment / replica-set and provides further additional strategies of blue-green and canary for rolling out new revisions. Moreover, the success of the rollout steps can be verified and checked by external stimuli along with readiness and liveness probes.</p><p>In addition to blue-green and canary strategies, Rollout spec supports incremental traffic shaping through ingress controllers or changing the number of revision instances to manage risk in deploying new revision. Analysis of the new revision can be either manual or automated with automated rollback on the failure of verification, also called <a href="https://www.opsmx.com/blog/argocd-rollout-just-got-so-much-more-smarter-with-opsmx-autopilot/">Automated verification</a>.</p><p>An Argo rollout works by adding rollout specification to replica-set object spec or replacing deployment object strategy spec with a Rollout strategy spec. When using a replica-set specification, the Rollout manifest specifies the rolling-out strategy. When using a deployment specification, since the rollout strategy replaces the strategy specified by the deployment manifest, the Rollout object uses a reference to the deployment manifest with a replacement Rollout strategy spec. This allows Rollout to use the Deployment spec of the manifest while ignoring the strategy spec from the Deployment manifest and replacing it with the strategy from Rollout spec. The following configuration shows the key strategy for blue-green or canary strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*CRpJIUv7qKW0gDLiqGkUUQ.png" /></figure><h3>When should we use Blue/Green</h3><p>Argo Rollouts with Blue/Green strategy provides options in controlling the rollout steps. At a basic level, Argo Rollout blue/green strategy implements the following steps:</p><ol><li>Bring up replicaset with new revision (optionally specify a smaller number of pods than the active instance)</li><li>After the instances are healthy, optionally update the preview service with the selector to route traffic to the new revision using Rollout-pod-template-hash</li><li>Wait for user input or autoPromotionSeconds to update active service with Rollout-pod-template-hash of new revision and remove selector for old revision. If the number of pods from step 1 is smaller than the active revision, the pod count is updated to match the active pod count before updating the active service selector</li><li>Scale down old revision pods after scaleDownDelaySeconds.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*zDubZwzYLSsexMC4KeM7NA.png" /><figcaption>Blue Green Traffic Routing</figcaption></figure><p>Blue-green takes more resources as there are two revisions running at the same time. If the startup time for the pods is high, then the rollback time when the new revision fails is high. Using a blue/green strategy when startup time is high reduces the rollback time. Additionally, if the rollout needs testing in production without production traffic, then the blue/green strategy allows exposing new revisions to test while allowing production traffic to continue using the existing active revision.</p><p>Additionally, if an application has multiple dependent pods, the deployment may also include dependent component changes. Typically, the revisions are expected to be forward and backward compatible with their interfaces. In this case, using blue/green, one can verify the functionality in production without exposing the production traffic to the new revision.</p><h3>When should we use Canary</h3><p>Canary strategy works by creating new revision pods and routing production traffic to new revision along with the current revision allowing exposure of new revision to partial set of requests for analysis before promoting the new revision to full production. Argo Rollouts support traffic shaping configuration with Istio to allow for changing the number of replicas independent of the traffic routed to the revisions. The diagram below depicts the concept of updating the number of replicas for canary instances. Increasing the number of Canary instances to 3 and reducing the number instance active revision to 0 completes the canary process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*Lgm3Mw2l2O1nxW0gOuAUhg.png" /><figcaption>Canary Deployment with Argo Rollout</figcaption></figure><p>When there is significant traffic in production, a canary can reduce the risk by reducing the blast radius. Canary strategy can be used when there are many pods in production and using blue/green causes significant costs for Rollouts. By sending partial traffic to the new revision, the configuration in production for the new revision can be verified with the production traffic. Once the configuration is verified with a new revision, the rollout can service all the production traffic by scaling up the new revision and scaling down the old revision.</p><p>The older revisions are cleaned based on the revisionHistoryLimit configured in the deployment specification.</p><h3>Conclusion</h3><p>Argo Rollouts provide powerful and progressive deployment strategies that are easy to implement in application rollouts. Lastly, the strategies to support multiple service deployments and dependent service deployments can be addressed with best practices and dependency management strategies.</p><h3><strong>References</strong></h3><ul><li><a href="https://argo-cd.readthedocs.io/">Argo CD - Declarative GitOps CD for Kubernetes</a></li><li><a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-to-kubernetes-using-argo-cd-and-gitops">How to Deploy to Kubernetes using Argo CD and GitOps | DigitalOcean</a></li><li><a href="https://argoproj.github.io/argo-rollouts/">Argo Rollouts - Kubernetes Progressive Delivery Controller</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c018ce7fba0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Control Plane Components]]></title>
            <link>https://medium.com/@harisjafar2000/kubernetes-control-plane-components-45486655baf8?source=rss-a3c809985ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/45486655baf8</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Haris Jafar]]></dc:creator>
            <pubDate>Tue, 25 Oct 2022 18:20:43 GMT</pubDate>
            <atom:updated>2022-10-25T18:20:43.073Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*aRbRWmEpI0VQ3dZUtqrLoA.jpeg" /></figure><h4><strong>The blog will include:</strong></h4><ol><li>Kubernetes Control Plane Architecture and Overview</li><li>Control Plane Components:</li></ol><ul><li>kube-apiserver</li><li>etcd</li><li>kube-scheduler</li><li>kube-control-manager</li></ul><h3><strong>Kubernetes Control Plane Architecture</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*gWxpIUryRvcQ6p0-g5JhWw.png" /><figcaption>Control Plane Architecture</figcaption></figure><p>In a Kubernetes Cluster, there is a set of worker machines called nodes. Each cluser has around 1 or more worker nodes. These nodes host the Pods which are part of the application workload. The Kubernetes Control Plane manages these nodes and pods in its cluster.</p><p>Discussed below are the 4 core components of the Kubernetes Control Plane:</p><h3>Kube-apiserver</h3><p>In essence, the Kubernetes API server is basically the front end of the control plane cluster, which means it is through which users interact with the cluster. It is also through which parts of cluster as well as external components communicate with each other.</p><p>Moreover, all actions are accepted and validated through this server, and it is the only connection to the etcd database. It validates and configures data for api objects(<em> services, pods, replicationcontrollers</em>), and as a result it serves as a master process for the entire cluster. The kube-apiserver also has the ability to separate user-initiated from server-initiated traffic, and is responsible for sending watch events to different components of the cluster.</p><p><strong>Characteristics:</strong></p><p>It is stateless due to the fact that its state is stored in a database which is external to the API server. Apart from that, it can also be replicated(usually 3 times) for fault-tolerance and to manage request load. The kube-apiserver scaled horizontally- which means it can delpoy numerous instances. Through this we can run several instances of kube-apiserver and also balance their traffic.</p><p>Along with that, it is also seen that the API server can be somewhat space consuming. For every request, there is at least one line produced. Hence, its important we add some log rolling to tackle this issue.</p><h3><strong>ETCD</strong></h3><p>ETCD is basically the <strong>brain</strong> of Kubernetes. It is a ‘consistent and highly-available, distributed key value store used as Kubernetes’ backing store for all cluster data’. Any pod you create, any node you create, or any deployment you create, all information gets stored in etcd. It provides a safe way to store data which needs to be accessed/used by a cluster of machines.</p><p>Etcd can be relied upon to be a single point of truth at any given point in time because of features such as:</p><ul><li><strong>Highly Available</strong> — Theres no single point of failure in etcd cluster and can tolerate network partitions and hardware failures too. For example, if your leader node goes down in etcd cluster, now the followers can declare themselves candidate, hold elections based on availability, and then the new node will be the leader making the data unaffected.</li><li><strong>Fully Replicated</strong> — Every node in the etcd cluster can access the data store. This helps greatly as there is no point of failure.</li><li><strong>Secure</strong> — Because etcd handles critical and sensitive data, it is important role-based access controls are used, and that the principle of least privilege is used to avoid unecessary access. It is due to this, that etcd already comes with TLS and SSL authentication to maintain secure channels of data.</li><li><strong>Consistent</strong> — Each and every data read returns its most recent data write across the clusters.</li><li><strong>Fast</strong> — etcd has benchmarked at 10,000 writes per second. However, its performance is tied to your storage disk speed.</li></ul><h3><strong>Kube-scheduler</strong></h3><p>It is the default schedular for Kubernetes and is part of the control plane. So, for every new pod, kube-schedular will select a node for it. Nonetheless, each pod has a set of different requirements than its peers. Therefore, the pre-existing nodes are required to be filtered with certain scheduling requirements.</p><p>The schedular watches for new pods to be created using watch functionality that etcd offers. When it finds one that does not have a nodeName field set it determines where the pod should run, and updates the pod resource in the nodeName field right there to add a value for that field. So, lets see what goes behind the scheduling decisions- there are a number of steps, but the two that are the most important in this context are the <strong>filtering and scoring stages.</strong></p><ul><li>Filtering comes first and this stage filters out any nodes that cannot host the pod for some reason or the other.</li><li>After filtering, comes the scoring stage, where the scheduler is simply finding the best possible fit based on the scoring rules it has. Nodes are scored in cases such as:</li></ul><p>1) A pod prefers a node in a particular zone, but does not require it. So the one in the particular zone could possible end up higher than others. However, other are not ruled out and could potentially score higher based on other factors. This is also called Affinity rule.</p><p>2) Another scoring factor is whether a node already has the container image being used by the pod.</p><p>3) Lower work utilisation can also give a node a higher score.</p><p>After scoring is done, the node with the highest score will be the one pod is tied with.</p><h3><strong>Kube-control-manager</strong></h3><p>Kubernetes controller manager is a daemon that embeds the core control loops shipped with Kubernetes. It is basically a control loop that continuously watches the shared state of your cluster, and incorporates changes wherever deemed necessary- with a goal of moving the current state closer to the desired state. Controllers keep communicating with the api-server which receives all information through Kubelet.</p><p>It is basically a network of 30 controllers. Several of these are responsible for managing the desired state of common resources in a Kubernetes cluster. Theres a namespace controller that watches and manages namespaces. Theres also a service controller that watches and manages Kubernetes services and so on. Each controller has a specific set of concerns that vary according to the resources they manage. Lets look at some of the other common type of controllers:</p><ul><li><strong>Replica Controller</strong> — This is constantly monitoring the status of replica sets and making sure theres a preferred number of pods available. Its job is mainly in scaling number of pods up and down to reach the desired pod number.</li><li><strong>Node Controller</strong> — Its main task is to make sure new nodes are assigned to the cluster if existing get destroyed or become unavailable. If the Node Controller does not get a response from a node in under 40 seconds, it it marked as unreachable. Now once that it done, it waits for another 5 minutes to check if that node comes back up. If it doesn’t come back up in that time then the pods tied to that node are disassociated and assigned to other nodes.</li><li><strong>Deployment Controller</strong> — Deployments are a group of similar pods with no distinctive identities. Here, the Deployment Controller runs various replicas of our application while automatically managing and replacing any instance that is unresponsive or destroyed. This helps in making sure one or more instances of our application are always available to handle user requests. Some of the core functions it manages are:</li></ul><ol><li>Scaling up and down</li><li>Launching new versions of applications with the help of replica sets.</li><li>Managing new group of pods in form of replica sets.</li></ol><ul><li><strong>Job Controller</strong> — Its responsibility comes from ensuring that the kubelets on nodes have a good amount of pods running for it to complete the work assigned. It communicates with the kube-apiserver to destroy or create more Pods while making sure the apiserver isn’t running any Pods by itself. After a job is created, the Job Controller creates Pods to do that work of job. The goal is to push the current state of the job towards its desired completetion.</li></ul><p><strong>REFERENCES</strong></p><ul><li><a href="https://kubernetes.io/docs/concepts/overview/components/">Kubernetes Components</a></li><li><a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/">kube-controller-manager</a></li><li><a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/">kube-apiserver</a></li><li><a href="https://blog.knoldus.com/introduction-to-kube-controller-manager/">Introduction to Kube Controller Manager</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45486655baf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes And Docker : How They Compete And Compliment Each Other]]></title>
            <link>https://medium.com/@harisjafar2000/kubernetes-and-docker-how-they-compete-and-compliment-each-other-15bf3bef5576?source=rss-a3c809985ac5------2</link>
            <guid isPermaLink="false">https://medium.com/p/15bf3bef5576</guid>
            <category><![CDATA[swarm]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-swarm]]></category>
            <dc:creator><![CDATA[Haris Jafar]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 16:25:49 GMT</pubDate>
            <atom:updated>2022-09-17T16:39:04.513Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes And Docker : How They Compete And Complement Each Other</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*CaV1FLvaEzXUowDknO-B9Q.png" /></figure><p><strong>The Blog will go about as follows:</strong></p><ol><li>What is Kubernetes?</li><li>What is Docker?</li><li>What is Docker Swarm?</li><li>Container Orchestration Challenges.</li><li>Kubernetes vs Docker Swarm</li><li>Kubernetes and Docker: Better Together</li></ol><h3><strong>What is Kubernetes?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oSb048WNExPvgnvPah16w.jpeg" /></figure><p>To put it simply, <strong>Kubernetes</strong> is a system responsible for running and coordinating containerised applications across a cluster of machines. In detail, it can be termed as a open-source container orchestration platform designed to completely manage the lifecycle of containerised applications and services, with methods that provide: Predictability, Scalability, and High Availability.</p><p>Kubernetes allows you to manage your applications with high degrees of <em>flexibility, power, and reliability. </em>Now what does this mean? As a Kubernetes user you can dictate how your applications should run, and how they communicate with other applications. You can scale your applications up and down, perform updates, and even switch traffic between application versions.</p><h3><strong>What is Docker?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*Xog9AmgmzZmIChm51L6sGA.jpeg" /></figure><p><strong>Docker</strong> can be described as a software platform for building applications based on containers- small and lightweight execution environments that make shared use of the operating system kernel, but otherwise run in isolation from one another. Furthermore, while use of containers has been there since some time, Docker, an open source project helped popularise the technology by making it easier than ever for developers to package their software to “build once and run anywhere.”</p><h3><strong>What is Docker Swarm?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*4p2q9pGNiULh0c4wzWLcWw.png" /></figure><p><strong>Docker Swarm </strong>is a container orchestration tool, which means that it allows the user to manage multiple containers deployed across multiple host machines. In other words, it is a group of either physical or virtual machines that are running the Docker application and that have been configured to join together in a cluster. Once a group of machines have been clustered together, you can still run the Docker commands that you’re used to, but they will now be carried out by the machines in your cluster. The activities of the cluster are controlled by a swarm manager, and machines that have joined the cluster are referred to as nodes.</p><h3><strong>Container Orchestration Challenges</strong></h3><p>Although <strong>Docker Swarm and Kubernetes</strong> both approach container orchestration a little differently, they face the same challenges such as:</p><ul><li><strong>Container deployment</strong>. In the simplest terms, this means to retrieve a container image from the repository and deploy it on a node. However, an orchestration platform does much more than this: it enables automatic re-creation of failed containers, rolling deployments to avoid downtime for the end-users, as well as managing the entire container lifecycle.</li><li><strong>Scaling</strong>. This is one of the most important tasks an orchestration platform performs. The “scheduler” determines the placement of new containers so compute resources are used most efficiently. Containers can be replicated or deleted on the fly to meet varying end-user traffic.</li><li><strong>Networking</strong>. The containerized services need to find and talk to each other in a secure manner, which isn’t a trivial task given the dynamic nature of containers. In addition, some services, like the front-end, need to be exposed to end-users, and a load balancer is required to distribute traffic across multiple nodes.</li><li><strong>Observability</strong>. An orchestration platform needs to expose data about its internal states and activities in the form of logs, events, metrics, or transaction traces. This is essential for operators to understand the health and behavior of the container infrastructure as well as the applications running in it.</li></ul><h3><strong>Kubernetes vs Docker Swarm</strong></h3><p>Where Kubernetes and the Docker suite intersect is at container orchestration. So when people talk about Kubernetes vs. Docker, what they really mean is Kubernetes vs. Docker Swarm. Both Docker Swarm and Kubernetes are production-grade container orchestration platforms, although they have different strengths.</p><p>For example, Docker Swarm can be referred to as the easiest orchestrator to manage and deploy. It is beneficial for companies getting started with using containers in production. Moreover, Swarm solidly covers 80% of all use cases, with 20% of Kubernetes’ complexity. Swarm runs anywhere Docker does, and is considered easier to troubleshoot than Kubernetes.</p><p>Kubernetes on the other hand, is the orchestration platform of choice for 88% of organizations. Initially developed by Google, it’s now available in many distributions and widely supported by all public cloud vendors. The true essence and power of Kubernetes is in its ability to provide limitless scalability, configurability, and rich technology ecosystem. It is well-suited for complex applications, whereas Docker Swarm is designed for ease of use for simple applications.</p><p>A clear comparison can be seen from the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*M4u2x04RO36FcxCbLiyExg.png" /><figcaption>Kubernetes and Docker Swarm side by side</figcaption></figure><h3><strong>Kubernetes and Docker: Better Together</strong></h3><p>Simply put, the Docker suite and Kubernetes are technologies with different scopes. You can use Docker without Kubernetes and vice versa, however they work well together.</p><p>From the perspective of a software development cycle, Docker’s playing field is development. This includes configuring, building, and distributing containers using CI/CD pipelines and DockerHub as an image registry. On the other hand, Kubernetes’ home turf is operations, allowing you to use your existing Docker containers while tackling the complexities of deployment, networking, scaling, and monitoring.</p><p>Hope you had a great read!</p><p><strong>References</strong></p><ul><li><a href="https://www.atlassian.com/microservices/microservices-architecture/kubernetes-vs-docker">Kubernetes vs. Docker | Atlassian</a></li><li><a href="https://kubernetes.io/docs/home/">Kubernetes Documentation</a></li><li><a href="https://www.simplilearn.com/tutorials/docker-tutorial/docker-swarm">What is Docker Swarm: Modes, Example and Working [Updated]</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15bf3bef5576" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>