diff --git a/deploy/charts/buzz/Chart.yaml b/deploy/charts/buzz/Chart.yaml index 9309074895..6e15837f09 100644 --- a/deploy/charts/buzz/Chart.yaml +++ b/deploy/charts/buzz/Chart.yaml @@ -7,7 +7,7 @@ description: | PostgreSQL and Redis. Configurable for single-node evaluation (subcharts on) and HA production (external services, existingSecret). type: application -version: 0.1.7 +version: 0.1.8 appVersion: "0.1.0" home: https://github.com/block/buzz sources: diff --git a/deploy/charts/buzz/templates/deployment.yaml b/deploy/charts/buzz/templates/deployment.yaml index 67a93138c5..b86117ef96 100644 --- a/deploy/charts/buzz/templates/deployment.yaml +++ b/deploy/charts/buzz/templates/deployment.yaml @@ -101,6 +101,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.relay.containerSecurityContext | nindent 12 }} + {{- with .Values.relay.lifecycle }} + lifecycle: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.relay.command }} command: {{- toYaml . | nindent 12 }} diff --git a/deploy/charts/buzz/tests/render_test.yaml b/deploy/charts/buzz/tests/render_test.yaml index cf08210781..cabf46400f 100644 --- a/deploy/charts/buzz/tests/render_test.yaml +++ b/deploy/charts/buzz/tests/render_test.yaml @@ -30,6 +30,12 @@ tests: path: kind value: Service template: templates/service.yaml + - equal: + path: spec.template.spec.containers[0].lifecycle.preStop.exec.command + value: + - sleep + - "5" + template: templates/deployment.yaml - notContains: path: spec.template.spec.containers[0].env content: diff --git a/deploy/charts/buzz/values.schema.json b/deploy/charts/buzz/values.schema.json index 9cb6a02c9b..daf3861752 100644 --- a/deploy/charts/buzz/values.schema.json +++ b/deploy/charts/buzz/values.schema.json @@ -73,6 +73,10 @@ "items": { "type": "string" } }, "ephemeralTtlOverride": { "type": "integer", "minimum": 0 }, + "lifecycle": { + "type": "object", + "description": "Kubernetes lifecycle hooks for the relay container." + }, "command": { "type": "array", "items": { "type": "string" }, diff --git a/deploy/charts/buzz/values.yaml b/deploy/charts/buzz/values.yaml index 810f8a9658..2d086ff646 100644 --- a/deploy/charts/buzz/values.yaml +++ b/deploy/charts/buzz/values.yaml @@ -101,6 +101,10 @@ secrets: # ── Relay behavior ─────────────────────────────────────────────────────────── relay: + lifecycle: + preStop: + exec: + command: ["sleep", "5"] bindAddr: "0.0.0.0:3000" maxConnections: 10000 maxConcurrentHandlers: 1024