Skip to content
Merged
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/nine-dingos-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": patch
---

feat: improve availability of HyperDX pods
11 changes: 11 additions & 0 deletions charts/hdx-oss-v2/templates/hyperdx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ spec:
tolerations:
{{- toYaml .Values.hyperdx.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.hyperdx.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.hyperdx.topologySpreadConstraints | nindent 8 }}
{{- end }}
{{- if .Values.hyperdx.priorityClassName }}
priorityClassName: {{ .Values.hyperdx.priorityClassName | quote }}
{{- end }}
{{- if .Values.mongodb.enabled }}
initContainers:
- name: wait-for-mongodb
Expand All @@ -53,6 +60,10 @@ spec:
containerPort: {{ .Values.hyperdx.apiPort }}
- name: opamp-port
containerPort: {{ .Values.hyperdx.opampPort }}
{{- if .Values.hyperdx.resources }}
resources:
{{- toYaml .Values.hyperdx.resources | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "hdx-oss.fullname" . }}-app-config
Expand Down
20 changes: 20 additions & 0 deletions charts/hdx-oss-v2/templates/hyperdx-pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.hyperdx.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "hdx-oss.fullname" . }}-pdb
labels:
{{- include "hdx-oss.labels" . | nindent 4 }}
app: {{ include "hdx-oss.fullname" . }}
{{- if .Values.hyperdx.labels }}
{{- with .Values.hyperdx.labels }}
{{- toYaml . | nindent 4 }}
{{- end -}}
{{- end }}
spec:
minAvailable: {{ .Values.hyperdx.podDisruptionBudget.minAvailable | default 1 }}
selector:
matchLabels:
{{- include "hdx-oss.selectorLabels" . | nindent 6 }}
app: {{ include "hdx-oss.fullname" . }}
{{- end }}
51 changes: 50 additions & 1 deletion charts/hdx-oss-v2/tests/app-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,53 @@ tests:
asserts:
- equal:
path: spec.replicas
value: 3
value: 3

- it: should set topology spread constraints when specified
set:
hyperdx:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
foo: bar
asserts:
- contains:
path: spec.template.spec.topologySpreadConstraints
content:
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
foo: bar

- it: should set priority class name when specified
set:
hyperdx:
priorityClassName: system-node-critical
asserts:
- equal:
path: spec.template.spec.priorityClassName
value: system-node-critical

- it: should set container resources when specified
set:
hyperdx:
resources:
limits:
memory: 1Gi
requests:
cpu: 100m
memory: 256Mi
asserts:
- equal:
path: spec.template.spec.containers[0].resources
value:
limits:
memory: 1Gi
requests:
cpu: 100m
memory: 256Mi
29 changes: 29 additions & 0 deletions charts/hdx-oss-v2/tests/app-pdb_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
suite: Test HyperDX App PodDisruptionBudget
templates:
- hyperdx-pdb.yaml
tests:
- it: should render the app pdb when enabled
set:
hyperdx:
podDisruptionBudget:
enabled: true
asserts:
- isKind:
of: PodDisruptionBudget
- equal:
path: spec.minAvailable
value: 1
- matchRegex:
path: metadata.name
pattern: -pdb$

- it: should override minimum available replicas when specified
set:
hyperdx:
podDisruptionBudget:
enabled: true
minAvailable: 5
asserts:
- equal:
path: spec.minAvailable
value: 5
3 changes: 3 additions & 0 deletions charts/hdx-oss-v2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ hyperdx:

replicas: 1

podDisruptionBudget:
enabled: false

# Service configuration
service:
type: ClusterIP # Use ClusterIP for security. For external access, use ingress with proper TLS and authentication
Expand Down