<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Karpenter – Contributing</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/</link><description>Recent content in Contributing on Karpenter</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/index.xml" rel="self" type="application/rss+xml"/><item><title>V1.0: Community Meetings</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/community-meetings/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/community-meetings/</guid><description>
&lt;p>Karpenter hosts two types of regular community meetings to foster collaboration and maintain project health:&lt;/p>
&lt;p>The &lt;strong>Working Group&lt;/strong> meetings focus on project direction, technical discussions, and feature development. These bi-weekly sessions bring together contributors, users, and maintainers to review designs, plan releases, and address architectural decisions that shape Karpenter&amp;rsquo;s future.&lt;/p>
&lt;p>The &lt;strong>Issue Triage&lt;/strong> meetings, held weekly, are dedicated to maintaining project health through focused issue management across our repositories. These sessions ensure proper prioritization, assignment coordination, and timely response to community contributions.&lt;/p>
&lt;p>Meeting times alternate to accommodate our global community. All interested participants are welcome to join, contribute, and learn more about Karpenter.&lt;/p>
&lt;h3 id="working-group-meetings">Working Group Meetings&lt;/h3>
&lt;p>The Karpenter Working Group meetings serve as a collaborative forum for project development, technical discussions, and community engagement. These sessions bring together contributors, users, and maintainers to shape the project&amp;rsquo;s direction and ensure its continued success. Through these meetings, we align on architectural decisions, review critical features, and address community needs.&lt;/p>
&lt;p>Key focus areas include:&lt;/p>
&lt;ul>
&lt;li>Review and discussion of design proposals and technical implementations&lt;/li>
&lt;li>Planning of upcoming releases and feature roadmaps&lt;/li>
&lt;li>Coordination between contributors and cross-team collaboration&lt;/li>
&lt;li>Technical deep-dives on specific components and challenges&lt;/li>
&lt;li>Discussion of user feedback and community requirements&lt;/li>
&lt;/ul>
&lt;p>The working group provides a platform for both synchronous decision-making and asynchronous follow-ups, ensuring the project maintains its technical excellence while growing its community impact.&lt;/p>
&lt;p>Working group meetings will be held every other Thursday, alternating between a 3:00 PM PST (Americas-friendly) and 9:00 AM PST (Europe-friendly) start time.
Please refer to our &lt;a href="https://calendar.google.com/calendar/u/0?cid=N3FmZGVvZjVoZWJkZjZpMnJrMmplZzVqYmtAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ">calendar&lt;/a> for an up-to-date schedule.&lt;/p>
&lt;h3 id="issue-triage-meetings">Issue Triage Meetings&lt;/h3>
&lt;p>Karpenter is expanding our community meetings to include dedicated Issue Triage sessions alongside our regular Working Group meetings. This addition aims to improve issue management across both kubernetes-sigs/karpenter and karpenter-provider-aws repositories.&lt;/p>
&lt;p>These weekly meetings rotate between repositories and time zones to accommodate our global community. These dedicated triage sessions focus on:&lt;/p>
&lt;ul>
&lt;li>Issue prioritization&lt;/li>
&lt;li>Assignment coordination&lt;/li>
&lt;li>Discussion of complex issues&lt;/li>
&lt;li>Maintaining repository health&lt;/li>
&lt;/ul>
&lt;p>An issue triage meeting for each repository will be held monthly, alternating between a 3:00 PM PST (Americas-friendly) and 9:00 AM PST (Europe-friendly) start time.
Please refer to our &lt;a href="https://calendar.google.com/calendar/u/0?cid=N3FmZGVvZjVoZWJkZjZpMnJrMmplZzVqYmtAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ">calendar&lt;/a> for an up-to-date schedule.&lt;/p>
&lt;h3 id="getting-involved">Getting Involved&lt;/h3>
&lt;p>All community members are welcome to join these meetings. Meeting links and calendar invites are shared through our usual communication channels.&lt;/p>
&lt;ul>
&lt;li>All invites are managed through our &lt;a href="https://calendar.google.com/calendar/u/0?cid=N3FmZGVvZjVoZWJkZjZpMnJrMmplZzVqYmtAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ">Calendar&lt;/a>.&lt;/li>
&lt;li>Alternatively, you can use our &lt;a href="https://calendar.google.com/calendar/ical/7qfdeof5hebdf6i2rk2jeg5jbk%40group.calendar.google.com/public/basic.ics">iCal Export&lt;/a> to add the events to Outlook or other email providers.&lt;/li>
&lt;/ul>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Meeting Access&lt;/h4>
&lt;p>Join our meetings using the following credentials:&lt;/p>
&lt;p>🔗 &lt;strong>Zoom&lt;/strong>: &lt;a href="https://zoom.us/j/95618088729">https://zoom.us/j/95618088729&lt;/a>
🆔 &lt;strong>Meeting ID&lt;/strong>: 956 1808 8729
🔑 &lt;strong>Passcode&lt;/strong>: 77777&lt;/p>
&lt;p>Need help? Contact the maintainers on Slack.&lt;/p>
&lt;/div>
&lt;p>Add future questions or read past discussions in our &lt;a href="https://docs.google.com/document/d/18BT0AIMugpNpiSPJNlcAL2rv69yAE6Z06gUVj7v_clg">Working Group Log&lt;/a>.&lt;/p></description></item><item><title>V1.0: Design Guide</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/design-guide/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/design-guide/</guid><description>
&lt;p>Technical designs are essential to building robust, intuitive, and performant products that delight users. Writing a design can accelerate decision making and avoid wasting time on an implementation that never lands. But what makes a good design? These guidelines were authored with the Karpenter community in mind, but apply broadly to the development of Kubernetes Operators.&lt;/p>
&lt;p>Designs don’t have to be long or formal, and should match the scope of the problem they’re trying to solve.&lt;/p>
&lt;ul>
&lt;li>Are there multiple potential solutions?&lt;/li>
&lt;li>Will users need to be aware of the changes?&lt;/li>
&lt;li>Would it be painful to discard a rejected implementation?&lt;/li>
&lt;li>When in doubt, write a 1 pager.&lt;/li>
&lt;/ul>
&lt;h2 id="tell-a-story">Tell a Story&lt;/h2>
&lt;p>A design is a story that connects a user need with a technical direction that solves the need. Designs come in all shapes and sizes, and this document intentionally avoids prescribing a one-size-fits-all template. There’s no substitute for an author thinking deeply about a problem space, and mapping that to a clear story that walks readers through the ideas and helps them reason about a solution space. Keep readers engaged with concise language and make every word count.&lt;/p>
&lt;p>Your story should include,&lt;/p>
&lt;ul>
&lt;li>[Context] Include some technical background that helps readers think about your idea in context&lt;/li>
&lt;li>[Problem] Clearly identify the problem to be solved and some guiding principles to help think about the solutions&lt;/li>
&lt;li>[Solutions] Talk through different potential solutions and their tradeoffs. Include diagrams to clarify concepts&lt;/li>
&lt;li>[Recommendation] Make a recommendation, but don’t be overly invested in it&lt;/li>
&lt;/ul>
&lt;p>The best way to improve your story telling skills is to write and review designs. Seek inspiration from recent designs in the project as well as from other domains. Focus on your audience and continuously reread and refine your design with their perspective in mind.&lt;/p>
&lt;h2 id="gather-broad-feedback">Gather Broad Feedback&lt;/h2>
&lt;p>The bigger the change, the more likely your design will have broader implications than intended. Be vocal about design ideas as they’re explored and run them by engineering leaders in relevant systems. Surface your design ideas at the Karpenter working group, or asynchronously on the &lt;a href="https://kubernetes.slack.com/archives/C02SFFZSA2K">Kubernetes Slack channel for Karpenter&lt;/a>.&lt;/p>
&lt;p>The Kubernetes community is also a valuable source of feedback from both users and Kubernetes developers. Does your design touch scoped owned by any Kubernetes SIGs? Consider discussing the design ideas at the SIG or in their slack channel. Socializing high level ideas before the review gives your audience more time to think about possible interactions with existing and future systems.&lt;/p>
&lt;p>It can be tempting to rush to solutions that unblock user adoption or ease user pain, but the wrong solution can have a greater negative impact on users than it solves. It’s impossible to know all future use cases and how your design choices may impact them, but the more thorough your investigation, the more likely your solution is to deliver long term value.&lt;/p>
&lt;h2 id="simple-solutions-to-complex-problems">Simple Solutions to Complex Problems&lt;/h2>
&lt;p>The best solutions are invisible to users and “Just Work™”. It’s easy to forget that users have business problems to focus on and each parameter and behavior your design introduces increases user cognitive load. Pragmatically, it’s not always possible to meet the broad requirements of Kubernetes without providing options, but solution spaces typically include a spectrum of configuration complexity. Recognize that a solution for one user segment may be directly at odds with another or create long term technical debt for the project. Often, requirements only exist to workaround bugs or missing features in related systems. Deep dive requirements until you’re certain they’re necessary and ensure each bit of complexity justifies its existence.&lt;/p>
&lt;h2 id="common-gotchas">Common Gotchas&lt;/h2>
&lt;h3 id="does-your-change-introduce-new-apis">Does your change introduce new APIs?&lt;/h3>
&lt;p>APIs are notoriously hard to get right and even harder to change. Kubernetes defines an &lt;a href="https://kubernetes.io/docs/reference/using-api/deprecation-policy/">api deprecation policy&lt;/a> that helps systems make backwards incompatible changes to APIs before graduating to a stable API with compatibility guarantees. Once an API is stable, features are typically via &lt;a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/">feature gates&lt;/a>, which allows for experimentation and deprecation.&lt;/p>
&lt;p>Think about how your API changes impact existing parameters and their deprecation policies. Consider how the user interacts with the product as a whole and if the feature supersedes or overlaps with existing concepts. Weigh the costs of deprecating existing features to the benefit of simplifying the product for all future users. The answer will change depending on the maturity of the product and breadth of adoption.&lt;/p>
&lt;p>Build minimal and maintainable APIs by:&lt;/p>
&lt;ul>
&lt;li>Push back on requirements that introduces concepts for all users to solve problems for a few.&lt;/li>
&lt;li>Identify an opinionated default that solves the majority of use cases.&lt;/li>
&lt;li>Delay introducing a parameter into your API surface until users demand it; you can always add it later.&lt;/li>
&lt;li>Rely on existing concepts and idioms from the Kubernetes ecosystem. Look to &lt;a href="https://pkg.go.dev/k8s.io/api/core/v1">Kubernetes APIs&lt;/a> and projects like &lt;a href="https://github.com/tektoncd/cli">Tekton&lt;/a>, &lt;a href="https://github.com/knative/serving">Knative&lt;/a>, and &lt;a href="https://github.com/aws-controllers-k8s">ACK&lt;/a> and find concepts that will be familiar to users.&lt;/li>
&lt;li>Take advantage of opportunities to refine APIs while the impact of backwards incompatibility is small&lt;/li>
&lt;/ul>
&lt;h3 id="does-your-change-behave-differently-with-different-cloud-providers">Does your change behave differently with different cloud providers?&lt;/h3>
&lt;p>Kubernetes is an open standard that users rely on to work across vendors. Users care deeply about this, as it minimizes the technical complexity to operate in different environments. Identify whether or not your feature varies across cloud providers or are bespoke to a specific provider. For some features, it’s possible to rely on existing vendor neutral abstractions. For others, it’s possible to define a neutral abstraction that cloud providers can implement.&lt;/p>
&lt;p>Achieving consensus for new neutral concepts is hard. Often, the best path is to demonstrate value on a single vendor, and work to achieve neutrality as a followup effort. Be cautious about introducing or changing vendor neutral interfaces, as it will require changes from all providers. Similarly, invest heavily in getting these interfaces right in the early stages. As projects mature, these interfaces are rarely changed.&lt;/p>
&lt;h3 id="does-your-change-expose-details-users-may-rely-on">Does your change expose details users may rely on?&lt;/h3>
&lt;p>Kubernetes based systems often use a layered architectural pattern that exposes underlying layers of abstraction. This approach enables broad extensibility and allows other systems to integrate at multiple layers of the stack. For example, Karpenter creates EC2 instances in your AWS account. This enables you to view logs or react to their creation with other automation without requiring any features from Karpenter. However, Karpenter also applies specific EC2 tags to the EC2 instances. Are the tags an implementation detail or an interface? What can you change without breaking compatibility?&lt;/p>
&lt;p>Be intentional and explicit about the interface and implementation of your design and ensure that this is communicated to users. If implementation details are exposed through other APIs, expect users to rely on them as an interface unless told otherwise. In general, aim to minimize the project’s interface to maximize future flexibility.&lt;/p>
&lt;h3 id="does-your-change-have-a-risk-of-breaking-an-undocumented-invariant">Does your change have a risk of breaking an undocumented invariant?&lt;/h3>
&lt;p>Systems often contain mechanisms that are implicitly assumed as invariant, but may not be obvious, especially over time. Existing mechanisms may not be extensible enough to support your design, and may require them to be rewritten as part of the design scope. Be aware that regression tests never have complete coverage and well intentioned engineers thought carefully about how things were done before your requirements.&lt;/p>
&lt;ul>
&lt;li>Identify the fundamental reason the existing mechanism is insufficient and be able to explain it in plain terms.&lt;/li>
&lt;li>Separate the new mechanism from the new feature that relies on it.&lt;/li>
&lt;li>Clean up after yourself and avoid getting stuck halfway between old and new mechanisms.&lt;/li>
&lt;/ul>
&lt;h3 id="does-your-change-impact-performance">Does your change impact performance?&lt;/h3>
&lt;p>Users have high expectations for performance on Kubernetes. Karpenter is especially sensitive, as it has the potential to impact application availability during traffic spikes. Think about how your solution scales, and look for opportunities to improve performance at the design level. Often, good designs don’t require trading-off a great UX for performance. Make it work, make it fast, make it pretty.&lt;/p>
&lt;ul>
&lt;li>Beware code that scales linearly with pods or nodes. Milliseconds in testing turn into seconds at scale.&lt;/li>
&lt;li>Cloud provider read APIs can have surprisingly high latency and low limits, use caching to minimize calls.&lt;/li>
&lt;li>Increases to memory and CPU usage increase capex cost for operators. Profile and optimize your implementations.&lt;/li>
&lt;/ul></description></item><item><title>V1.0: Documentation Updates</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/documentation-updates/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/documentation-updates/</guid><description>
&lt;ul>
&lt;li>Documentation for &lt;a href="https://karpenter.sh/docs/">https://karpenter.sh/docs/&lt;/a> is built under website/content/en/preview/.&lt;/li>
&lt;li>Documentation updates should be made to the &amp;ldquo;preview&amp;rdquo; directory. Your changes will be promoted to website/content/en/docs/ by an automated process after the change has been merged.&lt;/li>
&lt;li>Previews for your changes are built and available a few minutes after you push. Look for the &amp;ldquo;netlify Deploy Preview&amp;rdquo; link in a comment in your PR.&lt;/li>
&lt;/ul></description></item><item><title>V1.0: Development Guide</title><link>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/development-guide/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/contributing/development-guide/</guid><description>
&lt;h2 id="dependencies">Dependencies&lt;/h2>
&lt;p>The following tools are required for contributing to the Karpenter project.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Package&lt;/th>
&lt;th>Version&lt;/th>
&lt;th>Install&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;a href="https://golang.org/dl/">go&lt;/a>&lt;/td>
&lt;td>v1.19+&lt;/td>
&lt;td>&lt;a href="https://golang.org/doc/install">Instructions&lt;/a>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">kubectl&lt;/a>&lt;/td>
&lt;td>&lt;/td>
&lt;td>&lt;code>brew install kubectl&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;a href="https://helm.sh/docs/intro/install/">helm&lt;/a>&lt;/td>
&lt;td>&lt;/td>
&lt;td>&lt;code>brew install helm&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Other tools&lt;/td>
&lt;td>&lt;/td>
&lt;td>&lt;code>make toolchain&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="developing">Developing&lt;/h2>
&lt;h3 id="setup--teardown">Setup / Teardown&lt;/h3>
&lt;p>Based on how you are running your Kubernetes cluster, follow the &lt;a href="#environment-specific-setup">Environment specific setup&lt;/a> to configure your environment before you continue. You can choose to either run the Karpenter controller locally on your machine, pointing to the Kubernetes cluster specified in your &lt;code>~/.kube/config&lt;/code> or inside the Kubernetes cluster specified in your &lt;code>~/.kube/config&lt;/code> deployed with &lt;a href="https://helm.sh/">Helm&lt;/a>.&lt;/p>
&lt;h4 id="locally">Locally&lt;/h4>
&lt;p>Once you have your environment set up, run the following commands to run the Karpenter Go binary against the Kubernetes cluster specified in your &lt;code>~/.kube/config&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make run
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="inside-a-kubernetes-cluster">Inside a Kubernetes Cluster&lt;/h4>
&lt;p>Once you have your environment set up, to install Karpenter in the Kubernetes cluster specified in your &lt;code>~/.kube/config&lt;/code> run the following commands.&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make apply &lt;span style="color:#8f5902;font-style:italic"># Install Karpenter&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>make delete &lt;span style="color:#8f5902;font-style:italic"># Uninstall Karpenter&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="developer-loop">Developer Loop&lt;/h3>
&lt;ul>
&lt;li>Make sure dependencies are installed
&lt;ul>
&lt;li>Run &lt;code>make codegen&lt;/code> to make sure yaml manifests are generated (requires a working set of AWS credentials, see &lt;a href="https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials">Specifying Credentials&lt;/a>)&lt;/li>
&lt;li>Run &lt;code>make toolchain&lt;/code> to install cli tools for building and testing the project&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>You will need a personal development image repository (e.g. ECR)
&lt;ul>
&lt;li>Make sure you have valid credentials to your development repository.&lt;/li>
&lt;li>&lt;code>$KO_DOCKER_REPO&lt;/code> must point to your development repository&lt;/li>
&lt;li>Your cluster must have permissions to read from the repository&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h3 id="build-and-deploy">Build and Deploy&lt;/h3>
&lt;p>&lt;em>Note: these commands do not rely on each other and may be executed independently&lt;/em>&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make apply &lt;span style="color:#8f5902;font-style:italic"># quickly deploy changes to your cluster&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>make presubmit &lt;span style="color:#8f5902;font-style:italic"># run codegen, lint, and tests&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you are only interested in building the Karpenter images and not deploying the updated release to your cluster immediately with Helm, you can run the following:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make image &lt;span style="color:#8f5902;font-style:italic"># build and push the karpenter images&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>*Note: that this will produce a build with the version of &lt;a href="https://github.com/kubernetes-sigs/karpenter">https://github.com/kubernetes-sigs/karpenter&lt;/a> in your local filesystem.&lt;/p>
&lt;p>You can test out changes made in &lt;a href="https://github.com/kubernetes-sigs/karpenter">https://github.com/kubernetes-sigs/karpenter&lt;/a> by replacing the dependency of &lt;a href="https://github.com/aws/karpenter-provider-aws/">https://github.com/aws/karpenter-provider-aws/&lt;/a>.
For local changes, replace &lt;code>$PATH_TO_KUBERNETES_SIGS_KARPENTER&lt;/code> with the relative or absolute path and run:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go mod edit -replace sigs.k8s.io/karpenter&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&lt;span style="color:#000">$PATH_TO_KUBERNETES_SIGS_KARPENTER&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then you can build your image using the previous steps.&lt;/p>
&lt;h3 id="publishing-images-only">Publishing Images Only&lt;/h3>
&lt;p>If you only need to build and publish an image to a container registry, run the following:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make image &lt;span style="color:#8f5902;font-style:italic"># build and push the karpenter images&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can test out changes made in &lt;a href="https://github.com/kubernetes-sigs/karpenter">https://github.com/kubernetes-sigs/karpenter&lt;/a> by replacing the dependency of &lt;a href="https://github.com/aws/karpenter-provider-aws/">https://github.com/aws/karpenter-provider-aws/&lt;/a>.
For local changes, replace &lt;code>$PATH_TO_KUBERNETES_SIGS_KARPENTER&lt;/code> with the relative or absolute path and run:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go mod edit -replace sigs.k8s.io/karpenter&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&lt;span style="color:#000">$PATH_TO_KUBERNETES_SIGS_KARPENTER&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then you can build your image using the previous steps.&lt;/p>
&lt;p>*Note: you need to commit the go.mod changes before running &lt;code>make image&lt;/code> for the changes to be picked up.&lt;/p>
&lt;h3 id="testing">Testing&lt;/h3>
&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make &lt;span style="color:#204a87">test&lt;/span> &lt;span style="color:#8f5902;font-style:italic"># E2E correctness tests&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="change-log-level">Change Log Level&lt;/h3>
&lt;p>By default, &lt;code>make apply&lt;/code> will set the log level to debug. You can change the log level by setting the log level in your Helm values.&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>--set &lt;span style="color:#000">logLevel&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>debug
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="debugging-metrics">Debugging Metrics&lt;/h3>
&lt;p>OSX:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>open http://localhost:8080/metrics &lt;span style="color:#ce5c00;font-weight:bold">&amp;amp;&amp;amp;&lt;/span> kubectl port-forward service/karpenter -n kube-system &lt;span style="color:#0000cf;font-weight:bold">8080&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Linux:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>gio open http://localhost:8080/metrics &lt;span style="color:#ce5c00;font-weight:bold">&amp;amp;&amp;amp;&lt;/span> kubectl port-forward service/karpenter -n karpenter &lt;span style="color:#0000cf;font-weight:bold">8080&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="tailing-logs">Tailing Logs&lt;/h3>
&lt;p>While you can tail Karpenter&amp;rsquo;s logs with kubectl, there&amp;rsquo;s a number of tools out there that enhance the experience. We recommend &lt;a href="https://pkg.go.dev/github.com/planetscale/stern#section-readme">Stern&lt;/a>:&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>stern -n karpenter -l app.kubernetes.io/name&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>karpenter
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="environment-specific-setup">Environment specific setup&lt;/h2>
&lt;h3 id="aws">AWS&lt;/h3>
&lt;p>For local development on Karpenter you will need a Docker repo which can manage your images for Karpenter components.
You can use the following command to provision an ECR repository. We recommend using a single &amp;ldquo;dev&amp;rdquo; repository for
development across multiple projects, and to use specific image hashes instead of image tags.&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>aws ecr create-repository &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --repository-name dev &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --image-scanning-configuration &lt;span style="color:#000">scanOnPush&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&lt;span style="color:#204a87">true&lt;/span> &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --region &lt;span style="color:#4e9a06">&amp;#34;&lt;/span>&lt;span style="color:#4e9a06">${&lt;/span>&lt;span style="color:#000">AWS_DEFAULT_REGION&lt;/span>&lt;span style="color:#4e9a06">}&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Once you have your ECR repository provisioned, configure your Docker daemon to authenticate with your newly created repository.&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-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87">export&lt;/span> &lt;span style="color:#000">KO_DOCKER_REPO&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;&lt;/span>&lt;span style="color:#4e9a06">${&lt;/span>&lt;span style="color:#000">AWS_ACCOUNT_ID&lt;/span>&lt;span style="color:#4e9a06">}&lt;/span>&lt;span style="color:#4e9a06">.dkr.ecr.&lt;/span>&lt;span style="color:#4e9a06">${&lt;/span>&lt;span style="color:#000">AWS_DEFAULT_REGION&lt;/span>&lt;span style="color:#4e9a06">}&lt;/span>&lt;span style="color:#4e9a06">.amazonaws.com/dev&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>aws ecr get-login-password --region &lt;span style="color:#4e9a06">&amp;#34;&lt;/span>&lt;span style="color:#4e9a06">${&lt;/span>&lt;span style="color:#000">AWS_DEFAULT_REGION&lt;/span>&lt;span style="color:#4e9a06">}&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;&lt;/span> &lt;span style="color:#000;font-weight:bold">|&lt;/span> docker login --username AWS --password-stdin &lt;span style="color:#4e9a06">&amp;#34;&lt;/span>&lt;span style="color:#4e9a06">${&lt;/span>&lt;span style="color:#000">KO_DOCKER_REPO&lt;/span>&lt;span style="color:#4e9a06">}&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="profiling">Profiling&lt;/h2>
&lt;p>Karpenter exposes a pprof endpoint on its metrics port when &lt;a href="https://pr-35.d2bgfookghzifw.amplifyapp.com/v1.0/reference/settings/">profiling&lt;/a> is enabled.&lt;/p>
&lt;p>Learn about profiling with pprof: &lt;a href="https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/">https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/&lt;/a>&lt;/p>
&lt;h3 id="prerequisites">Prerequisites&lt;/h3>
&lt;pre tabindex="0">&lt;code>brew install graphviz
go install github.com/google/pprof@latest
&lt;/code>&lt;/pre>&lt;h3 id="get-a-profile">Get a profile&lt;/h3>
&lt;pre tabindex="0">&lt;code># Connect to the metrics endpoint
kubectl port-forward service/karpenter -n karpenter 8080
open http://localhost:8080/debug/pprof/
# Visualize the memory
go tool pprof -http 0.0.0.0:9000 localhost:8080/debug/pprof/heap
# Visualize CPU
go tool pprof -http 0.0.0.0:9000 &amp;#34;localhost:8080/debug/pprof/profile?seconds=60&amp;#34;
&lt;/code>&lt;/pre></description></item></channel></rss>