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

helm: Template CRDs directly to get standard k8s labels #2516

Closed

Conversation

lambdanis
Copy link
Contributor

So far CRDs were included in the Helm chart like this:

  1. Copy into crds-yaml directory
  2. Concatenate in a template using .Files.Get

With such approach, Helm doesn't add standard k8s "app.kubernetes.io/*" labels (e.g. version, managed-by) to CRDs like it does for other resources. Having these labels is useful from the operational perspective, so this commit changes how CRDs are included in the Helm chart. It now works like this:

  1. Copy inside the templates directory
  2. Wrap each CRD in an if block to check if it should be included

So far CRDs were included in the Helm chart like this:
1. Copy into crds-yaml directory
2. Concatenate in a template using .Files.Get

With such approach, Helm doesn't add standard k8s "app.kubernetes.io/*" labels
(e.g. version, managed-by) to CRDs like it does for other resources. Having
these labels is useful from the operational perspective, so this commit changes
how CRDs are included in the Helm chart. It now works like this:
1. Copy inside the templates directory
2. Wrap each CRD in an if block to check if it should be included

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
@lambdanis lambdanis added release-note/minor This PR introduces a minor user-visible change area/helm Related to the Helm chart labels Jun 5, 2024
@lambdanis lambdanis requested review from mtardy and a team as code owners June 5, 2024 12:54
Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 23a8b3d
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/6660600fab93a500086e7b52
😎 Deploy Preview https://deploy-preview-2516--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

looks like helm 🧙!

@lambdanis lambdanis marked this pull request as draft June 14, 2024 10:48
@lambdanis
Copy link
Contributor Author

I'll close this PR and open another one. The approach here won't work for my use cases I'm afraid.

@lambdanis lambdanis closed this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Related to the Helm chart release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants