Skip to content

Conversation

slntopp
Copy link
Contributor

@slntopp slntopp commented Jul 3, 2025

Description

When using Tetragon as a Helm dependency, all resources are named after the release name, causing:

  • Naming conflicts with parent application resources
  • Confusion when managing multiple releases
  • Resources appearing at the same level as the parent app instead of clearly being dependencies

Solution

Added tetragon.nameOverride and tetragonOperator.nameOverride fields to allow explicit control over resource naming independent of the Helm release name.

Benefits:

  • Prevents resource naming conflicts
  • Clearer separation between app and dependency resources
  • Better operational visibility in complex deployments
  • Follows standard Helm naming patterns

Example usage:

tetragon:
  nameOverride: "security-agent"
tetragonOperator:
  nameOverride: "security-operator"

This maintains backward compatibility (defaults to release name when empty) while solving the dependency naming pain point.

Changelog

  • adds nameOverride to tetragon and tetragonOperator Helm values.
  • adds helper templates and makes resources names dependent on tetragon and operator names
helm: add `tetragon.nameOverride` and `tetragonOperator.nameOverride`

@slntopp slntopp requested a review from a team as a code owner July 3, 2025 17:48
@slntopp slntopp requested a review from tixxdz July 3, 2025 17:48
Copy link

netlify bot commented Jul 3, 2025

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 5f79a22
🔍 Latest deploy log https://app.netlify.com/projects/tetragon/deploys/6878e777f72a4c0008b87fe7
😎 Deploy Preview https://deploy-preview-3864--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 project configuration.

@tixxdz tixxdz requested review from kkourt and michi-covalent July 7, 2025 09:29
@mtardy
Copy link
Member

mtardy commented Jul 7, 2025

Hey just fyi we have a draft PR opened for that #3604 which seems a bit abandoned. Will review this one thanks! :)

@michi-covalent michi-covalent added the release-note/minor This PR introduces a minor user-visible change label Jul 8, 2025
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

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

looks great 🥰

Resources names
*/}}
{{- define "tetragon.name" -}}
{{- default .Release.Name .Values.tetragon.nameOverride | trunc 63 | trimSuffix "-" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is trimSuffix needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most k8s object names and ids must start and end with alphanumeric chars, this is common failsafe.

You could theoretically set your release name or nameOverride to amazing-tetragon-deployment-named-long-with-dashes-because-why-not (66 chars), truncated to 63 would result into amazing-tetragon-deployment-named-long-with-dashes-because-why-, which would fail

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.

Overall looks good! Should you also update the remaining app.kubernetes.io/instance: {{ .Release.Name }} labels around?

@mtardy mtardy linked an issue Jul 15, 2025 that may be closed by this pull request
2 tasks
@slntopp
Copy link
Contributor Author

slntopp commented Jul 17, 2025

Best practice is for app.kubernetes.io/instance to be the same across all workloads deployed under the same release, so you can do things like kubectl get all -l app.kubernetes.io/instance=my-release

slntopp added 2 commits July 17, 2025 14:05
- adds `nameOverride` to tetragon and tetragonOperator Helm values.
- adds helper templates and makes resources names dependent on tetragon and operator names

Signed-off-by: Mikita Iwanowski <[email protected]>
@slntopp slntopp force-pushed the helm-chart-name-overrides branch from 0da7b72 to 5f79a22 Compare July 17, 2025 12:07
@slntopp slntopp requested a review from mtardy July 17, 2025 12:07
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.

All right thanks for the answers, let's merge this :)

@mtardy mtardy merged commit 2258168 into cilium:main Jul 17, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add nameOverride Variable to Helm Chart
4 participants