<?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 Neil Peterson on Medium]]></title>
        <description><![CDATA[Stories by Neil Peterson on Medium]]></description>
        <link>https://medium.com/@neilpeterson?source=rss-8ed4f32c83e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LhJ2Qcf7T807UOMT3XG08A.jpeg</url>
            <title>Stories by Neil Peterson on Medium</title>
            <link>https://medium.com/@neilpeterson?source=rss-8ed4f32c83e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:26:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@neilpeterson/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[Kubernetes Operations: Prioritize Workload in Overcommitted Clusters]]></title>
            <link>https://medium.com/microsoft/kubernetes-operations-prioritize-workload-in-overcommitted-clusters-8b9a60de98ec?source=rss-8ed4f32c83e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b9a60de98ec</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Neil Peterson]]></dc:creator>
            <pubDate>Thu, 14 Feb 2019 16:34:11 GMT</pubDate>
            <atom:updated>2019-02-26T12:45:11.900Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the benefits in adopting a system like Kubernetes is facilitating burst-able and scalable workload. Horizontal application scaling involves adding or removing instances of an application to match demand. <strong>Kubernetes Horizontal Pod Autoscaler</strong> enables automated pod scaling based on demand. This is cool, however can lead to unpredictable load on the cluster, which may put the cluster into an overcommitted state.</p><p>The following image represents a three node cluster that runs three applications. Pink (triangle) is the most critical. Red (pentagon) is burst-able and durable. This means if we need to stop a few instances of red, things will be ok. Blue (circle) is non-critical. I have also tried to depict in this image a cluster that is a fully maxed out state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*voPAxDaAwLYn71CW5Crqqg.jpeg" /></figure><p>Imaging now that a scale out operation is needed on the pink (triangle) application. This puts the cluster in an overcommitted state with critical workload requiring scheduling.</p><p>How can Kubernetes facilitate this critical request in an overcommitted state? One option is to use <strong>Pod Priority</strong> and <strong>Preemption</strong>, which allows a priority weight to be added to a scheduling request. In the event of overcommitment, priority is evaluated, and lower priority workload is restarted (preemption) to allow for scheduling of the priority workload.</p><h3>Pod Priority and Preemption tutorial</h3><p>In this article, we will walk through an end-to-end demonstration of using Pod Priority and Pre-emption to ensure critical workload has priority to cluster resources.</p><p>In order to complete this tutorial, you need a Kubernetes cluster that consists of three nodes. I’ve included steps for deploying an appropriately sized Azure Kubernetes cluster. If you need an Azure Subscription or would like to read up on additional operational practices for Azure Kubernetes Service, see the following links.</p><ul><li><a href="https://azure.microsoft.com/en-us/free/?WT.mc_id=azuremedium-blog-nepeters">Azure Free Trial</a></li><li><a href="https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app?WT.mc_id=azuremedium-blog-nepeters">Azure Kubernetes Service operations best practices</a></li></ul><h3>Create an Azure Kubernetes Service Cluster</h3><p>First things first, ensure you have an appropriately sized Kubernetes cluster for this tutorial (three nodes). The following script can be used if needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4deb380b55f6bb45385269abbc63e2c7/href">https://medium.com/media/4deb380b55f6bb45385269abbc63e2c7/href</a></iframe><h3>Create a priority class for critical workload</h3><p>Create a <strong>Pod Priority Class</strong> with a weight of 1000000. This can be used to ensure that high priority workload is given priority to cluster resource.</p><p>To do so, create a file names pc.yml and copy in the following yaml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38dddc870b0fbeb5854160759f0140b1/href">https://medium.com/media/38dddc870b0fbeb5854160759f0140b1/href</a></iframe><p>Create the priority class.</p><pre>$ kubectl create -f pc.yml</pre><h3>Consume all CPU cores</h3><p>Run some workload to consume all CPU cores in the cluster. In the following example, a deployment consisting of three replicas is started with a CPU request of one core each. This will effectively consume the available CPU resources of the cluster.</p><p>Create a file named slam-cpu.yml and copy in the following yaml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bcab0ede41189d28821a125b70e1d68/href">https://medium.com/media/2bcab0ede41189d28821a125b70e1d68/href</a></iframe><p>Run the deployment.</p><pre>$ kubectl create -f slam-cpu.yml</pre><h3>Start low-priority workload</h3><p>Now start another pod without specifying a priority class.</p><p>Create a file named pod-no-priority.yml and copy in the following YAML.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91ad8c3a4e4294dd805d152b10388506/href">https://medium.com/media/91ad8c3a4e4294dd805d152b10388506/href</a></iframe><p>Run the pod.</p><pre>$ kubectl create -f pod-no-priority.yml</pre><p>You should find that the new pod cannot be scheduled due to lack of CPU resources. To see this, list the pods on the cluster and note that the pod-no-priority is in a Pending state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d37f189926621b733037e5fc7857c57/href">https://medium.com/media/4d37f189926621b733037e5fc7857c57/href</a></iframe><p>Return a list of events for the pod to see the actual issue.</p><pre>$ kubectl describe pod pod-no-priority</pre><p>Parsing the output you should see that the pod cannot be scheduled to insufficient cpu.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca1303faf30fafd1ee2cb50b4ae486e3/href">https://medium.com/media/ca1303faf30fafd1ee2cb50b4ae486e3/href</a></iframe><h3>Run high priority workload</h3><p>Run another pod, however this time assign the custom-high-priority class to the pod.</p><p>Create a file named pod-priority.yml and copy in the following yaml. Take note that the pod spec includes the priority class created in a previous step.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71aaa30efb0aed00c1c2ba03966c6a94/href">https://medium.com/media/71aaa30efb0aed00c1c2ba03966c6a94/href</a></iframe><p>Run the pod.</p><pre>kubectl create -f pod-priority.yal</pre><p>Now return a list of pods. If done quickly you may be able to catch one of the lower priority pods being terminated.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a432991b9eb0d6fb590a5f27a353009d/href">https://medium.com/media/a432991b9eb0d6fb590a5f27a353009d/href</a></iframe><p>Once the lower priority pod has been terminated, the pod with priority is started in its place.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3767454120323d046da2fd6e4eefc51/href">https://medium.com/media/f3767454120323d046da2fd6e4eefc51/href</a></iframe><p>Very cool indeed.</p><p>Feel free to contact me on Twitter <a href="https://twitter.com/nepeters">@nepeters</a> or comment below for discussion on the topic.</p><p><em>Originally published at </em><a href="https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Kubernetes-Operations-Prioritize-Workload-in-Overcommitted/ba-p/288406"><em>techcommunity.microsoft.com</em></a><em> on November 20, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b9a60de98ec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microsoft/kubernetes-operations-prioritize-workload-in-overcommitted-clusters-8b9a60de98ec">Kubernetes Operations: Prioritize Workload in Overcommitted Clusters</a> was originally published in <a href="https://medium.com/microsoft">Microsoft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Operations: Prioritize Workload in Overcommitted Clusters]]></title>
            <link>https://medium.com/microsoft/kubernetes-operations-prioritize-workload-in-overcommitted-clusters-2d0648b5c434?source=rss-8ed4f32c83e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d0648b5c434</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[operations]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Neil Peterson]]></dc:creator>
            <pubDate>Tue, 20 Nov 2018 11:00:00 GMT</pubDate>
            <atom:updated>2019-02-14T15:01:01.020Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the benefits in adopting a system like Kubernetes is facilitating burst-able and scalable workload. Horizontal application scaling involves adding or removing instances of an application to match demand. <strong>Kubernetes Horizontal Pod Autoscaler</strong> enables automated pod scaling based on demand. This is cool, however can lead to unpredictable load on the cluster, which may put the cluster into an overcommitted state.</p><p>The following image represents a three node cluster that runs three applications. Pink is the most critical. Red is burst-able and durable. This means if we need to stop a few instances of red, things will be ok. Blue is non-critical. I have also tried to depict in this image a cluster that is a fully maxed out state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/0*7xvnxrL_-CiXc9rh" /></figure><p>Imaging now that a scale out operation is needed on the pink application. This puts the cluster in an overcommitted state with critical workload requiring scheduling.</p><p>How can Kubernetes facilitate this critical request in an overcommitted state? One option is to use <strong>Pod Priority</strong> and <strong>Preemption</strong>, which allows a priority weight to be added to a scheduling request. In the event of overcommitment, priority is evaluated, and lower priority workload is restarted (preemption) to allow for scheduling of the priority workload.</p><h3>Pod Priority and Preemption tutorial</h3><p>In this article, we will walk through an end-to-end demonstration of using Pod Priority and Pre-emption to ensure critical workload has priority to cluster resources.</p><p>In order to complete this tutorial, you need a Kubernetes cluster that consists of three nodes. I’ve included steps for deploying an appropriately sized Azure Kubernetes cluster. If you need an Azure Subscription or would like to read up on additional operational practices for Azure Kubernetes Service, see the following links.</p><ul><li><a href="https://azure.microsoft.com/en-us/free/?WT.mc_id=azuremedium-blog-nepeters">Azure Free Trial</a></li><li><a href="https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app?WT.mc_id=azuremedium-blog-nepeters">Azure Kubernetes Service operations best practices</a></li></ul><h3>Create an Azure Kubernetes Service Cluster</h3><p>First things first, ensure you have an appropriately sized Kubernetes cluster for this tutorial (three nodes). The following script can be used if needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc4caf3b371979283856501f04a492e6/href">https://medium.com/media/bc4caf3b371979283856501f04a492e6/href</a></iframe><h3>Create a priority class for critical workload</h3><p>Create a <strong>Pod Priority Class</strong> with a weight of 1000000. This can be used to ensure that high priority workload is given priority to cluster resource.</p><p>To do so, create a file names pc.yml and copy in the following yaml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52ec22855dd335828fc85456feaf2c50/href">https://medium.com/media/52ec22855dd335828fc85456feaf2c50/href</a></iframe><p>Create the priority class.</p><pre>$ kubectl create -f pc.yml</pre><h3>Consume all CPU cores</h3><p>Run some workload to consume all CPU cores in the cluster. In the following example, a deployment consisting of three replicas is started with a CPU request of one core each. This will effectively consume the available CPU resources of the cluster.</p><p>Create a file named slam-cpu.yml and copy in the following yaml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc5feda283abc283cfd65a38f4f444af/href">https://medium.com/media/cc5feda283abc283cfd65a38f4f444af/href</a></iframe><p>Run the deployment.</p><pre>$ kubectl create -f slam-cpu.yml</pre><h3>Start low-priority workload</h3><p>Now start another pod without specifying a priority class.</p><p>Create a file named pod-no-priority.yml and copy in the following YAML.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c02c7431788d304150c8ecd703d5694f/href">https://medium.com/media/c02c7431788d304150c8ecd703d5694f/href</a></iframe><p>Run the pod.</p><pre>$ kubectl create -f pod-no-priority.yml</pre><p>You should find that the new pod cannot be scheduled due to lack of CPU resources. To see this, list the pods on the cluster and note that the pod-no-priority is in a Pending state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4c3b5834f607a055bc83de908abdad5/href">https://medium.com/media/b4c3b5834f607a055bc83de908abdad5/href</a></iframe><p>Return a list of events for the pod to see the actual issue.</p><pre>$ kubectl describe pod pod-no-priority</pre><p>Parsing the output you should see that the pod cannot be scheduled to insufficient cpu.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca1303faf30fafd1ee2cb50b4ae486e3/href">https://medium.com/media/ca1303faf30fafd1ee2cb50b4ae486e3/href</a></iframe><h3>Run high priority workload</h3><p>Run another pod, however this time assign the custom-high-priority class to the pod.</p><p>Create a file named pod-priority.yml and copy in the following yaml. Take note that the pod spec includes the priority class created in a previous step.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c1924f8af4c757e5c696642d5680418/href">https://medium.com/media/0c1924f8af4c757e5c696642d5680418/href</a></iframe><p>Run the pod.</p><pre>kubectl create -f pod-priority.yal</pre><p>Now return a list of pods. If done quickly you may be able to catch one of the lower priority pods being terminated.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33c41ec023da412c45ccea049a4f4641/href">https://medium.com/media/33c41ec023da412c45ccea049a4f4641/href</a></iframe><p>Once the lower priority pod has been terminated, the pod with priority is started in its place.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e33cc8a9ca813d4a9c45d9877017f1d3/href">https://medium.com/media/e33cc8a9ca813d4a9c45d9877017f1d3/href</a></iframe><p>Very cool indeed.</p><p>Feel free to contact me on Twitter <a href="https://twitter.com/nepeters">@nepeters</a> or comment below for discussion on the topic.</p><p><em>Originally published at </em><a href="https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Kubernetes-Operations-Prioritize-Workload-in-Overcommitted/ba-p/288406"><em>techcommunity.microsoft.com</em></a><em> on November 20, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d0648b5c434" width="1" height="1" alt=""><hr><p><a href="https://medium.com/microsoft/kubernetes-operations-prioritize-workload-in-overcommitted-clusters-2d0648b5c434">Kubernetes Operations: Prioritize Workload in Overcommitted Clusters</a> was originally published in <a href="https://medium.com/microsoft">Microsoft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>