Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(helm): MEMORY_LIMIT env for custom controller container name #7700

Merged

Conversation

flavono123
Copy link
Contributor

Fixes #7650

Description

the value controller.containerName is supported #7384, but not for relevant env set by downward api.

  1. fix the env MEMORY_LIMIT to refer controller.containerName if set
  2. pull up both container name and env to the helper function

How was this change tested?

❯ helm template charts/karpenter --set controller.containerName="custom-name" 2>/dev/null | yq '...comments="" | select(.kind=="Deployment").spec.template.spec.containers[0].env[] | select(.name=="MEMORY_LIMIT")' 
name: MEMORY_LIMIT
valueFrom:
  resourceFieldRef:
    containerName: custom-name
    divisor: "0"
    resource: limits.memory

❯ helm template charts/karpenter --set controller.containerName="custom-name" 2>/dev/null | yq '...comments="" | select(.kind=="Deployment").spec.template.spec.containers[0].name' 
custom-name

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@flavono123 flavono123 requested a review from a team as a code owner February 6, 2025 10:14
@flavono123 flavono123 requested a review from jigisha620 February 6, 2025 10:14
Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit e6bc1b4
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67a5a8ac9570bb000884f4a7

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jonathan-innis jonathan-innis enabled auto-merge (squash) February 7, 2025 06:15
@coveralls
Copy link

coveralls commented Feb 7, 2025

Pull Request Test Coverage Report for Build 13194524531

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 64.926%

Files with Coverage Reduction New Missed Lines %
pkg/fake/utils.go 2 94.81%
Totals Coverage Status
Change from base Build 13191304092: -0.02%
Covered Lines: 5805
Relevant Lines: 8941

💛 - Coveralls

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/karpenter snapshot

@jonathan-innis jonathan-innis merged commit ed5f461 into aws:main Feb 7, 2025
17 checks passed
@flavono123 flavono123 deleted the fix/template-container-name-in-heml-chart branch February 7, 2025 08:12
edibble21 pushed a commit to edibble21/karpenter-provider-aws that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing ContainerName to helm charts causes CreateContainerConfigError
3 participants