<?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[Tailwinds-MajorDomo - Medium]]></title>
        <description><![CDATA[Simplify DevOps Dramatically - Medium]]></description>
        <link>https://medium.com/tailwinds-navigator?source=rss----ceb98fe73a70---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Tailwinds-MajorDomo - Medium</title>
            <link>https://medium.com/tailwinds-navigator?source=rss----ceb98fe73a70---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:39:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/tailwinds-navigator" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes Tip: Choose EKS or Fargate or ECS Based On Business Need.]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-choose-eks-or-fargate-or-ecs-based-on-business-need-246ec39ffe45?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/246ec39ffe45</guid>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Tue, 02 Nov 2021 01:07:01 GMT</pubDate>
            <atom:updated>2021-11-02T01:06:07.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rOxq3cGonG_HBh1V" /><figcaption><strong>What is your way?</strong></figcaption></figure><p>Recently, I was reading an awesome article comparing EKS, Fargate, and ECS. Here is the link to the article.</p><p><a href="https://cloudify.co/blog/aws-eks-vs-ecs-vs-fargate/">AWS EKS vs. ECS vs. Fargate | The Breakdown</a></p><p>At <strong>Tailwinds</strong>, we have been constantly asked this question by our customers about the choice of orchestration tool. We handle this discussion in a different way, Hence, thought to share our perspectives.</p><h4>Vectors of comparison.</h4><p>The article considers 3 different vectors to arrive at a conclusion, they are</p><blockquote>Features.</blockquote><blockquote>Cost Analysis.</blockquote><blockquote>To lesser extent, skill set of the person/team.</blockquote><p>These are important aspects but would like to additionally add one more vector that&#39;s the business need of the organization. Some of the business needs may have already blended in the above vectors but calling them out explicitly would make things clear.</p><h4>Plan Features Based On Business Requirements.</h4><p>One of the key aspects is to ask the right business questions to arrive at the feature sets. Here are a few questions we typically ask our customers.</p><blockquote><em>How many services do you have? How much do you expect to scale the next 2–4 quaters?</em></blockquote><blockquote><em>Does your business need multi-cloud support or expect it in future?. Discussions around, HA, Backup aspects as well.</em></blockquote><blockquote><em>What are your NFR requirements?. For more details on NFR, check out this blog.</em></blockquote><blockquote><a href="https://medium.com/tailwinds-navigator/kubernetes-rant-why-devops-sres-need-to-empower-themselves-with-application-knowledge-7f937137b005">https://medium.com/tailwinds-navigator/kubernetes-rant-why-devops-sres-need-to-empower-themselves-with-application-knowledge-7f937137b005</a></blockquote><blockquote><em>What are the business constraints do you have?.</em></blockquote><blockquote>What are the security needs of the business?</blockquote><p>Once you gather these business requirements, arrive at the features needed &amp; map them to the features provided by these orchestration systems for deciding which one to choose.</p><h4>Cost Is After Thought.</h4><p>We see this time and again that the Availability and Reliability of the services are paramount and cost optimization comes only after the former is handled better. This does not mean that the organizations are completely blinded to the cost but would like to have clarity on spending patterns for planning and future optimization purpose.</p><p>In general, there are 2 aspects to the cost. They are CAPEX and OPEX costs.</p><p>CAPEX involves the cost of instances, tools, dbs etc which can be quantified to some extent while OPEX is pretty tricky and hard to quantify. Following are a few questions we ask our questions. One may or may not have the answer to all these questions but better to think about it.</p><blockquote>How much time will you spend to production grade environment for a given orchestration system?. With Kubernetes, would take somewhere between 3–5 months if the team is new to Kubernetes.</blockquote><blockquote>How much time do you spend on daily Toil? &amp; What would be MTTR for a given orchestration system?. When there is a production issue, how quickly can you isolate the problem?. Would add, how much documenation exists out in the internet.</blockquote><blockquote>How easy or difficult to get those skills sets in the market?. I know customers moved from ECS to Kubernetes simply because it was hard to find engineers with ECS experience than Kubernetes experience. As weird as it may sound.</blockquote><h4>Other Business Aspects To Consider.</h4><p>Apart from Features and Cost vectors, other aspects you should consider are</p><blockquote>What is your immediate and short term goals?. If you are startup and trying to prove your MVP, then going with Fargate would be better as you don’t have to worry about orchestration system but just deal with functionality.</blockquote><blockquote>If you organization is paranoid about every aspect of security, would refer Fargate simply because it is hard to hire smart security engineers and keep them intact. Also, i don’t believe, organization can recurit security engineers like what cloud guys can do.</blockquote><blockquote>How vibrant is the community?. If the community is vibrant then community would come together to quickly solve a given problem. Kubernetes is an example of this vibrant community.</blockquote><h4>Conclusion.</h4><p>We have shared a few questions that we typically ask our customers before arriving at the choice of orchestration system.</p><p>We do understand that it may be hard to get answers to all these in the early stage but most choose an orchestration system based on a few parameters such as multi-cloud, MVP, complexity, etc, and iterate over the period of time. We believe this approach is fairly okay.</p><p>Finally, to rest our case. Choose an orchestration system based on business needs not purely on technology needs.</p><h3>At Tailwinds, we help customers in designing the right strategy on DevOps, Microservices, CloudNative &amp; Kubernetes. If you like to discuss more, reach us at info@tailwinds.ai.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=246ec39ffe45" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-choose-eks-or-fargate-or-ecs-based-on-business-need-246ec39ffe45">Kubernetes Tip: Choose EKS or Fargate or ECS Based On Business Need.</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: Is CI/CD Really Popular?.]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-is-ci-cd-really-popular-83887e1737e0?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/83887e1737e0</guid>
            <category><![CDATA[kubernetes-tip]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Mon, 25 Oct 2021 03:01:48 GMT</pubDate>
            <atom:updated>2021-10-25T03:01:21.272Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2Nt6Su9AuQNMy96b" /></figure><p>I was reading a post, where someone posted this question. I wanted to check with Tailwinds customers if they really perform CI/CD. Some really interesting answers that I would like to share here.</p><p>But before getting onto the details, few definitions and disclaimers.</p><p><em>I don’t really want to get into the discussion of the agile vs waterfall model. IMO, organizations follow a process that they believe is right for them based on their business needs and the culture of the organization.</em></p><p><em>These days, organizations typically plan a sprint for 4 weeks (have observed 2 weeks as well in a few cases). Each sprint has many stories, and each story has many tasks.</em></p><p><em>Strictly speaking, CI/CD means, when the developer checks in the code, it automatically gets integrated into the repository and gets’s deployed into production seamlessly.</em></p><h4>Deployment Spectrum.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2kJpGt_T_JRZjtOZPfX8A.png" /><figcaption><strong>Figure-1:</strong> Deployment Spectrum.</figcaption></figure><p>As Figure-1 says it all, there are two ends of the deployment spectrum, they are task-based and Sprint based. There are many shades between these two such as story-based etc.</p><p><strong>Note:</strong> Hot-Fixes are exceptions, where they are deployed immediately and don’t conform to deployment pattern.</p><h4>Sprint-Based Deployment.</h4><p>In this kind of model, deployment to production occurs at the end of the sprint cycle. If the sprint has many stories, All these stories end up in production at one shot.</p><p>From what we have known, many large organizations follow this process where their typical sprint cycle has been 4 weeks. There are pros &amp; cons to this approach but most businesses choose the model from a purely business and cultural perspective.</p><p>In a sprint-based approach, customers deploy once every 4 weeks or end of their sprint cycle. So, strictly speaking, I would not classify them as CI/CD in real terms but in a very tightly controlled environment.</p><h4>Story-Based Deployment.</h4><p>In this model, deployment to production is based on a story. A story is typically a feature. Once the story is completed, it ends up in production. A story has many tasks associated with it. The task includes development, testing, integration tasks, etc.</p><p>Given that it is story-based, one story does not block the other. Therefore, as and when a story is completed, it gets deployed to production.</p><p>In a story-based approach, customers tend to deploy a few times a week. Again, would not classify them as a typical CI/CD but this model is closer to CI/CD and less controlled when compared to the sprint-based approach.</p><h4>Task-Based Deployment.</h4><p>In this model, deployment to production occurs when a task is completed. Most times the testing is done in the production itself.</p><p>These types of organizations are culturally very different and have great confidence in their engineers and make sure the speed of innovation is not hampered due to slowness of deployment. Additionally, the organizations set guardrails in form of SLOs to make sure someone does not break them often with an eye on the reliability of the system.</p><p>Customers typically deploy a few times a day in a task-based model. This I would classify as real CI/CD.</p><h4>Conclusion.</h4><p>IMO, If one deploys a task-based approach that&#39;s when one is doing real CI/CD but should be noted that CI/CD need not be the best and right model for one’s organization, the kind of deployment model purely depends on the business needs and culture of the organization.</p><p>There is always a healthy tension between innovation vs reliability. If the frequency of deployment is high, the speed of innovation is possibly high but there is a question on reliability and vice-versa is also true. Organizations will have to find the right balance between these two vectors using methods like SLO etc.</p><p>Most Tailwinds customers&#39; do a story-based deployment. What does your organization follow?. Leave a comment below.</p><h4>At Tailwinds, we help customers in designing the right strategy on DevOps &amp; Kubernetes and help customers in setting the right SLOs. If you like to discuss more, reach us at info@tailwinds.ai.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83887e1737e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-is-ci-cd-really-popular-83887e1737e0">Kubernetes Tip: Is CI/CD Really Popular?.</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Rant: Why DevOps/SREs Need To Empower Themselves With Application Knowledge?.]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-rant-why-devops-sres-need-to-empower-themselves-with-application-knowledge-7f937137b005?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/7f937137b005</guid>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Mon, 18 Oct 2021 05:25:06 GMT</pubDate>
            <atom:updated>2021-10-18T04:45:30.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GJYTlk_mwm4__mPxYfvWQ.jpeg" /><figcaption><strong>Empower Yourself.</strong></figcaption></figure><p>This <strong><em>RANT</em></strong> is based on <a href="http://www.tailwinds.ai/">tailwinds.ai</a> interactions with SREs/DevOps teams across different organizations. Few common trends we notice are</p><p><strong><em>DevOps/SREs are either part of one team or folded towards a single hierarchy. So would have used DevOps &amp; SREs interchangeably in this blog.</em></strong></p><p><strong><em>DevOps/SREs typically tend to be passive and allow application teams to override them on many deployment design choices.</em></strong></p><p>In this blog post, I would like to make a case as to why SREs need to empower themselves with knowledge of applications for running the infrastructure better.</p><p>Before getting on to the crux, would like to get into few definitions.</p><h4>Functional vs Non-Functional Aspects.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*wiqFks6p7S8pC-bkOjHxHQ.png" /><figcaption><strong>Figure-1: Functional vs Non-Functional Requirements.</strong></figcaption></figure><p>As the picture says it all, Functional aspects focus on features, business logic workflows, etc while non-functional aspects are system attributes such as security, reliability, performance, maintainability, and scalability, etc.</p><p>Not only that, both are interconnected entities as shown in the picture Figure-2 below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5DBdr9rDpCdiDOUnpcAJQ.png" /><figcaption><strong>Figure-2: How Functional and Non-Functional aspects are interconnected?.</strong></figcaption></figure><h4>Software Architects vs Deployment Architects.</h4><p>Software architects are those who are concerned about functional requirements while deployment architects are also called Devops/SREs who worry about non-functional aspects of the application.</p><p>In many small organizations or small teams in large organizations, both roles are typically played by a single architect.</p><h4>Architects In Olden Days.</h4><p>In the good olden days, there were no SREs but only software architects who pretty much did everything so took care of both functional and non-functional requirements.</p><p>For example, the architect’s job is to understand the requirements, make sure to come up with the right design that is scalable &amp; extensible, automate the requirements, keep eye on security, plan for failures among many other aspects. In short, a software architect had to understand both functional and non-functional aspects while designing the application.</p><p>This model was fine as the applications consumed all the functional and non-functional aspects and while not many innovations were happening in underlying infrastructure from the application deployment perspective.</p><p>While there were no SREs but then there were compute, network &amp; storage administrators, whose primary job was to set up the infrastructure and make sure they are up and running all the time.</p><h4>Fast Forward Today.</h4><p>Many innovations are happening on both the software and deployment side.</p><p>Applications are becoming more and more distributed by breaking into smaller components called services. These services are laser focussed on the features and business logic otherwise called functional aspects while platforms like Kubernetes provide tools for many non-functional aspects such as availability, scaling, logging, monitoring, security, blue-green deployments, etc.</p><p>What we observe in many organizations is that the software architects who focus on functional aspects miss out on innovations happening on Kubernetes&#39; side of the story. Therefore, continue to have non-functional bits in the application making it heavyweight, bulky, etc.</p><p>Add hiring difficulties around SREs in the mix or sometimes organizations don’t see a need for experienced SREs, software architects make deployment decisions leading to inefficiency and missing out on many key aspects.</p><h4>Conclusion.</h4><p>SREs are responsible for the non-functional requirements of the application. So they will have to equip themselves to understand the application from the perspective of scaling, reliability, security, resources consumption, etc.</p><p>SREs will have to get involved in the design decisions of applications as non-functional requirements leads to functional aspects as per <strong>Figure-2</strong>.</p><p>Also, SREs will have to be a lot more assertive given that platform(Kubernetes) and non-functional requirements are their responsibility.</p><p>Here are few pointers to get started on understanding the application.</p><p><strong><em>What type of workload it is?</em></strong></p><p><strong><em>What are the components of workloads and how do these components interact with each other?</em></strong></p><p><strong><em>What are the reliability and availability requirements?. Basically scaling, HA, performance aspects, etc.</em></strong></p><p><strong><em>What are the resource requirements for the workload?</em></strong></p><p><strong><em>How to secure them?</em></strong></p><h4>At <strong>Tailwinds</strong>, we help customers in designing the infrastructure by considering various characteristics of the application to arrive at the right components, sizing, scaling, performance, etc. If you like to discuss more, reach us at info@tailwinds.ai.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f937137b005" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-rant-why-devops-sres-need-to-empower-themselves-with-application-knowledge-7f937137b005">Kubernetes Rant: Why DevOps/SREs Need To Empower Themselves With Application Knowledge?.</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Rant: Do Autoscalers make Business sense?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-rant-do-autoscalers-make-business-sense-40ace3e1e98b?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/40ace3e1e98b</guid>
            <category><![CDATA[autoscaling]]></category>
            <category><![CDATA[kubernetes-rant]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Wed, 02 Jun 2021 11:59:55 GMT</pubDate>
            <atom:updated>2021-06-02T11:58:08.450Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, <a href="https://www.linkedin.com/in/danielepolencic/">Daniel Polencic</a> posted a lovely article on <a href="https://learnk8s.io/kubernetes-autoscaling-strategies">Autoscalers</a>, this triggered some thoughts, hence writing this quick short note as a response to Daniel’s article.</p><h4>Need For Autoscalers.</h4><p>We observe that autoscalers are typically needed for a couple of use cases, they are</p><ol><li>In a highly dynamic environment where there is a large difference between peak vs average utilization (mostly driven by traffic) then one would provision resources for average utilization and make the infrastructure elastic for peak utilization. It should be observed that the peak occurs once in a while but not way too often otherwise avg utilization would be close to peak utilization. In such cases, we tend to use a combination of Pod Autoscaler &amp; Cluster Autoscaler for handling the elasticity.</li><li>In a relatively static environment where there is not much difference between peak vs avg utilization or when new services/new teams/transient services get onboarded, makes a strong case for Cluster Autoscaler but the lesser need for Pod Autoscaler unless there is shared resources.</li></ol><h4>Decision Factors For Cluster Autoscaler.</h4><p>In a dynamic environment, one has to answer the two key questions before deciding on cluster autoscaler</p><ol><li>How often does the peak occur?. once every day, once every week or once every month?.</li><li>What’s the SLO for Availability?</li></ol><p>There is a mismatch when businesses provide five 9’s to their customers while infrastructure relies on cluster autoscaler to handle peaks even once a month. The math is</p><ol><li>Five 9’s can have only 5.26 mins of downtime per year. Source <a href="https://en.wikipedia.org/wiki/High_availability">Wiki</a>.</li><li>Assuming 25% impact to number of request, 7 * 12 * 25 / 100 = 21 mins of downtime per year. If you see peaks once daily then 30 * 21 = 630 mins of downtime per year.</li></ol><p>IMO, Cluster Autoscaler makes sense where the environments are relatively controlled and in environments where there is no big business impact such as DEV/TEST etc.</p><h4>Decision Factors For Pod Autoscaler.</h4><p>Pod Autoscaler assumes that there are sufficient resources available for the pod to scale horizontally. The questions to answer are</p><ol><li>When load peaks, does all services or only a set of services scale?</li><li>If only a set of services scale, does it already have sufficient provisioned resources?</li></ol><p>To answer these questions, one needs to understand the application, its architecture, and its bottlenecks in the system. Therefore, one size(solution) may not fit all.</p><h4>Conclusion.</h4><p>Autoscalers have their use but it’s a much harder problem than it appears to be. It involves understanding a bit of business, architecture, and cost aspects to arrive at what is best for the organization rather than jumping on the bandwagon. Thanks to <a href="https://www.linkedin.com/in/danielepolencic/">Daniel Polenci</a> for triggering this post.</p><p>As always, I would love to hear your thoughts &amp; feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40ace3e1e98b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-rant-do-autoscalers-make-business-sense-40ace3e1e98b">Kubernetes Rant: Do Autoscalers make Business sense?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: How To Disambiguate A Pod Crash To Application Or To Kubernetes Platform?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-how-to-disambiguate-a-pod-crash-to-application-or-to-kubernetes-platform-f6c1395a8d09?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/f6c1395a8d09</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-engine]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes-tip]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Tue, 22 Sep 2020 15:31:13 GMT</pubDate>
            <atom:updated>2020-09-22T15:30:54.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I was debugging two completely different Pod crash scenarios. In the first case, the Pod got into <strong>CrashLoopBackOff</strong> almost immediately after it got created while in another case the pod was <strong>killed randomly </strong>after running for a few days<strong>.</strong></p><p>I spent about an hour to determine the root cause of these crashes. For the first case was able to isolate the problem to the application while the fix for the second crash was in the Kubernetes platform. So, the ownership of the fix was with different teams for these crashes.</p><p>This situation got me into thinking as to how quickly can one isolate Pod crashes if not fix it so as to assign to the right team for reduced turnaround time. In other words, was looking for a method/procedure for reduced <strong>MTTR</strong> (Mean Time To Resolution) in Pod crash scenarios.</p><p>Let us consider simple examples to isolate the Pod crash scenarios.</p><h4>Application Related Pod Crash.</h4><p>In this simple example, Application related Pod failure is created having an <strong>invalid argument variable</strong> in the YAML file. The YAML file looks as in <strong>Figure-1</strong>. It should be noticed that the argument field has invalid command <strong>/<em>bin/eho</em></strong> instead of <strong><em>/bin/echo</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6Jph8AkY8rbog61Quj_mQ.png" /><figcaption><strong>Figure-1:</strong> YAML Having Incorrect CMD.</figcaption></figure><p>Let’s apply this YAML as in <strong>Figure-2</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wW6pnTl5lTezNwgk605qtg.png" /><figcaption><strong>Figure-2:</strong> Pod in CrashLoopBackOff State.</figcaption></figure><p>Let’s get the <strong>exit code</strong> of the container as shown in Figure-3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5dhRqUYF5A5fBp4PvSsfTw.png" /><figcaption><strong>Figure-3:</strong> Exit Code Of The Container Is 127.</figcaption></figure><h4>What does Exit Codes Of Container Mean?</h4><p>Exit codes are numbers that represent how the container exited when executed last time. These are similar to process exit codes.</p><p>In my case, the container runtime is docker and the exit code noticed here are docker’s exit codes. <strong>Reference-1</strong> provides a list of docker exit codes. For 127, says the following</p><blockquote><strong><em>Docker Exit Code: 127.</em></strong> if the <strong><em>contained command</em></strong> cannot be found</blockquote><p>How cool!!. Now I know the problem is related to command in the YAML file or something inside the application and not a problem the Kubernetes platform. So, I can shove it to the application team to fix the issue.</p><p>Let’s consider another example where the problem is related to the Kubernetes Platform.</p><h4>Kubernetes Related Pod Crash.</h4><p>In this example, Kubernetes related Pod failure is created for a normal pod. The YAML for the Pod is as in <strong>Figure-4</strong>. <strong>Figure-5</strong> shows that&#39;s the Pod is running normally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*po1gmNqPG7WaXQCsbyZcNg.png" /><figcaption><strong>Figure-4:</strong> YAML of Pod</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_BNWNNpSQmBqelAoFAFfg.png" /><figcaption><strong>Figure-5:</strong> Demo Pod Running Normally.</figcaption></figure><p>I ssh’ed into the node where the Pod runs and did a docker kill for the pod-demo and looked at the exit code as in <strong>Figure-6</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wVuARdTvRHyDPyl10Bx-rw.png" /><figcaption><strong>Figure-6:</strong> Exit Code Of Container Is 137.</figcaption></figure><p>According to <strong>Reference-2</strong>,</p><blockquote>Docker Exit Code: 137, Container received SIGKILL where SIGKILL could be due to OOMKill or random kill.</blockquote><p>This is awesome. Now I know that the container received is SIGKILL that could be due to OOMKilled, Eviction or accidentally killed by a user. Now, problem isolation can start from the Kubernetes platform instead of the application.</p><h4>The Fun Part.</h4><p>What does the exit code look like when the Pod completes normally?. <strong>Figure-7</strong> captures this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StgkAV9bHu0SqcVtv7tQcQ.png" /><figcaption><strong>Figure-7:</strong> Fun Pod Having Exit Code As 0</figcaption></figure><p>What does docker exit code 0 mean?</p><p>According to <strong>Reference-3</strong></p><blockquote>Exit Code 0 does not mean something is actually bad but the container does have any foreground process attached to it. This occurs normally when docker container has completed its’ job.</blockquote><h4>Recommendation.</h4><p>The rule of thumb is to look at the exit code when the Pod crashes. Based on the exit code would disambiguate the problem to either the application or the Kubernetes platform using the following rules.</p><blockquote><strong>Exit Code 1 &amp; 2:</strong> These errors are due to the application. Would start the RCA from the appliaction.</blockquote><blockquote>Exit Code 126 &amp; 127: Would start looking at dockerfiles, yaml files and possiblity application.</blockquote><blockquote>Exit Code 128 &amp; above: Would start debugging from Kubernetes Platform perspective and go up the stack.</blockquote><h4>References.</h4><p><strong>Reference-1:</strong> <a href="https://docs.docker.com/engine/reference/run/#exit-status">https://docs.docker.com/engine/reference/run/#exit-status</a></p><p><strong>Reference-2:</strong> <a href="https://stackoverflow.com/questions/43803610/where-to-find-more-explicit-errors-given-container-error-status-codes">https://stackoverflow.com/questions/43803610/where-to-find-more-explicit-errors-given-container-error-status-codes</a></p><p><strong>Reference-3:</strong> <a href="https://medium.com/better-programming/understanding-docker-container-exit-codes-5ee79a1d58f6">https://medium.com/better-programming/understanding-docker-container-exit-codes-5ee79a1d58f6</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6c1395a8d09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-how-to-disambiguate-a-pod-crash-to-application-or-to-kubernetes-platform-f6c1395a8d09">Kubernetes Tip: How To Disambiguate A Pod Crash To Application Or To Kubernetes Platform?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: How Does OOMKilled Work?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-how-does-oomkilled-work-ba71b135993b?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/ba71b135993b</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-tip]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Tue, 01 Sep 2020 15:55:35 GMT</pubDate>
            <atom:updated>2020-09-01T16:00:59.155Z</atom:updated>
            <content:encoded><![CDATA[<p>Most Kubernetes users would have encountered OOMKilled at least once. When OOMKilled occurs, we tend to recalibrate the pod’s QoS or move the pod to a different node thinking there is a memory issue with the node. In this Kubernetes Tip, we will dig deep into an interesting aspect of OOMKilled that would help us to configure Pod QoS better.</p><h4>It’s All About Linux’s OOM Killer Kernel Process.</h4><p>I originally thought OOMKilled was something part of Kubernetes but realized it actually more related to the Linux Kernal process called <strong>OOM Killer</strong>. This process continuously monitors the node memory to determine memory exhaustion. If OOM Killer detects such exhaustion, will choose to kill the best process(es). The best processes are chosen by keeping the following in mind.</p><blockquote>Kill least number of processes to minimize the damage in terms of stability &amp; importance of the system.</blockquote><blockquote>Killing those processes should fetch maximum freed memory for the node.</blockquote><p>To facilitate this, the kernel maintains <strong>oom_score</strong> for each process. The higher the value of <strong>oom_score</strong> the bigger the chances of that process getting killed by OOM Killer. The kernel also provides flexibility for the user process to adjust <strong>oom_score</strong> using <strong>oom_score_adj</strong> value.</p><h4>Kubernetes Configures oom_score_adj.</h4><p>Kubernetes takes advantage of <strong>oom_score_adj</strong> by configuring different values for the different quality of service. The value configured are as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OaHBeDoe7yELg7ILQPqVA.png" /><figcaption><strong>Source: Kubernetes Documentation.</strong></figcaption></figure><p>It can be inferred that BestEffort Pods gets booted out first while Guaranteed Pods gets booted out last when there is memory exhaustion on the node.</p><h4>Let’s Look At OOM_SCORE Of Pods With Examples.</h4><p><strong>Figure-1</strong> considers an example where two pods are running one is configured with <strong>QoS Guaranteed</strong> while the other one is configured with <strong>QoS BestEffort</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUQK_VtI0QjqIBN7PqPhiw.png" /><figcaption><strong>Figure-1: Two Pods Having Different QoS Configured.</strong></figcaption></figure><p>Let’s look at the oom_score &amp; oom_score_adj by getting into the pod. <strong>Figure-2 </strong>captures the steps. The BestEffort pod has a high oom_score while the Guaranteed pod has a very low oom_score. So, the BestEffort pod gets killed by the OOM Killer process when memory exhaustion occurs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrOke23ctjk83I8HE1qx3w.png" /><figcaption><strong>Figure-2: Both Pods Have Different Scores Depending On QoS Configured.</strong></figcaption></figure><p>It should be noted that the pod that gets killed does not get evicted but restarted by the node’s kubelet if the restart policy is set to Always.</p><h4>References.</h4><ul><li><a href="https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#node-oom-behavior">Configure Out of Resource Handling</a></li><li><a href="https://lwn.net/Articles/391222/">Another OOM killer rewrite</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba71b135993b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-how-does-oomkilled-work-ba71b135993b">Kubernetes Tip: How Does OOMKilled Work?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: How Statefulsets Behave Differently Than Deployments When Node Fails?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-how-statefulsets-behave-differently-than-deployments-when-node-fails-d29e36bca7d5?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/d29e36bca7d5</guid>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes-tip]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Tue, 25 Aug 2020 14:45:26 GMT</pubDate>
            <atom:updated>2020-08-26T03:24:02.629Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes is a platform that one needs to morph to make it work. As part of personalizing effort, having a strategy to handle node failure cases becomes an important criterion. To implement such a blueprint, one needs to understand how different controllers behave when a node fails. In this blog post, we look at how Stateful Sets behave differently than Deployment Sets when node failure occurs.</p><h4>Recap On How Kubernetes Treats Deployment Sets When Node Fails?.</h4><p>We have discussed this in detail in <a href="https://medium.com/tailwinds-navigator/kubernetes-tip-what-happens-to-pods-running-on-node-that-become-unreachable-3d409f734e5d"><strong>this</strong></a> blog post but the summary is, When a node fails, the Deployment controller terminates pods running that node and creates a new set of replicas to be scheduled on available nodes.</p><p>Here is the flow chart for how Deployment works when a node fails?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*-OcgsgdBzLks14YeM2-HKw.jpeg" /><figcaption><strong>Deployment Set Behaviour When Node Fails.</strong></figcaption></figure><p>Let’s understand the behavior of Statefulsets for node failures with an example.</p><h4>Example Cluster Having StatefulSets.</h4><p>The example Kind cluster is created having one master node and 3 worker nodes. An Nginx Stateful Set is created having 2 replicas. These replicas run on different nodes; kind-worker &amp; kind-worker2. <strong>Figure-1</strong> captures the state of the example kind cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r6VP6Z27UqVIxv1nIwVgXw.png" /><figcaption><strong>Figure-1: Example Cluster.</strong></figcaption></figure><h4><strong>Create Node Failure Scenario.</strong></h4><p>A simple way is to create a node failure scenario is to delete the kind-worker2. <strong>Figure-2</strong> provides the required steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvrY7BBJLmRZVJPrnUd7qw.png" /><figcaption><strong>Figure-2: Captures Steps To Create Node Failure.</strong></figcaption></figure><h4>How The Kubernetes System Behave?.</h4><p>The worker node(kind-worker2) is set to <strong>NotReady</strong> state immediately but the pod continuous to run. The system waits for <strong>pod-eviction-timeout</strong> interval (5 mins is the default value) before setting the pod to <strong>Terminating</strong> state.</p><p><strong>To our surprise</strong>, new pods are <strong>not</strong> created for the Statefulsets while in a similar scenario news replicas were spun up for deployment sets. <strong>Figure-3</strong> captures the state of the Kubernetes cluster after a node failure in case of Statefulsets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXuiPFGaARSdTOufe8hVOg.png" /><figcaption><strong>Figure-3: State Of Nginx Stateful Set After Node Failure.</strong></figcaption></figure><h4>Why A New Replica Is Not Spun Up?.</h4><p>According to the <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/pod-safety.md">Pod-Safety</a> document, for clustered software in the Kubernetes, the system provides a guarantee of running <strong>at</strong> <strong>most one pet</strong> at any point in time. This rule is applicable to Statefulsets as replica are treated as pets while this does not apply for Deployment as replica are treated like cattle.</p><p>The fundamental reason for having <strong>at most one pet</strong> is because the Statefulsets are mostly used for clustered applications that have their own ways of electing master and slaves. In a node failure scenario, The master does not have enough information to ascertain if the node is actually failed or failure is due to a network partition. Therefore, the master refrains from taking any action thereby leading to more problems. The master takes a practical approach by having just one instance less but works in a reliable way.</p><p>How does one recover from this dangling state?</p><h4>Recommendation.</h4><p>There are a few ways one could handle this scenario. They are</p><p>Set <strong>terminationGracePeriodSeconds</strong> to 0 on pods spec. This will ensure that statefulset pods will be deleted forcefully when the node rejoins the cluster. By doing so, Kubernetes master knows that pod safety guarantee is maintained, so will spin up a new replica. The downside is obviously that pod shutdown is not graceful.</p><p>Have an automated way to detect node failures and delete those nodes forcefully if you know for sure the node is actually failed or removed. This will ensure statefulset pods to be respun on available nodes.</p><h4>References.</h4><p>Pod Safety: <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/pod-safety.md">https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/pod-safety.md</a></p><p>Statefulset Design Considerations: <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/apps/stateful-apps.md">https://github.com/kubernetes/community/blob/master/contributors/design-proposals/apps/stateful-apps.md</a></p><p>Discussions In Kubernetes Github On This Issue: <a href="https://github.com/kubernetes/kubernetes/issues/74947">https://github.com/kubernetes/kubernetes/issues/74947</a> <a href="https://github.com/kubernetes/kubernetes/issues/54368">https://github.com/kubernetes/kubernetes/issues/54368</a></p><p><strong>P.S:</strong> Thanks To <a href="https://medium.com/@r.aaron.johnson"><strong>Aaron</strong></a> For Suggesting To Write This Post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d29e36bca7d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-how-statefulsets-behave-differently-than-deployments-when-node-fails-d29e36bca7d5">Kubernetes Tip: How Statefulsets Behave Differently Than Deployments When Node Fails?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: How To Make Kubernetes React Faster When Nodes Fail?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-how-to-make-kubernetes-react-faster-when-nodes-fail-1e248e184890?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/1e248e184890</guid>
            <category><![CDATA[kubernetes-engine]]></category>
            <category><![CDATA[kubernetes-tip]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Tue, 18 Aug 2020 11:02:37 GMT</pubDate>
            <atom:updated>2020-08-18T09:36:26.321Z</atom:updated>
            <content:encoded><![CDATA[<p>We understand <a href="https://medium.com/tailwinds-navigator/kubernetes-tip-what-happens-to-pods-running-on-node-that-become-unreachable-3d409f734e5d"><strong>What happens to pods when nodes fail</strong></a><strong>? </strong>but would also want the Kubernetes system to react faster when nodes fail to make the system robust in terms of availability and reliability.</p><p>Let’s understand the flow of events and learn about related timers before tweaking them.</p><h4>Events Observed When Node Becomes Unhealthy.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*pvHnrsuXuGrOGrjq_OrKAA.jpeg" /></figure><h4>Derived Retry Parameter.</h4><p><strong>node-status-update-frequency </strong>is a kubelet configuration<strong> </strong>while <strong>node-monitor-grace-period </strong>is a controller manager configuration. Combination of both works as a retry parameter. If you want the node to try N times before declaring a node unhealthy, set the following.</p><p><strong>node-monitor-grace-period = (N — 1) * node-status-update-frequency.</strong></p><p>The default values are set in such a way that the node’s kubelet tries 5 times before declaring a node as unhealthy.</p><h4>Other Parameters.</h4><p><strong>pod-eviction-timeout </strong>is a controller manager configuration that acts as a grace period for deleting pods from nodes. By default, set to 5 mins, probably too high a value.</p><p><strong>node-monitor-period</strong> is also a controller manager configuration that wakes up controller manager to check the status of nodes. For the system to work deterministically, this parameter needs to be both less than and multiple of <strong>node-monitor-grace-period.</strong></p><h4>Failure and Recovery Time.</h4><p>After a node fails, the Kubernetes system takes a total of <strong>node-monitor-grace-period</strong> <strong>+</strong> <strong>pod-eviction-timeout</strong> to get back to steady-state. It’s 5 minutes and 40 seconds for the default values.</p><p>In those 5 minutes and 40 seconds, the amount and kind of failures depend on the availability of the pod on the unhealthy node. If the pod is down, there will be no response for requests directed towards those pods otherwise, the pod would keep servicing its clients without problems.</p><p>One could modify these parameters to following for the Kubernetes system to react faster to failures. These numbers would reduce the reaction time from 5 mins 40 secs to 36 secs.</p><p>kubelet’s: <strong><em>node-status-update-frequency</em></strong><em>=4s (from 10secs)</em></p><p><em>controller-manager: </em><strong><em>node-monitor-period</em></strong><em>=4s (from 5secs)</em></p><p><em>controller-manager: </em><strong><em>node-monitor-grace-period</em></strong><em>=16s (from 40secs)</em></p><p><em>controller-manager: </em><strong><em>pod-eviction-timeout</em></strong><em>=20s (from 5mins)</em></p><h4>Can we modify these on Managed Services?</h4><p>Azure’s AKS provides <a href="https://github.com/Azure/aks-engine/blob/master/docs/topics/clusterdefinitions.md#controllermanagerconfig">hooks</a> to modify few controller manager parameters while I did not find any ways to change these on Google’s GKE or Amazon’s EKS. If you know any WRT GKE &amp; EKS, pls leave a comment.</p><h4>Recommendation.</h4><p>It may be quite tempting to lower the values of discussed parameters for the Kubernetes system to react faster but may end having a cascading effect when many nodes having many pods start failing at the same time. Tailwinds recommend to define error budgets based on SLOs and rework backward to arrive at a likely time for the system to detect and react to pod failure.</p><p><strong>P.S:</strong> Thanks To <a href="https://medium.com/@r.aaron.johnson"><strong>Aaron</strong></a> For Suggesting To Write This Post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e248e184890" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-how-to-make-kubernetes-react-faster-when-nodes-fail-1e248e184890">Kubernetes Tip: How To Make Kubernetes React Faster When Nodes Fail?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: What Happens To Pods Running On Node That Become Unreachable?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-what-happens-to-pods-running-on-node-that-become-unreachable-3d409f734e5d?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d409f734e5d</guid>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-tip]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Tue, 09 Jun 2020 21:22:38 GMT</pubDate>
            <atom:updated>2020-06-09T21:13:17.710Z</atom:updated>
            <content:encoded><![CDATA[<p>It is very common for the worker nodes to get disconnected from their master due to various reasons. In such conditions, there are a bunch of questions we need answers for such as, Do master delete pods running on unreachable nodes?, How do Kubernetes controllers behave?, Does the pod continue to run on the worker nodes?. In short, what we are looking for is How does the Kubernetes system behave when a node becomes unreachable?.</p><p><strong>Definition:</strong> An unreachable node is referred to as a partitioned node in Kubernetes parlance.</p><p>To understand the modus operandi, let’s create a partitioned node scenario and understand the behavior.</p><h4>Example Cluster.</h4><p>The example cluster considered has one master node and 3 worker nodes. An Nginx deployment is created having 2 replicas. These replicas run on different nodes; kind-worker2 &amp; kind-worker3. <strong>Figure-1</strong> captures the state of the example cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JaHlRRJEVDLdtesAD0dPRw.png" /><figcaption><strong>Figure-1: State of example cluster.</strong></figcaption></figure><h4>Create a Node Partition.</h4><p>A simple way to create a node partition is to remove the IP address of the node. That is what we do for kind-worker2. <strong>Figure-2</strong> provides the necessary steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-Gvq7_c7-zVTGjOVxt6mg.png" /><figcaption><strong>Figure-2: Create Node Partition.</strong></figcaption></figure><h4>How The Kubernetes System Behave?</h4><p>The worker node(kind-worker2) is set to <strong>NotReady</strong> state immediately but the pod continuous to run. The reason being, the node-controller part of the kube-controller-manager responsible for node waits for <strong>pod-eviction-timeout</strong> to make sure the node is completely unreachable before scheduling the pods for deletion.</p><p><strong>pod-eviction-timeout </strong>is set to 5 minutes by default and modified as part of the kube-controller-manager bootup process.</p><p>After the pod-eviction-timeout interval (5 mins in our case), the node-controller schedules the pods running on the partitioned node to <strong>Terminating</strong> state. The deployment controller part of the kube-controller-manager kicks in to create new replicas and schedules on the different nodes. In our example, an Nginx replica is created on the kind-worker node.</p><p><strong>Figure-3</strong> captures all the state changes on the Kubernetes system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0gMksi113h1Be9lMyE2AQ.png" /><figcaption><strong>Figure-3: Situation on master-node.</strong></figcaption></figure><h4>What Happens To Pods Running On Partitioned Worker Node?.</h4><p>Let’s get into the partitioned worker node to see what is going on. From <strong>Figure-4, </strong>we can observe that the pod continuous to run. Interesting!. The reason is the API server is unable to communicate with the partitioned node’s Kubelet to delete the pod. Also, Kubelet is not a controller to decide on what pods to run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TuMd8BnUy_p0944HXDCkeg.png" /><figcaption><strong>Figure-4: Pod continues to run on partitioned</strong> <strong>worker-node.</strong></figcaption></figure><p>The pod gets removed once the partitioned node joins the cluster.</p><h4>Summary.</h4><p>Given that quite a few things happening under the hoods when a node gets partitioned. Here is a summary.</p><blockquote>When the node becomes unreachable, The master sets the node to NotReady state.</blockquote><blockquote>The master waits for pod-eviction-timeout before taking any action. The pod-eviction-timeout is configurable parameter is set to 5 minutes by default as part of the kube-controller-manager bootup process.</blockquote><blockquote>After a pod-eviction-timeout time, the master set’s partitioned nodes pods to Terminating state and creates new instances of pods on different nodes.</blockquote><blockquote>The pods continue to run on the partitioned nodes.</blockquote><h4>Recommendation.</h4><p>There is no magic number for <strong>pod-eviction-timeout</strong> that works for all cases. The value entirely depends upon business requirements such as application SLA’s, Cluster Resource Utilization, etc. If an environment has tight application SLAs or running out of error budgets and cluster resource utilization on the higher side, Tailwinds prescribes a lower value for pod-eviction-timeout. On the other hand, if SLAs are on the lower side or there is more leverage from error budgets perspective and cluster utilization on the lower side, Tailwinds prescribes higher value for pod-eviction-timeout.</p><p>I hope this helps. As always, I appreciate your comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d409f734e5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-what-happens-to-pods-running-on-node-that-become-unreachable-3d409f734e5d">Kubernetes Tip: What Happens To Pods Running On Node That Become Unreachable?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Tip: How To Gracefully Handle Pod Deletion?]]></title>
            <link>https://medium.com/tailwinds-navigator/kubernetes-tip-how-to-gracefully-handle-pod-deletion-b28d23644ccc?source=rss----ceb98fe73a70---4</link>
            <guid isPermaLink="false">https://medium.com/p/b28d23644ccc</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-tip]]></category>
            <dc:creator><![CDATA[Bhargav Bhikkaji]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 11:05:08 GMT</pubDate>
            <atom:updated>2020-06-07T09:28:23.782Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Tip: How To Gracefully Handle Pod Shutdown?</h3><p>There are many use-cases where Pod delete requires to be handled gracefully. Few examples are; logs of the deleting pod to be stored in a remote location, Current requests/jobs to be processed before Pod deletes, or update certain rules/fields before shut down. Such use-cases require an understanding of how the shutdown process works that help better designing the system.</p><p>Here is the flow of events when the Pod get’s deleted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6wzIB7cIVH3mp9Ux-eOWg.jpeg" /><figcaption>Pod Delete Flow.</figcaption></figure><p>The pictures consider a user deleting the pod using either delete CLI or delete API while this operation can occur in many ways such as auto-scaling, rolling updates, etc. Irrespective of the case, the flow of events remains the same as described in the picture which is elaborated below.</p><blockquote>When api-server receives a delete pod message, it sets the status of the pod to terminating state.</blockquote><blockquote>Kube-proxy running as daemonset on all nodes watches for the status change of the pod to remove the terminating pod from service endpoints.</blockquote><blockquote>Kubelet actually does grunt of the work. For each container in the pod, Kubelet checks If the preStop hook is configured run preStop script for graceful shutdown. If the preStop hook is <strong>not</strong> configured, Kubelet sends a SIG_TERM signal to containers&#39; main process(PID 1) for it to shutdown gracefully. After grace-terminate-period, Kubelet will forcefully kill any running containers in both the cases described.</blockquote><blockquote>After completing all these operations, Kubelet updates api-server to remove the pod completely.</blockquote><p>By default, <strong>graceful-terminate-period</strong> is set to 30 seconds but is a configurable parameter as part of pod Spec</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*vYxV8ozJtpH2y6_fWFgX3g.png" /><figcaption>Graceful Terminate Period Set To 60 Seconds.</figcaption></figure><p>Alternatively, One can use CLI and provide a graceful-terminate-period as an option during a delete operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QvBknD0HfehQbI08rtv-ig.png" /><figcaption>Set Graceful Terminate Period As Part Of CLI.</figcaption></figure><h4><strong><em>Updated Based On Comments.</em></strong></h4><p>For a truly graceful shutdown, event <strong>Remove_Pod_From_Service </strong>must occur before event<strong> Send_SIG_TERM_Signal </strong>for the pod to handle the last few requests gracefully but these events occur asynchronously with no guaranteed order. Ordering is achieved by having a preStop hook that sleeps for a few seconds expecting Remove_Pod_From_Service occurs before Send_SIG_TERM_Signal.</p><h4>Recommendation.</h4><p>The recommendation is to configure <strong>preStop</strong> hook and <strong>graceful-terminate-period</strong> for applications such that <strong>Remove_Pod_From_Service</strong> event always occurs before <strong>Send_SIG_TERM_Signal </strong>event.</p><p>I hope this helps. Appreciate your comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b28d23644ccc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailwinds-navigator/kubernetes-tip-how-to-gracefully-handle-pod-deletion-b28d23644ccc">Kubernetes Tip: How To Gracefully Handle Pod Deletion?</a> was originally published in <a href="https://medium.com/tailwinds-navigator">Tailwinds-MajorDomo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>