Pulse/deploy/helm/pulse/templates/deployment.yaml
rcourtman e4c17777d0 feat: Add deployment strategy configuration to Helm chart
Added strategy.type option to values.yaml (default: RollingUpdate) to allow
users to configure the deployment strategy. Users with ReadWriteOnce (RWO)
persistent volumes should set this to "Recreate" to avoid Multi-Attach errors
during upgrades.

Related to #1057
2026-01-07 17:57:41 +00:00

145 lines
5.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pulse.fullname" . }}
labels:
{{- include "pulse.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: {{ .Values.strategy.type | default "RollingUpdate" }}
selector:
matchLabels:
{{- include "pulse.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "pulse.selectorLabels" . | nindent 8 }}
{{- with .Values.server.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $podAnnotations := merge (dict) .Values.podAnnotations .Values.server.podAnnotations }}
{{- if $podAnnotations }}
annotations:
{{- toYaml $podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "pulse.serviceAccountName" . }}
{{- $podSecurityContext :=
ternary
(merge (dict) .Values.podSecurityContext .Values.server.podSecurityContext)
.Values.server.podSecurityContext
.Values.podSecurityContext.enabled }}
{{- if $podSecurityContext }}
securityContext:
{{- omit $podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: pulse
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 7655
{{- $containerSecurityContext :=
ternary
(merge (dict) .Values.containerSecurityContext .Values.server.securityContext)
.Values.server.securityContext
.Values.containerSecurityContext.enabled }}
{{- if $containerSecurityContext }}
securityContext:
{{- omit $containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- $envList := list }}
{{- range .Values.server.env }}
{{- $envList = append $envList . }}
{{- end }}
{{- range .Values.server.extraEnv }}
{{- $envList = append $envList . }}
{{- end }}
{{- $secret := .Values.server.secretEnv }}
{{- $secretKeys := list }}
{{- if $secret.keys }}
{{- $secretKeys = $secret.keys }}
{{- else if $secret.data }}
{{- $secretKeys = keys $secret.data }}
{{- end }}
{{- $root := . }}
{{- range $key := $secretKeys }}
{{- $envList = append $envList (dict "name" $key "valueFrom" (dict "secretKeyRef" (dict "name" (include "pulse.serverSecretName" $root) "key" $key))) }}
{{- end }}
{{- if $envList }}
env:
{{- toYaml $envList | nindent 12 }}
{{- end }}
{{- $envFrom := concat .Values.server.envFrom .Values.server.extraEnvFrom }}
{{- if $envFrom }}
envFrom:
{{- range $envFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumeMounts:
- name: data
mountPath: /data
{{- with .Values.server.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.server.livenessProbe }}
{{- if .enabled }}
livenessProbe:
httpGet:
path: {{ .path }}
port: http
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
failureThreshold: {{ .failureThreshold }}
{{- end }}
{{- end }}
{{- with .Values.server.readinessProbe }}
{{- if .enabled }}
readinessProbe:
httpGet:
path: {{ .path }}
port: http
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
failureThreshold: {{ .failureThreshold }}
{{- end }}
{{- end }}
{{- with .Values.server.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: data
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
persistentVolumeClaim:
claimName: {{ include "pulse.fullname" . }}
{{- else if and .Values.persistence.enabled .Values.persistence.existingClaim }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.server.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}