diff --git a/.changeset/whole-aliens-argue.md b/.changeset/whole-aliens-argue.md new file mode 100644 index 0000000..663e864 --- /dev/null +++ b/.changeset/whole-aliens-argue.md @@ -0,0 +1,5 @@ +--- +"helm-charts": patch +--- + +feat: allow setting podLabels on hyperdx Pods diff --git a/charts/clickstack/templates/hyperdx/deployment.yaml b/charts/clickstack/templates/hyperdx/deployment.yaml index 1ff3834..8a9aa10 100644 --- a/charts/clickstack/templates/hyperdx/deployment.yaml +++ b/charts/clickstack/templates/hyperdx/deployment.yaml @@ -30,6 +30,9 @@ spec: labels: {{- include "clickstack.selectorLabels" . | nindent 8 }} app: {{ include "clickstack.fullname" . }} + {{- with .Values.hyperdx.deployment.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} annotations: {{- if $podAnnotations }} {{- with $podAnnotations }} diff --git a/charts/clickstack/tests/hyperdx-deployment_test.yaml b/charts/clickstack/tests/hyperdx-deployment_test.yaml index 242e3fc..20b6cba 100644 --- a/charts/clickstack/tests/hyperdx-deployment_test.yaml +++ b/charts/clickstack/tests/hyperdx-deployment_test.yaml @@ -158,7 +158,39 @@ tests: content: environment: production team: platform - + + - it: should add custom pod labels when podLabels is provided + set: + hyperdx: + deployment: + podLabels: + environment: production + team: platform + asserts: + - isSubset: + path: spec.template.metadata.labels + content: + environment: production + team: platform + + - it: should keep deployment and pod labels separate + set: + hyperdx: + deployment: + labels: + example.com/scope: deployment + podLabels: + example.com/scope: pod + asserts: + - isSubset: + path: metadata.labels + content: + example.com/scope: deployment + - isSubset: + path: spec.template.metadata.labels + content: + example.com/scope: pod + - it: should add custom environment variables when provided set: hyperdx: diff --git a/charts/clickstack/values.yaml b/charts/clickstack/values.yaml index 429948f..71f1784 100644 --- a/charts/clickstack/values.yaml +++ b/charts/clickstack/values.yaml @@ -180,6 +180,8 @@ hyperdx: # podAnnotations takes precedence when both maps contain the same key. annotations: {} labels: {} + # Labels applied to the HyperDX pod template metadata. + podLabels: {} env: [] # Additional init containers to run before the HyperDX container starts. # Useful for fetching certificates, warming caches, or other startup tasks.