Skip to content

feat: Ability to set custom labels in kubernetes resources deployed by vcluster helm chart#3617

Open
scheibinger wants to merge 3 commits intoloft-sh:mainfrom
scheibinger:custom-labels-upstream
Open

feat: Ability to set custom labels in kubernetes resources deployed by vcluster helm chart#3617
scheibinger wants to merge 3 commits intoloft-sh:mainfrom
scheibinger:custom-labels-upstream

Conversation

@scheibinger
Copy link
Copy Markdown

What issue type does this pull request address? (keep at least one, remove the others)
/kind enhancement

What does this pull request do? Which issues does it resolve? (use resolves #<issue_number> if possible)
resolves #

Adds a way to set custom labels for kubernetes resources deployed by vcluster helm chart.

Problem: In my kubernetes environment, I need to set custom labels which are enforced by the policies in the cluster.

Please provide a short message that should be published in the vcluster release notes
Ability to set custom labels in kubernetes resources deployed by vcluster helm chart

What else do we need to know?

@scheibinger scheibinger requested a review from a team as a code owner March 2, 2026 14:34
Copy link
Copy Markdown
Member

@FabianKramm FabianKramm left a comment

Choose a reason for hiding this comment

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

I think what you want is a global labels similar to .Values.controlPlane.advanced.globalMetadata.annotations which fits better than reusing the statefulset labels

{{- $labels := merge dict .Values.controlPlane.statefulSet.labels }}
{{- if $labels }}
{{ toYaml $labels | indent 4 }}
{{- end }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would rather want to do .Values.controlPlane.advanced.globalMetadata.labels here than reuse the statefulSet labels on a ClusterRole

chart: "{{ include "vcluster.version.label" $ }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- $labels := merge dict .Values.controlPlane.statefulSet.labels }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above

chart: "{{ include "vcluster.version.label" $ }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- $labels := merge dict .Values.controlPlane.statefulSet.labels }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above

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.

3 participants