<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Karpenter – Tasks</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/tasks/</link><description>Recent content in Tasks on Karpenter</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/tasks/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Managing AMIs</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/tasks/managing-amis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/tasks/managing-amis/</guid><description>
&lt;div class="alert alert-warning" role="alert">
&lt;h4 class="alert-heading">Important&lt;/h4>
&lt;p>Karpenter &lt;strong>heavily recommends against&lt;/strong> opting-in to use an &lt;code>amiSelectorTerm&lt;/code> with &lt;code>@latest&lt;/code> unless you are doing this in a pre-production environment or are willing to accept the risk that a faulty AMI may cause downtime in your production clusters. In general, if using a publicly released version of a well-known AMI type (like AL2, AL2023, or Bottlerocket), we recommend that you pin to a version of that AMI and deploy newer versions of that AMI type in a staged approach when newer patch versions are available.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">amiSelectorTerms&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">alias&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">al2023@v20240807&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>More details are described in &lt;a href="#controlling-ami-replacement">Controlling AMI Replacement&lt;/a> below.&lt;/p>
&lt;/div>
&lt;p>Understanding how Karpenter assigns AMIs to nodes can help ensure that your workloads will run successfully on those nodes and continue to run if the nodes are upgraded to newer AMIs.
Below we describe how Karpenter assigns AMIs to nodes when they are first deployed and how newer AMIs are assigned later when nodes are spun up to replace old ones.
Later, it describes the options you have to assert control over how AMIs are used by Karpenter for your clusters.&lt;/p>
&lt;p>Features for managing AMIs described here should be considered as part of the larger upgrade policies that you have for your clusters.
See &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/faq/#how-do-i-upgrade-an-eks-cluster-with-karpenter">How do I upgrade an EKS Cluster with Karpenter&lt;/a> for details on this process.&lt;/p>
&lt;h2 id="how-karpenter-assigns-amis-to-nodes">How Karpenter assigns AMIs to nodes&lt;/h2>
&lt;p>Here is how Karpenter assigns AMIs nodes:&lt;/p>
&lt;ul>
&lt;li>When you create an &lt;code>EC2NodeClass&lt;/code>, you are required to specify &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/nodeclasses/#specamiselectorterms">&lt;code>amiSelectorTerms&lt;/code>&lt;/a>. &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/nodeclasses/#specamiselectorterms">&lt;code>amiSelectorTerms&lt;/code>&lt;/a> allow you to select on AMIs that can be spun-up by this EC2NodeClass based on tags, id, name, or an alias. Multiple AMIs may be specified, and Karpenter will choose the newest compatible AMI when spinning up new nodes.&lt;/li>
&lt;li>Some &lt;code>amiSelectorTerm&lt;/code> types are static and always resolve to the same AMI (e.g. &lt;code>id&lt;/code>). However, some are dynamic and may resolve to different AMIs over time. Examples of dynamic types include &lt;code>alias&lt;/code>, &lt;code>tags&lt;/code>, and &lt;code>name&lt;/code> (when using a wildcard). For example, if you specify an &lt;code>amiSelectorTerm&lt;/code> with an &lt;code>alias&lt;/code> set to &lt;code>@latest&lt;/code> (e.g. &lt;code>al2023@latest&lt;/code>, &lt;code>al2@latest&lt;/code>, or &lt;code>bottlerocket@latest&lt;/code>), Karpenter will use the &lt;em>latest&lt;/em> release for that AMI type when spinning up a new node.&lt;/li>
&lt;li>When a node is replaced, Karpenter checks to see if a newer AMI is available based on your &lt;code>amiSelectorTerms&lt;/code>. If a newer AMI is available, Karpenter will automatically use the new AMI to spin up the new node. &lt;strong>In particular, if you are using a dynamic &lt;code>amiSelectorTerm&lt;/code> type, you may get a new AMI deployed to your environment without having properly tested it.&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>Whenever a node is replaced, the replacement node will be launched using the newest AMI based on your &lt;code>amiSelectorTerms&lt;/code>. Nodes may be replaced due to manual deletion, or any of Karpenter&amp;rsquo;s automated methods:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#expiration">&lt;strong>Expiration&lt;/strong>&lt;/a>: Automatically initiates replacement at a certain time after the node is created.&lt;/li>
&lt;li>&lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#consolidation">&lt;strong>Consolidation&lt;/strong>&lt;/a>: If Karpenter detects that a cheaper node can be used to run the same workloads, Karpenter may replace the current node automatically.&lt;/li>
&lt;li>&lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#drift">&lt;strong>Drift&lt;/strong>&lt;/a>: If a node&amp;rsquo;s state no longer matches the desired state dictated by the &lt;code>NodePool&lt;/code> or &lt;code>EC2NodeClass&lt;/code>, it will be replaced, including if the node&amp;rsquo;s AMI no longer matches the latest AMI selected by the &lt;code>amiSelectorTerms&lt;/code>.&lt;/li>
&lt;li>&lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#interruption">&lt;strong>Interruption&lt;/strong>&lt;/a>: Nodes are sometimes involuntarily disrupted by things like Spot interruption, health changes, and instance events, requiring new nodes to be deployed.&lt;/li>
&lt;/ul>
&lt;p>See &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#automated-methods">&lt;strong>Automated Methods&lt;/strong>&lt;/a> for details on how Karpenter uses these automated actions to replace nodes.&lt;/p>
&lt;p>The most relevant automated disruption method is &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#drift">&lt;strong>Drift&lt;/strong>&lt;/a>, since it is initiated when a new AMI is selected-on by your &lt;code>amiSelectorTerms&lt;/code>. This could be due to a manual update (e.g. a new &lt;code>id&lt;/code> term was added), or due to a new AMI being resolved by a dynamic term.&lt;/p>
&lt;p>If you&amp;rsquo;re using an &lt;code>alias&lt;/code> with the &lt;code>latest&lt;/code> pin (e.g. &lt;code>al2023@latest&lt;/code>), Karpenter periodically checks for new AMI releases. Since AMI releases are outside your control, this could result in new AMIs being deployed before they have been properly tested in a lower environment. This is why we &lt;strong>strongly recommend&lt;/strong> using version pins in production environments when using an alias (e.g. &lt;code>al2023@v20240807&lt;/code>).&lt;/p>
&lt;div class="alert alert-warning" role="alert">
&lt;h4 class="alert-heading">Important&lt;/h4>
If you are new to Karpenter, you should know that the behavior described here is different than you get with Managed Node Groups (MNG). MNG will always use the assigned AMI when it creates a new node and will never automatically upgrade to a new AMI when a new node is required. See &lt;a href="https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html">Updating a Managed Node Group&lt;/a> to see how you would manually update MNG to use new AMIs.
&lt;/div>
&lt;h2 id="controlling-ami-replacement">Controlling AMI Replacement&lt;/h2>
&lt;p>Karpenter&amp;rsquo;s automated node replacement functionality in tandem with the &lt;code>EC2NodeClass&lt;/code> gives you a lot of flexibility to control the desired state of nodes on your cluster. For example, you can opt-in to AMI auto-upgrades using &lt;code>alias&lt;/code> set to &lt;code>@latest&lt;/code>; however, this has to be weighed heavily against the risk of newer versions of an AMI breaking existing applications on your cluster. Alternatively, you can choose to pin your AMIs in your production clusters to avoid the risk of breaking changes; however, this has to be weighed against the management cost of testing new AMIs in pre-production and keeping up with the latest AMI versions.&lt;/p>
&lt;p>Karpenter offers you various controls to ensure you don&amp;rsquo;t take on too much risk as you rollout new versions of AMIs to your production clusters. Below shows how you can use these controls:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="#pinning-amis">Pinning AMIs&lt;/a>: If workloads require a particluar AMI, this control ensures that it is the only AMI used by Karpenter. This can be used in combination with &lt;a href="#testing-amis">Testing AMIs&lt;/a> where you lock down the AMI in production, but allow the newest AMIs in a test cluster while you test your workloads before upgrading production.&lt;/li>
&lt;li>&lt;a href="#testing-amis">Testing AMIs&lt;/a>: The safest way for ensuring that a new AMI doesn&amp;rsquo;t break your workloads is to test it before putting it into production. This takes the most effort on your part, but most effectively models how your workloads will run in production, allowing you to catch issues ahead of time. Note that you can sometimes get different results from your test environment when you roll a new AMI into production, since issues like scale and other factors can elevate problems you might not see in test. Combining this with other controls like &lt;a href="#using-disruption-budgets">Using Disruption Budgets&lt;/a> can allow you to catch problems before they impact your whole cluster.&lt;/li>
&lt;li>&lt;a href="#using-disruption-budgets">Using Disruption Budgets&lt;/a>: This option can be used as a way of mitigating the scope of impact if a new AMI causes problems with your workloads. With Disruption budgets you can slow the pace of upgrades to nodes with new AMIs or make sure that upgrades only happen during selected dates and times (using &lt;code>schedule&lt;/code>). This doesn&amp;rsquo;t prevent a bad AMI from being deployed, but it allows you to control when nodes are upgraded, and gives you more time to respond to rollout issues.&lt;/li>
&lt;/ul>
&lt;h3 id="pinning-amis">Pinning AMIs&lt;/h3>
&lt;p>When you configure the &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/nodeclasses/">&lt;strong>EC2NodeClass&lt;/strong>&lt;/a>, you are required to configure which AMIs you want Karpenter to select on using the &lt;code>amiSelectorTerms&lt;/code> field. When pinning to a specific &lt;code>id&lt;/code>, &lt;code>name&lt;/code>, &lt;code>tags&lt;/code> or an &lt;code>alias&lt;/code> that contains a fixed version, Karpenter will only select on a single AMI and won&amp;rsquo;t automatically upgrade your nodes to a new version of an AMI. This prevents a new and potentially untested AMI from replacing existing nodes when those nodes are terminated.
).&lt;/p>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Pinning an AMI to an &lt;code>alias&lt;/code> type with a fixed version &lt;em>will&lt;/em> pin the AMI so long as your K8s control plane version doesn&amp;rsquo;t change. Unlike &lt;code>id&lt;/code> and &lt;code>name&lt;/code> types, specifying a version &lt;code>alias&lt;/code> in your &lt;code>amiSelectorTerms&lt;/code> will cause Karpenter to consider the K8s control plane version of your cluster when choosing the AMI. If you upgrade your Kubernetes cluster while using this alias type, Karpenter &lt;em>will&lt;/em> automatically drift your nodes to a new AMI that still matches the AMI version but also matches your new K8s control plane version.
&lt;/div>
&lt;p>These examples show three different ways to identify the same AMI:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># Using alias&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#8f5902;font-style:italic"># Pinning to this fixed version alias will pull this version of the AMI,&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#8f5902;font-style:italic"># matching the K8s control plane version of your cluster&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">amiSelectorTerms&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">alias&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">al2023@v20240219&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># Using name&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#8f5902;font-style:italic"># This will only ever select the AMI that contains this exact name&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">amiSelectorTerms&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">name&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">al2023-ami-2023.3.20240219.0-kernel-6.1-x86_64&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># Using id&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#8f5902;font-style:italic"># This will only ever select this specific AMI id&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">amiSelectorTerms&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">id&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">ami-052c9ea013e6e3567&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># Using tags&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#8f5902;font-style:italic"># You can use a CI/CD system to test newer versions of an AMI&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#8f5902;font-style:italic"># and automatically tag them as you validate that they are safe to upgrade to&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">amiSelectorTerms&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">tags&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">karpenter.sh/discovery&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#34;${CLUSTER_NAME}&amp;#34;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">environment&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">prod&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>See the &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/nodeclasses/#specamiselectorterms">&lt;strong>spec.amiSelectorTerms&lt;/strong>&lt;/a> section of the NodeClasses page for details.
Keep in mind, that this could prevent you from getting critical security patches when new AMIs are available, but it does give you control over exactly which AMI is running.&lt;/p>
&lt;h3 id="testing-amis">Testing AMIs&lt;/h3>
&lt;p>Instead of avoiding AMI upgrades, you can set up test clusters where you can try out new AMI releases before they are put into production. For example, you could have:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Test clusters&lt;/strong>: On lower environment clusters, you can run the latest AMIs e.g. &lt;code>al2023@latest&lt;/code>, &lt;code>al2@latest&lt;/code>, &lt;code>bottlerocket@latest&lt;/code>, for your workloads in a safe environment. This ensures that you get the latest patches for AMIs where downtime to applications isn&amp;rsquo;t as critical and allows you to validate patches to AMIs before they are deployed to production.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Production clusters&lt;/strong>: After you&amp;rsquo;ve confirmed that the AMI works in your lower environments, you can pin the latest AMIs to be deployed in your production clusters to roll out the AMI. Refer to &lt;a href="#pinning-amis">Pinning AMIs&lt;/a> for how to choose a particular AMI by &lt;code>alias&lt;/code>, &lt;code>name&lt;/code> or &lt;code>id&lt;/code>. Remember that it is still best practice to gradually roll new AMIs into your cluster, even if they have been tested. So consider implementing that for your production clusters as described in &lt;a href="#using-disruption-budgets">Using Disruption Budgets&lt;/a>.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h3 id="using-disruption-budgets">Using Disruption Budgets&lt;/h3>
&lt;p>To reduce the risk of entire workloads being immediately degraded when a new AMI is deployed, you can enable Karpenter&amp;rsquo;s &lt;a href="#node-disruption-budgets ">&lt;strong>Node Disruption Budgets&lt;/strong>&lt;/a> as well as ensure that you have &lt;a href="#pod-disruption-budgets ">&lt;strong>Pod Disruption Budgets&lt;/strong>&lt;/a> configured for applications on your cluster. Below provides more details on how to configure each.&lt;/p>
&lt;h4 id="node-disruption-budgets">Node Disruption Budgets&lt;/h4>
&lt;p>&lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/disruption/#disruption-budgets ">Disruption Budgets&lt;/a> limit when and to what extent nodes can be disrupted. You can prevent disruption based on nodes (a percentage or number of nodes that can be disrupted at a time) and schedule (excluding certain times from disrupting nodes).
You can set Disruption Budgets in a &lt;code>NodePool&lt;/code> spec. Here is an example:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">disruption&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">budgets&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">nodes&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#0000cf;font-weight:bold">15&lt;/span>&lt;span style="color:#000">%&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">nodes&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#34;3&amp;#34;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">nodes&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#34;0&amp;#34;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">schedule&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#34;0 9 * * sat-sun&amp;#34;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">duration&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">24h&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#204a87;font-weight:bold">nodes&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#34;0&amp;#34;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">schedule&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#34;0 17 * * mon-fri&amp;#34;&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">duration&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">16h&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">reasons&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#000">Drifted&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Settings for budgets in the above example include the following:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Percentage of nodes&lt;/strong>: From the first &lt;code>nodes&lt;/code> setting, only &lt;code>15%&lt;/code> of the NodePool’s nodes can be disrupted at a time.&lt;/li>
&lt;li>&lt;strong>Number of nodes&lt;/strong>: The second &lt;code>nodes&lt;/code> setting limits the number of nodes that can be disrupted at a time to &lt;code>3&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Schedule&lt;/strong>: The third &lt;code>nodes&lt;/code> setting uses schedule to say that zero disruptions (&lt;code>0&lt;/code>) are allowed starting at 9am on Saturday and Sunday and continues for 24 (fully blocking disruptions all day).
The format of the schedule follows the &lt;code>crontab&lt;/code> format for identifying dates and times.
See the &lt;a href="https://man7.org/linux/man-pages/man5/crontab.5.html">crontab&lt;/a> page for information on the supported values for these fields.&lt;/li>
&lt;li>&lt;strong>Reasons&lt;/strong>: The fourth &lt;code>nodes&lt;/code> setting uses &lt;code>reasons&lt;/code> which implies that this budget only applies to the &lt;code>Drifted&lt;/code> disruption condition. This setting uses schedule to say that zero disruptions (&lt;code>0&lt;/code>) are allowed starting at 5pm on Monday, Tuesday, Wednesday, Thursday, and Friday and continues for 16h (effectively blocking rolling nodes due to drift outside of working hours).&lt;/li>
&lt;/ul>
&lt;p>As with all disruption settings, keep in mind that avoiding updated AMIs for your nodes can result in not getting fixes for known security risks and bugs.
You need to balance that with your desire to not risk breaking the workloads on your cluster.&lt;/p>
&lt;h4 id="pod-disruption-budgets">Pod Disruption Budgets&lt;/h4>
&lt;p>&lt;a href="https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget">Pod Disruption Budgets&lt;/a> allow you to describe how much disruption an application can tolerate before it begins to become unhealthy. This is critical to configure for Karpenter, since Karpenter uses this information to determine if it can continue to replace nodes. Specifically, if replacing a node would cause a Pod Disruption Budget to be breached (for graceful forms of disruption e.g. Drift or Consolidation), Karpenter will not replace the node.&lt;/p>
&lt;p>In a scenario where a faulty AMI is rolling out and begins causing downtime to your applications, configuring Pod Disruption Budgets is critical since this will tell Karpenter that it must stop replacing nodes until your applications become healthy again. This prevents Karpenter from deploying the faulty AMI throughout your cluster, reduces the imact the AMI has on your production applications, and gives you manually intervene in the cluster to remediate the issue.&lt;/p>
&lt;h2 id="follow-up">Follow-up&lt;/h2>
&lt;p>The Karpenter project continues to add features to give you greater control over AMI upgrades on your clusters.
If you have opinions about features you would like to see to manage AMIs with Karpenter, feel free to enter a Karpenter &lt;a href="https://github.com/aws/karpenter-provider-aws/issues/new/choose">New Issue&lt;/a>.&lt;/p></description></item><item><title>Docs: Utilizing On-Demand Capacity Reservations and Capacity Blocks</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/tasks/odcrs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/tasks/odcrs/</guid><description>
&lt;p>&lt;i class="fa-solid fa-circle-info">&lt;/i> &lt;b>Feature State: &lt;/b> &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/reference/settings/#feature-gates">Beta&lt;/a>&lt;/p>
&lt;p>Karpenter introduced native support for &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html">EC2 On-Demand Capacity Reservations&lt;/a> (ODCRs) in &lt;a href="https://github.com/aws/karpenter-provider-aws/releases/tag/v1.3.0">v1.3&lt;/a>, enabling users to select upon and prioritize specific capacity reservations.
In &lt;a href="https://github.com/aws/karpenter-provider-aws/releases/tag/v1.6.0">v1.6&lt;/a>, this support was expanded to include &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-blocks.html">EC2 Capacity Blocks for ML&lt;/a>.
To enable native ODCR support, ensure the &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/reference/settings/#feature-gates">&lt;code>ReservedCapacity&lt;/code> feature gate&lt;/a> is enabled.&lt;/p>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
If you were previously utilizing &lt;code>open&lt;/code> ODCRs using Karpenter, review the &lt;a href="#migrating-from-previous-versions">migration section&lt;/a> of this task before enabling this feature.
&lt;/div>
&lt;h2 id="selecting-capacity-reservations">Selecting Capacity Reservations&lt;/h2>
&lt;p>To configure native ODCR support, you will need to make updates to both your EC2NodeClass and NodePool.
First, you should configure &lt;code>capacityReservationSelectorTerms&lt;/code> on your EC2NodeClass.
Similar to &lt;code>amiSelectorTerms&lt;/code>, you can specify a number of terms which are ANDed together to select ODCRs in your AWS account.
The following example demonstrates how to select all capacity reservations tagged with &lt;code>application: foobar&lt;/code> in addition to &lt;code>cr-56fac701cc1951b03&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">capacityReservationSelectorTerms&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">tags&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">application&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">foobar&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">id&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">cr-56fac701cc1951b03&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For more information on configuring &lt;code>capacityReservationSelectorTerms&lt;/code>, see the &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/docs/concepts/nodeclasses/#speccapacityreservationselectorterms">NodeClass docs&lt;/a>.&lt;/p>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Capacity blocks are modeled as on-demand capacity reservations in EC2.
To select capacity blocks, specify them in your &lt;code>capacityReservationSelectorTerms&lt;/code> in the same way you would for a default ODCR.
&lt;/div>
&lt;p>Additionally, you will need to update your NodePool to be compatible with ODCRs.
Karpenter doesn&amp;rsquo;t model ODCRs as standard on-demand capacity, and instead uses a dedicated capacity type: &lt;code>reserved&lt;/code>.
For a NodePool to utilize ODCRs, it must be compatible with &lt;code>karpenter.sh/capacity-type: reserved&lt;/code>.
The following example demonstrates how to configure a NodePool to prioritize ODCRs and fallback to on-demand capacity:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">requirements&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">key&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">karpenter.sh/capacity-type&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">operator&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">In&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">values&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">[&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;reserved&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;on-demand&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">]&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Additionaly, Karpenter supports the following scheduling labels:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Label&lt;/th>
&lt;th>Example&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>karpenter.k8s.aws/capacity-reservation-id&lt;/code>&lt;/td>
&lt;td>&lt;code>cr-56fac701cc1951b03&lt;/code>&lt;/td>
&lt;td>The capacity reservation&amp;rsquo;s ID&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>karpenter.k8s.aws/capacity-reservation-type&lt;/code>&lt;/td>
&lt;td>&lt;code>default&lt;/code> or &lt;code>capacity-block&lt;/code>&lt;/td>
&lt;td>The type of capacity reservation&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>These labels will only be present on reserved nodes.
They are supported as NodePool requirements and as pod scheduling constaints (e.g. &lt;a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity">node affinity&lt;/a>).&lt;/p>
&lt;h2 id="prioritization-behavior">Prioritization Behavior&lt;/h2>
&lt;p>NodePools are not limited to a single compatible capacity-type &amp;ndash; they can be compatible with any combination of the available capacity-types (&lt;code>on-demand&lt;/code>, &lt;code>spot&lt;/code>, and &lt;code>reserved&lt;/code>).
Consider the following NodePool requirements:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">requirements&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>- &lt;span style="color:#204a87;font-weight:bold">key&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">karpenter.sh/capacity-type&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">operator&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">In&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">values&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000;font-weight:bold">[&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;reserved&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;on-demand&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#4e9a06">&amp;#39;spot&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">]&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In this example, the NodePool is compatible with all capacity types.
Karpenter will prioritize ODCRs, but if none are available or none are compatible with the pending workloads it will fallback to spot or on-demand.
Similarly, Karpenter will prioritize reserved capacity during consolidation.
Since ODCRs are pre-paid, Karpenter will model them as free and consolidate spot / on-demand nodes when possible.&lt;/p>
&lt;h2 id="expiration">Expiration&lt;/h2>
&lt;p>An instance launched into an ODCR is not necessarily in that ODCR indefinitely.
The ODCR could expire, be cancelled, or the instance could be manually removed from the ODCR.
If any of these occur, and Karpenter detects that the instance no longer belongs to an ODCR, it will update the &lt;code>karpenter.sh/capacity-type&lt;/code> label to &lt;code>on-demand&lt;/code>.&lt;/p>
&lt;h3 id="capacity-blocks">Capacity Blocks&lt;/h3>
&lt;p>Unlike default ODCRs, Capacity Blocks must have an end time.
Additionally, instances launched into a capacity block will be terminated by EC2 ahead of the end time, rather than becoming standard on-demand capacity.&lt;/p>
&lt;p>From the &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-blocks.html">AWS docs&lt;/a>:&lt;/p>
&lt;blockquote>
&lt;p>You can use all the instances you reserved until 30 minutes (for instance types) or 60 minutes (for UltraServer type) before the end time of the Capacity Block.
With 30 minutes (for instance types) or 60 minutes (for UltraServer types) left in your Capacity Block reservation, we begin terminating any instances that are running in the Capacity Block.
We use this time to clean up your instances before delivering the Capacity Block to the next customer.&lt;/p>
&lt;/blockquote>
&lt;p>Karpenter will preemptively begin draining nodes launched for capacity blocks 10 minutes before EC2 begins termination, ensuring your workloads can gracefully terminate before reclaimation.&lt;/p>
&lt;h2 id="migrating-from-previous-versions">Migrating From Previous Versions&lt;/h2>
&lt;p>Although it was not natively supported, it was possible to utilize ODCRs on previous versions of Karpenter.
If a NodeClaim&amp;rsquo;s requirements happened to be compatible with an open ODCR in the target AWS account, it may have launched an instance into that open ODCR.
This could be ensured by constraining a NodePool such that it was only compatible with the desired open ODCR, and limits could be used to enable fallback to a different NodePool once the ODCR was exhausted.
This behavior is no longer supported when native on-demand capacity support is enabled.&lt;/p>
&lt;p>If you were relying on this behavior, you should configure your &lt;code>EC2NodeClasses&lt;/code> to select the desired ODCRs &lt;strong>before&lt;/strong> enabling the feature gate.
You should also ensure any NodePools which you wish to use with ODCRs are compatible with &lt;code>karpenter.sh/capacity-type: reserved&lt;/code>.
Performing these steps before enabling the feature gate will ensure that Karpenter can immediately continue utilizing your reservations, rather than falling back to on-demand.&lt;/p></description></item></channel></rss>