<?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 Nadav Buchman on Medium]]></title>
        <description><![CDATA[Stories by Nadav Buchman on Medium]]></description>
        <link>https://medium.com/@nadav.buchman_74917?source=rss-d73e78473f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*frU1QCMRJKINg5V5</url>
            <title>Stories by Nadav Buchman on Medium</title>
            <link>https://medium.com/@nadav.buchman_74917?source=rss-d73e78473f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 14:00:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nadav.buchman_74917/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[The Karpenter Transformation]]></title>
            <link>https://medium.com/fiverr-engineering/the-karpenter-transformation-1c278294bd9b?source=rss-d73e78473f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c278294bd9b</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[karpenter]]></category>
            <category><![CDATA[autoscaling]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Nadav Buchman]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 07:30:58 GMT</pubDate>
            <atom:updated>2024-07-03T07:49:19.397Z</atom:updated>
            <content:encoded><![CDATA[<h3>Welcome to Fiverr’s Infrastructure Renaissance: First Up — the Karpenter transformation</h3><h3>In this article, I cover:</h3><ul><li>How we migrated our Kubernetes compute nodes to Karpenter.</li><li>What we gained from it.</li><li>Public helm template and Grafana dashboard disclosure.</li></ul><p>At Fiverr, we’re always looking for ways to improve our infrastructure and use our resources more efficiently. Recently, we undertook a significant migration effort: transitioning our Kubernetes compute nodes to Karpenter.</p><p>This article details our migration process, the benefits of the journey, and the tools we developed to streamline our operations.</p><h3>First, allow me to explain why we needed a change</h3><p>Before adopting Karpenter, we had always relied on a third-party solution to manage our compute nodes. This approach had several downsides, including:</p><ul><li><strong>Manual updates</strong>: Compute nodes were managed using Infrastructure as Code (IaC), requiring frequent “terraform-applies” to ensure the latest OS image was used. This process was cumbersome before we automated our IaC.</li><li><strong>Explicit specifications</strong>: We had to specify instance types and scopes, which was inefficient for multi-architecture setups and automatic adoption of next generation instance types.</li><li><strong>Manual node recycling</strong>: This was very time-consuming and required a closely monitored scripted process.</li><li><strong>Resource wastage:</strong> Unused resources just can’t happen in this economy and with so many businesses like ours needed resources to keep innovating, this was a big source of frustration,</li><li><strong>Spot interruptions</strong>: This happened way too often, causing system noise due to rapid node replacements.</li></ul><h3>And so, we made the decision to use <a href="https://karpenter.sh/">Karpenter</a></h3><p>This Kubernetes-native controller offers just-in-time capacity for workloads by dynamically scaling compute nodes based on actual resource requirements. It integrates with the Kubernetes scheduler to nominate nodes for pending pods.</p><p>Among its other key selling points (well, what sold us!) were:</p><ul><li><strong>Dynamic resource allocation:</strong> You specify the number of cores, minimum generation, architecture, and processor manufacturer to reduce node group customization overhead.</li><li><strong>Consolidation:</strong> No more resource wastage since workloads are consolidated.</li><li><strong>Compatibility:</strong> Ensures compatibility with Kubernetes OS image versions and architectures.</li><li><strong>Capacity management:</strong> Falls back to on-demand or different instance types when capacity is unavailable.</li><li><strong>Drift management:</strong> Automatically recycles nodes during patches or Kubernetes upgrades.</li><li><strong>Maintenance windows:</strong> Allows budget and schedule settings to control node replacement frequency.</li><li><strong>Priority weighting:</strong> Enables prioritization of different instance types to reduce system noise and spot interruptions.</li></ul><h3>But it wasn’t all rainbows and butterflies.</h3><p>We encountered some challenges during our Karpenter adoption. I bring these up because you need the full story to make the best decision. First, we had to ensure equal node distribution across availability zones, which we solved by using topology-spread on the topology.kubernetes.io/zone key. We also had to address aggressive bin-packing to prevent overstressed nodes (which we did by implementing hostname-based topology-spread).</p><p>Managing spot and on-demand workload percentages with capacity-spread and topology-spread features was also a challenge, as was simplifying YAML management (but we handled that by creating a Helm template for node group specifications).</p><h3>A bird’s-eye view of our migration flow</h3><ol><li>We first deployed the Karpenter Controller in a dedicated Auto Scaling Group (ASG).</li><li>Using our Helm chart, we specified our Kubernetes node groups.</li><li>We gradually reduced each node group’s minimum/maximum node count on the third-party solution. As nodes were removed, Karpenter took over until it managed the entire node group.</li><li>Migration was done one node group at a time, starting with the least critical.</li><li>For certain use cases, we disabled consolidation and specified instance idle TTL to prevent job interruptions.</li></ol><h3>Monitoring</h3><p>Karpenter exposes very useful metrics for prometheus.<br>You can find an importable Grafana dashboard <a href="https://github.com/fiverr/public_charts/tree/master/charts/karpenter_nodes/grafana">HERE</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRGPWgG2PRu3tmIynhAWfw.png" /></figure><h4>In general — we monitor:</h4><p>Interruption rates per NodeGroup (per NodePool); capacity usage out of limit (if defined); potential costs; capacity types; spread across availability zones; consolidations, drifts and provisioning rates; Karpenter’s performance in general.</p><h3>Simplifying NodeGroup Management with Helm</h3><p>Before Karpenter, managing NodeGroups with IaC required repetitive specifications. Our Helm template now allows us to define global and local specifications per NodeGroup, automatically add labels, tags, and taints, and easily create lists of NodeGroups and specify overrides.</p><p>The template is built to allow you to simply create a list of objects representing your NodeGroups and specify overrides where needed. For example — you might want to specify a different AMIFamily or IAM-Role/Instance-Profile for a specific NodeGroup (NodePool)</p><p>You are welcome to check out our implementation example <a href="https://github.com/fiverr/public_charts/tree/master/charts/karpenter_nodes/examples">HERE</a>.</p><p>For those using ArgoCD, we recommend ignoring nodeClaims to avoid browser performance issues.</p><pre>resource.exclusions: |<br>  - apiGroups:<br>    - &quot;karpenter.sh&quot;<br>    kinds:<br>    - &quot;NodeClaim&quot;</pre><h3>The bottom line</h3><p>Migrating to Karpenter has transformed our Kubernetes operations at Fiverr, making our system more efficient, resilient, and easier to manage.</p><p>We use the following values files for the template to make it easily readable and re-usable.</p><p><strong>common.yaml </strong>— this is where we specify the most common specifications for all node groups (IAM, AMIFamily, EBS, Subnets, Availability Zones, Security Groups, etc).</p><p><strong>userdata.yaml </strong>— we can specify templated user data for all node groups.</p><p><strong>nodegroups.yaml</strong> — this has a list of all the NodeGroups (NodePools) we want to generate.</p><p>While you can check all the above in the example in the GitHub <a href="https://github.com/fiverr/public_charts/tree/master/charts/karpenter_nodes/examples">repo</a>, here is a glimpse:</p><pre>nodeGroups:<br>  nodes-default:<br>    autoTaint: &quot;false&quot;<br>    weight: 2<br>    instances:<br>      categories:<br>        - m<br>        - r<br>    capacitySpread:<br>      start: 1<br>      end: 5<br>  nodes-default-od:<br>    autoTaint: &quot;false&quot;<br>    nodeGroupLabel: nodes-default<br>    capacitySpread:<br>      start: 6<br>      end: 6<br>    instances:<br>      minGeneration: 5<br>      categories:<br>        - m<br>        - r<br>      capacityType:<br>        - on-demand<br>    nodeClassRef:<br>      name: nodes-default-amd64<br>  nodes-workers:<br>    weight: 2<br>    instances:<br>      categories:<br>        - m<br>        - r<br>    capacitySpread:<br>      start: 1<br>      end: 5<br>  nodes-workers-c:<br>    nodeGroupLabel: nodes-workers<br>    capacitySpread:<br>      start: 1<br>      end: 5<br>    instances:<br>      categories:<br>        - c<br>    nodeClassRef:<br>      name: nodes-workers-amd64<br>  nodes-canary:<br>    instances: {}<br>    capacitySpread:<br>      start: 1<br>      end: 5<br>  nodes-jobs:<br>    expireAfter: &quot;Never&quot;<br>    instances:<br>      capacityType:<br>        - on-demand<br>      cores:<br>        - &quot;8&quot;<br>        - &quot;16&quot;<br>    consolidationPolicy: &quot;WhenEmpty&quot;<br>    blockDeviceMappings:<br>      - deviceName: /dev/xvda<br>        ebs:<br>          deleteOnTermination: true<br>          encrypted: true<br>          iops: 9000<br>          throughput: 125<br>          volumeSize: 500Gi<br>          volumeType: gp3<br>  nodes-ingress:<br>    registryCache: &quot;false&quot;<br>    expireAfter: &quot;Never&quot;<br>    instances:<br>      architecture: &quot;multiarch&quot;<br>      capacityType:<br>        - on-demand<br>      minGeneration: 7<br>      cores:<br>        - &quot;8&quot;</pre><h4>Want to work on projects like these at Fiverr? Check out our open positions:</h4><p>Learn more about us <a href="https://www.fiverr.com/jobs/teams">https://www.fiverr.com/jobs/teams</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CL6IMa9plwYZY6oE9jrQSQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c278294bd9b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fiverr-engineering/the-karpenter-transformation-1c278294bd9b">The Karpenter Transformation</a> was originally published in <a href="https://medium.com/fiverr-engineering">Fiverr Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>