Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/expose-hyperdx-deployment-annotations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": minor
---

Add explicit `hyperdx.deployment.deploymentAnnotations` and `hyperdx.deployment.podAnnotations` values while preserving `hyperdx.deployment.annotations` as a deprecated pod annotation alias. When both pod annotation values contain the same key, `podAnnotations` takes precedence.
9 changes: 7 additions & 2 deletions charts/clickstack/templates/hyperdx/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{{- $podAnnotations := mergeOverwrite (dict) (default (dict) .Values.hyperdx.deployment.annotations) (default (dict) .Values.hyperdx.deployment.podAnnotations) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "clickstack.hyperdx.fullname" . }}
{{- with .Values.hyperdx.deployment.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "clickstack.labels" . | nindent 4 }}
app: {{ include "clickstack.fullname" . }}
Expand All @@ -24,8 +29,8 @@ spec:
{{- include "clickstack.selectorLabels" . | nindent 8 }}
app: {{ include "clickstack.fullname" . }}
annotations:
{{- if .Values.hyperdx.deployment.annotations }}
{{- with .Values.hyperdx.deployment.annotations }}
{{- if $podAnnotations }}
{{- with $podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end -}}
{{- end }}
Expand Down
50 changes: 49 additions & 1 deletion charts/clickstack/tests/hyperdx-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ tests:
asserts:
- isKind:
of: Deployment
- isNull:
path: metadata.annotations
- equal:
path: spec.replicas
value: 1
Expand Down Expand Up @@ -42,7 +44,7 @@ tests:
path: spec.replicas
value: 3

- it: should add custom annotations when provided
- it: should preserve the deprecated annotations alias for pod annotations
set:
hyperdx:
deployment:
Expand All @@ -55,6 +57,52 @@ tests:
content:
prometheus.io/scrape: "true"
prometheus.io/port: "3000"

- it: should add custom pod annotations when podAnnotations is provided
set:
hyperdx:
deployment:
podAnnotations:
example.com/pod: "enabled"
asserts:
- isSubset:
path: spec.template.metadata.annotations
content:
example.com/pod: "enabled"

- it: should keep deployment and pod annotations separate
set:
hyperdx:
deployment:
deploymentAnnotations:
example.com/configuration: deployment
podAnnotations:
example.com/configuration: pod
asserts:
- isSubset:
path: metadata.annotations
content:
example.com/configuration: deployment
- isSubset:
path: spec.template.metadata.annotations
content:
example.com/configuration: pod

- it: should prefer podAnnotations over the deprecated annotations alias
set:
hyperdx:
deployment:
annotations:
example.com/configuration: legacy
example.com/legacy: preserved
podAnnotations:
example.com/configuration: explicit
asserts:
- isSubset:
path: spec.template.metadata.annotations
content:
example.com/configuration: explicit
example.com/legacy: preserved

- it: should add custom labels when provided
set:
Expand Down
6 changes: 6 additions & 0 deletions charts/clickstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ hyperdx:
tolerations: []
topologySpreadConstraints: []
priorityClassName: ""
# Annotations applied to the HyperDX Deployment metadata.
deploymentAnnotations: {}
# Annotations applied to the HyperDX pod template metadata.
podAnnotations: {}
# Deprecated: use podAnnotations. Retained for backward compatibility;
# podAnnotations takes precedence when both maps contain the same key.
annotations: {}
labels: {}
env: []
Expand Down
Loading