From eeef1034a01ca955ff55a5151499537a26cced85 Mon Sep 17 00:00:00 2001 From: ceejaykelly Date: Fri, 12 Sep 2025 10:59:38 +1000 Subject: [PATCH 1/5] Introduce an optional priorityClassName to the pods Signed-off-by: ceejaykelly --- .../templates/_helpers_20250912105725.tpl | 352 +++++++++++++++++ .../templates/_helpers_20250912105853.tpl | 355 ++++++++++++++++++ zammad/templates/_helpers.tpl | 3 + 3 files changed, 710 insertions(+) create mode 100644 .history/zammad/templates/_helpers_20250912105725.tpl create mode 100644 .history/zammad/templates/_helpers_20250912105853.tpl diff --git a/.history/zammad/templates/_helpers_20250912105725.tpl b/.history/zammad/templates/_helpers_20250912105725.tpl new file mode 100644 index 00000000..80c4e3a6 --- /dev/null +++ b/.history/zammad/templates/_helpers_20250912105725.tpl @@ -0,0 +1,352 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "zammad.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "zammad.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "zammad.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "zammad.labels" -}} +helm.sh/chart: {{ include "zammad.chart" . }} +{{ include "zammad.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.commonLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Pod labels +*/}} +{{- define "zammad.podLabels" -}} +{{ include "zammad.labels" . }} +{{- with .Values.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "zammad.selectorLabels" -}} +app.kubernetes.io/name: {{ include "zammad.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Common annotations +*/}} +{{- define "zammad.annotations" -}} +{{- with .Values.commonAnnotations }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Pod annotations +*/}} +{{- define "zammad.podAnnotations" -}} +{{ include "zammad.annotations" . }} +{{- with .Values.podAnnotations }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "zammad.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} +{{ default (include "zammad.fullname" .) .Values.serviceAccount.name }} +{{- else -}} +{{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +autowizard secret name +*/}} +{{- define "zammad.autowizardSecretName" -}} +{{- if .Values.secrets.autowizard.useExisting -}} +{{ .Values.secrets.autowizard.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.autowizard.secretName }} +{{- end -}} +{{- end -}} + +{{/* +elasticsearch secret name +*/}} +{{- define "zammad.elasticsearchSecretName" -}} +{{- if .Values.secrets.elasticsearch.useExisting -}} +{{ .Values.secrets.elasticsearch.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.elasticsearch.secretName }} +{{- end -}} +{{- end -}} + +{{/* +postgresql secret name +*/}} +{{- define "zammad.postgresqlSecretName" -}} +{{- if .Values.secrets.postgresql.useExisting -}} +{{ .Values.secrets.postgresql.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.postgresql.secretName }} +{{- end -}} +{{- end -}} + +{{/* +redis secret name +*/}} +{{- define "zammad.redisSecretName" -}} +{{- if .Values.secrets.redis.useExisting -}} +{{ .Values.secrets.redis.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.redis.secretName }} +{{- end -}} +{{- end -}} + +{{/* +S3 access URL +*/}} +{{- define "zammad.env.S3_URL" -}} +{{- with .Values.zammadConfig.minio.externalS3Url -}} +- name: S3_URL + value: {{ . | quote }} +{{- else -}} +{{- if .Values.zammadConfig.minio.enabled -}} +{{- if .Values.minio.auth.existingSecret -}} +- name: MINIO_ROOT_USER + valueFrom: + secretKeyRef: + key: root-user + name: {{ .Values.minio.auth.existingSecret }} +- name: MINIO_ROOT_PASSWORD + valueFrom: + secretKeyRef: + key: root-password + name: {{ .Values.minio.auth.existingSecret }} +- name: S3_URL + value: "http://$(MINIO_ROOT_USER):$(MINIO_ROOT_PASSWORD)@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" +{{- else -}} +- name: S3_URL + value: "http://{{ .Values.minio.auth.rootUser }}:{{ .Values.minio.auth.rootPassword }}@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" +{{- end -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +environment variables for the Zammad Rails stack +*/}} +{{- define "zammad.env" -}} +{{- if or .Values.zammadConfig.redis.pass .Values.secrets.redis.useExisting -}} +- name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "zammad.redisSecretName" . }} + key: {{ .Values.secrets.redis.secretKey }} +{{- end }} +- name: MEMCACHE_SERVERS + value: "{{ if .Values.zammadConfig.memcached.enabled }}{{ .Release.Name }}-memcached{{ else }}{{ .Values.zammadConfig.memcached.host }}{{ end }}:{{ .Values.zammadConfig.memcached.port }}" +- name: RAILS_TRUSTED_PROXIES + value: "{{ .Values.zammadConfig.railsserver.trustedProxies }}" +- name: REDIS_URL + value: "redis://:$(REDIS_PASSWORD)@{{ if .Values.zammadConfig.redis.enabled }}{{ .Release.Name }}-redis-master{{ else }}{{ .Values.zammadConfig.redis.host }}{{ end }}:{{ .Values.zammadConfig.redis.port }}" +- name: POSTGRESQL_PASS + valueFrom: + secretKeyRef: + name: {{ include "zammad.postgresqlSecretName" . }} + key: {{ .Values.secrets.postgresql.secretKey }} +- name: DATABASE_URL + value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}?{{ .Values.zammadConfig.postgresql.options }}" +{{ include "zammad.env.S3_URL" . }} +- name: TMP # All zammad containers need the possibility to create temporary files, e.g. for file uploads or image resizing. + value: {{ .Values.zammadConfig.railsserver.tmpdir }} +{{- with .Values.extraEnv }} +{{ toYaml . }} +{{- end }} +{{- if .Values.autoWizard.enabled }} +- name: AUTOWIZARD_RELATIVE_PATH + value: tmp/auto_wizard/auto_wizard.json +{{- end }} +{{- end -}} + +{{/* +environment variable to let Rails fail during startup if migrations are pending +*/}} +{{- define "zammad.env.failOnPendingMigrations" -}} +# Let containers fail if migrations are pending. +- name: RAILS_CHECK_PENDING_MIGRATIONS + value: 'true' +{{- end -}} + +{{/* +volume mounts for the Zammad Rails stack +*/}} +{{- define "zammad.volumeMounts" -}} +- name: {{ include "zammad.fullname" . }}-tmp + mountPath: /tmp +- name: {{ include "zammad.fullname" . }}-tmp + mountPath: /opt/zammad/tmp +{{- if .Values.zammadConfig.storageVolume.enabled }} +- name: {{ include "zammad.fullname" . }}-storage + mountPath: /opt/zammad/storage +{{- end -}} +{{- if .Values.autoWizard.enabled }} +- name: autowizard + mountPath: "/opt/zammad/tmp/auto_wizard" +{{- end }} +{{- with .Values.zammadConfig.customVolumeMounts }} +{{ toYaml . }} +{{- end -}} +{{- end -}} + +{{/* +volumes for the Zammad Rails stack +*/}} +{{- define "zammad.volumes" -}} +- name: {{ include "zammad.fullname" . }}-tmp + {{- toYaml .Values.zammadConfig.tmpDirVolume | nindent 2 }} +{{- if .Values.zammadConfig.storageVolume.enabled }} +{{- if .Values.zammadConfig.storageVolume.existingClaim }} +- name: {{ include "zammad.fullname" . }}-storage + persistentVolumeClaim: + claimName: {{ .Values.zammadConfig.storageVolume.existingClaim | default (include "zammad.fullname" .) }} +{{- else }} + {{ fail "Please provide an existing PersistentVolumeClaim with ReadWriteMany access if you enable .Values.zammadConfig.storageVolume." }} +{{- end -}} +{{- end -}} +{{- if .Values.autoWizard.enabled }} +- name: autowizard + secret: + secretName: {{ include "zammad.autowizardSecretName" . }} + items: + - key: {{ .Values.secrets.autowizard.secretKey }} + path: auto_wizard.json +{{- end }} +{{- with .Values.zammadConfig.customVolumes }} +{{ toYaml . }} +{{- end -}} +{{- end -}} + +{{/* +shared configuration for Zammad Pods +*/}} +{{- define "zammad.podSpec" -}} +{{- with .Values.image.imagePullSecrets }} +imagePullSecrets: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- if .Values.serviceAccount.create }} +serviceAccountName: {{ include "zammad.serviceAccountName" . }} +{{- end }} +{{- with .Values.nodeSelector }} +nodeSelector: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.affinity }} +affinity: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.tolerations }} +tolerations: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.securityContext }} +securityContext: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end -}} + +{{/* +init containers for Zammad Pods +*/}} +{{- define "zammad.podSpec.initContainers" -}} +{{- if .Values.zammadConfig.initContainers.volumePermissions.enabled }} +- name: zammad-volume-permissions + image: "{{ .Values.zammadConfig.initContainers.volumePermissions.image.repository }}:{{ .Values.zammadConfig.initContainers.volumePermissions.image.tag }}" + imagePullPolicy: {{ .Values.zammadConfig.initContainers.volumePermissions.image.pullPolicy }} + command: + {{- .Values.zammadConfig.initContainers.volumePermissions.command | toYaml | nindent 4 }} + {{- with .Values.zammadConfig.initContainers.volumePermissions.resources }} + resources: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.zammadConfig.initContainers.volumePermissions.securityContext }} + securityContext: + {{- toYaml . | nindent 4 }} + {{- end }} + volumeMounts: + {{- include "zammad.volumeMounts" . | nindent 4 }} +{{- end }} +{{- end -}} + +{{/* +shared configuration for Zammad Deployment Pods +*/}} +{{- define "zammad.podSpec.deployment" -}} +{{ include "zammad.podSpec" . }} +initContainers: +{{ include "zammad.podSpec.initContainers" . | nindent 2 }} +{{- end -}} + +{{/* +shared configuration for Zammad containers +*/}} +{{- define "zammad.containerSpec" -}} +image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" +imagePullPolicy: {{ .Values.image.pullPolicy }} +{{- with .containerConfig.startupProbe }} +startupProbe: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.livenessProbe }} +livenessProbe: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.readinessProbe }} +readinessProbe: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.resources }} +resources: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.securityContext }} +securityContext: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end -}} diff --git a/.history/zammad/templates/_helpers_20250912105853.tpl b/.history/zammad/templates/_helpers_20250912105853.tpl new file mode 100644 index 00000000..569051cb --- /dev/null +++ b/.history/zammad/templates/_helpers_20250912105853.tpl @@ -0,0 +1,355 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "zammad.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "zammad.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "zammad.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "zammad.labels" -}} +helm.sh/chart: {{ include "zammad.chart" . }} +{{ include "zammad.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.commonLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Pod labels +*/}} +{{- define "zammad.podLabels" -}} +{{ include "zammad.labels" . }} +{{- with .Values.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "zammad.selectorLabels" -}} +app.kubernetes.io/name: {{ include "zammad.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Common annotations +*/}} +{{- define "zammad.annotations" -}} +{{- with .Values.commonAnnotations }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Pod annotations +*/}} +{{- define "zammad.podAnnotations" -}} +{{ include "zammad.annotations" . }} +{{- with .Values.podAnnotations }} +{{ toYaml . }} +{{- end }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "zammad.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} +{{ default (include "zammad.fullname" .) .Values.serviceAccount.name }} +{{- else -}} +{{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +autowizard secret name +*/}} +{{- define "zammad.autowizardSecretName" -}} +{{- if .Values.secrets.autowizard.useExisting -}} +{{ .Values.secrets.autowizard.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.autowizard.secretName }} +{{- end -}} +{{- end -}} + +{{/* +elasticsearch secret name +*/}} +{{- define "zammad.elasticsearchSecretName" -}} +{{- if .Values.secrets.elasticsearch.useExisting -}} +{{ .Values.secrets.elasticsearch.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.elasticsearch.secretName }} +{{- end -}} +{{- end -}} + +{{/* +postgresql secret name +*/}} +{{- define "zammad.postgresqlSecretName" -}} +{{- if .Values.secrets.postgresql.useExisting -}} +{{ .Values.secrets.postgresql.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.postgresql.secretName }} +{{- end -}} +{{- end -}} + +{{/* +redis secret name +*/}} +{{- define "zammad.redisSecretName" -}} +{{- if .Values.secrets.redis.useExisting -}} +{{ .Values.secrets.redis.secretName }} +{{- else -}} +{{ include "zammad.fullname" . }}-{{ .Values.secrets.redis.secretName }} +{{- end -}} +{{- end -}} + +{{/* +S3 access URL +*/}} +{{- define "zammad.env.S3_URL" -}} +{{- with .Values.zammadConfig.minio.externalS3Url -}} +- name: S3_URL + value: {{ . | quote }} +{{- else -}} +{{- if .Values.zammadConfig.minio.enabled -}} +{{- if .Values.minio.auth.existingSecret -}} +- name: MINIO_ROOT_USER + valueFrom: + secretKeyRef: + key: root-user + name: {{ .Values.minio.auth.existingSecret }} +- name: MINIO_ROOT_PASSWORD + valueFrom: + secretKeyRef: + key: root-password + name: {{ .Values.minio.auth.existingSecret }} +- name: S3_URL + value: "http://$(MINIO_ROOT_USER):$(MINIO_ROOT_PASSWORD)@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" +{{- else -}} +- name: S3_URL + value: "http://{{ .Values.minio.auth.rootUser }}:{{ .Values.minio.auth.rootPassword }}@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" +{{- end -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +environment variables for the Zammad Rails stack +*/}} +{{- define "zammad.env" -}} +{{- if or .Values.zammadConfig.redis.pass .Values.secrets.redis.useExisting -}} +- name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "zammad.redisSecretName" . }} + key: {{ .Values.secrets.redis.secretKey }} +{{- end }} +- name: MEMCACHE_SERVERS + value: "{{ if .Values.zammadConfig.memcached.enabled }}{{ .Release.Name }}-memcached{{ else }}{{ .Values.zammadConfig.memcached.host }}{{ end }}:{{ .Values.zammadConfig.memcached.port }}" +- name: RAILS_TRUSTED_PROXIES + value: "{{ .Values.zammadConfig.railsserver.trustedProxies }}" +- name: REDIS_URL + value: "redis://:$(REDIS_PASSWORD)@{{ if .Values.zammadConfig.redis.enabled }}{{ .Release.Name }}-redis-master{{ else }}{{ .Values.zammadConfig.redis.host }}{{ end }}:{{ .Values.zammadConfig.redis.port }}" +- name: POSTGRESQL_PASS + valueFrom: + secretKeyRef: + name: {{ include "zammad.postgresqlSecretName" . }} + key: {{ .Values.secrets.postgresql.secretKey }} +- name: DATABASE_URL + value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}?{{ .Values.zammadConfig.postgresql.options }}" +{{ include "zammad.env.S3_URL" . }} +- name: TMP # All zammad containers need the possibility to create temporary files, e.g. for file uploads or image resizing. + value: {{ .Values.zammadConfig.railsserver.tmpdir }} +{{- with .Values.extraEnv }} +{{ toYaml . }} +{{- end }} +{{- if .Values.autoWizard.enabled }} +- name: AUTOWIZARD_RELATIVE_PATH + value: tmp/auto_wizard/auto_wizard.json +{{- end }} +{{- end -}} + +{{/* +environment variable to let Rails fail during startup if migrations are pending +*/}} +{{- define "zammad.env.failOnPendingMigrations" -}} +# Let containers fail if migrations are pending. +- name: RAILS_CHECK_PENDING_MIGRATIONS + value: 'true' +{{- end -}} + +{{/* +volume mounts for the Zammad Rails stack +*/}} +{{- define "zammad.volumeMounts" -}} +- name: {{ include "zammad.fullname" . }}-tmp + mountPath: /tmp +- name: {{ include "zammad.fullname" . }}-tmp + mountPath: /opt/zammad/tmp +{{- if .Values.zammadConfig.storageVolume.enabled }} +- name: {{ include "zammad.fullname" . }}-storage + mountPath: /opt/zammad/storage +{{- end -}} +{{- if .Values.autoWizard.enabled }} +- name: autowizard + mountPath: "/opt/zammad/tmp/auto_wizard" +{{- end }} +{{- with .Values.zammadConfig.customVolumeMounts }} +{{ toYaml . }} +{{- end -}} +{{- end -}} + +{{/* +volumes for the Zammad Rails stack +*/}} +{{- define "zammad.volumes" -}} +- name: {{ include "zammad.fullname" . }}-tmp + {{- toYaml .Values.zammadConfig.tmpDirVolume | nindent 2 }} +{{- if .Values.zammadConfig.storageVolume.enabled }} +{{- if .Values.zammadConfig.storageVolume.existingClaim }} +- name: {{ include "zammad.fullname" . }}-storage + persistentVolumeClaim: + claimName: {{ .Values.zammadConfig.storageVolume.existingClaim | default (include "zammad.fullname" .) }} +{{- else }} + {{ fail "Please provide an existing PersistentVolumeClaim with ReadWriteMany access if you enable .Values.zammadConfig.storageVolume." }} +{{- end -}} +{{- end -}} +{{- if .Values.autoWizard.enabled }} +- name: autowizard + secret: + secretName: {{ include "zammad.autowizardSecretName" . }} + items: + - key: {{ .Values.secrets.autowizard.secretKey }} + path: auto_wizard.json +{{- end }} +{{- with .Values.zammadConfig.customVolumes }} +{{ toYaml . }} +{{- end -}} +{{- end -}} + +{{/* +shared configuration for Zammad Pods +*/}} +{{- define "zammad.podSpec" -}} +{{- with .Values.image.imagePullSecrets }} +imagePullSecrets: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- if .Values.serviceAccount.create }} +serviceAccountName: {{ include "zammad.serviceAccountName" . }} +{{- end }} +{{- if .Values.priorityClassName }} +priorityClassName: {{ .Values.priorityClassName }} +{{- end }} +{{- with .Values.nodeSelector }} +nodeSelector: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.affinity }} +affinity: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.tolerations }} +tolerations: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.securityContext }} +securityContext: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end -}} + +{{/* +init containers for Zammad Pods +*/}} +{{- define "zammad.podSpec.initContainers" -}} +{{- if .Values.zammadConfig.initContainers.volumePermissions.enabled }} +- name: zammad-volume-permissions + image: "{{ .Values.zammadConfig.initContainers.volumePermissions.image.repository }}:{{ .Values.zammadConfig.initContainers.volumePermissions.image.tag }}" + imagePullPolicy: {{ .Values.zammadConfig.initContainers.volumePermissions.image.pullPolicy }} + command: + {{- .Values.zammadConfig.initContainers.volumePermissions.command | toYaml | nindent 4 }} + {{- with .Values.zammadConfig.initContainers.volumePermissions.resources }} + resources: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.zammadConfig.initContainers.volumePermissions.securityContext }} + securityContext: + {{- toYaml . | nindent 4 }} + {{- end }} + volumeMounts: + {{- include "zammad.volumeMounts" . | nindent 4 }} +{{- end }} +{{- end -}} + +{{/* +shared configuration for Zammad Deployment Pods +*/}} +{{- define "zammad.podSpec.deployment" -}} +{{ include "zammad.podSpec" . }} +initContainers: +{{ include "zammad.podSpec.initContainers" . | nindent 2 }} +{{- end -}} + +{{/* +shared configuration for Zammad containers +*/}} +{{- define "zammad.containerSpec" -}} +image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" +imagePullPolicy: {{ .Values.image.pullPolicy }} +{{- with .containerConfig.startupProbe }} +startupProbe: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.livenessProbe }} +livenessProbe: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.readinessProbe }} +readinessProbe: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.resources }} +resources: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .containerConfig.securityContext }} +securityContext: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- end -}} diff --git a/zammad/templates/_helpers.tpl b/zammad/templates/_helpers.tpl index 80c4e3a6..569051cb 100755 --- a/zammad/templates/_helpers.tpl +++ b/zammad/templates/_helpers.tpl @@ -273,6 +273,9 @@ imagePullSecrets: {{- if .Values.serviceAccount.create }} serviceAccountName: {{ include "zammad.serviceAccountName" . }} {{- end }} +{{- if .Values.priorityClassName }} +priorityClassName: {{ .Values.priorityClassName }} +{{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 2 }} From 34ba83b910d31775eba952c6a7841fe84bde8f0e Mon Sep 17 00:00:00 2001 From: ceejaykelly Date: Fri, 12 Sep 2025 11:05:10 +1000 Subject: [PATCH 2/5] Bumped the chart version Signed-off-by: ceejaykelly --- .history/zammad/Chart_20250912105725.yaml | 36 +++++++++++++++++++++++ .history/zammad/Chart_20250912110501.yaml | 36 +++++++++++++++++++++++ zammad/Chart.yaml | 2 +- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 .history/zammad/Chart_20250912105725.yaml create mode 100644 .history/zammad/Chart_20250912110501.yaml diff --git a/.history/zammad/Chart_20250912105725.yaml b/.history/zammad/Chart_20250912105725.yaml new file mode 100644 index 00000000..ec7ddf9d --- /dev/null +++ b/.history/zammad/Chart_20250912105725.yaml @@ -0,0 +1,36 @@ +apiVersion: v2 +name: zammad +version: 15.2.1 +appVersion: 6.5.1 +description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. +home: https://zammad.org +icon: https://raw.githubusercontent.com/zammad/zammad-documentation/main/images/zammad_logo_600x520.png +sources: + - https://github.com/zammad/zammad + - https://github.com/zammad/zammad-helm +maintainers: + - name: monotek + email: monotek23@gmail.com + - name: mgruner + email: enjoy@zammad.com +dependencies: + - name: elasticsearch + repository: https://charts.bitnami.com/bitnami + version: 21.6.3 + condition: zammadConfig.elasticsearch.enabled + - name: minio + version: 14.10.5 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.minio.enabled + - name: memcached + version: 7.9.3 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.memcached.enabled + - name: postgresql + version: 16.7.21 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.postgresql.enabled + - name: redis + version: 20.13.4 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.redis.enabled diff --git a/.history/zammad/Chart_20250912110501.yaml b/.history/zammad/Chart_20250912110501.yaml new file mode 100644 index 00000000..ddcdae26 --- /dev/null +++ b/.history/zammad/Chart_20250912110501.yaml @@ -0,0 +1,36 @@ +apiVersion: v2 +name: zammad +version: 15.2.2 +appVersion: 6.5.1 +description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. +home: https://zammad.org +icon: https://raw.githubusercontent.com/zammad/zammad-documentation/main/images/zammad_logo_600x520.png +sources: + - https://github.com/zammad/zammad + - https://github.com/zammad/zammad-helm +maintainers: + - name: monotek + email: monotek23@gmail.com + - name: mgruner + email: enjoy@zammad.com +dependencies: + - name: elasticsearch + repository: https://charts.bitnami.com/bitnami + version: 21.6.3 + condition: zammadConfig.elasticsearch.enabled + - name: minio + version: 14.10.5 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.minio.enabled + - name: memcached + version: 7.9.3 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.memcached.enabled + - name: postgresql + version: 16.7.21 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.postgresql.enabled + - name: redis + version: 20.13.4 + repository: https://charts.bitnami.com/bitnami + condition: zammadConfig.redis.enabled diff --git a/zammad/Chart.yaml b/zammad/Chart.yaml index ec7ddf9d..ddcdae26 100755 --- a/zammad/Chart.yaml +++ b/zammad/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: zammad -version: 15.2.1 +version: 15.2.2 appVersion: 6.5.1 description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. home: https://zammad.org From 971cab56914904893196a9777769bfcb9a2c5dcd Mon Sep 17 00:00:00 2001 From: ceejaykelly Date: Fri, 12 Sep 2025 11:08:21 +1000 Subject: [PATCH 3/5] Removed .history Signed-off-by: ceejaykelly --- .history/zammad/Chart_20250912105725.yaml | 36 -- .history/zammad/Chart_20250912110501.yaml | 36 -- .../templates/_helpers_20250912105725.tpl | 352 ----------------- .../templates/_helpers_20250912105853.tpl | 355 ------------------ 4 files changed, 779 deletions(-) delete mode 100644 .history/zammad/Chart_20250912105725.yaml delete mode 100644 .history/zammad/Chart_20250912110501.yaml delete mode 100644 .history/zammad/templates/_helpers_20250912105725.tpl delete mode 100644 .history/zammad/templates/_helpers_20250912105853.tpl diff --git a/.history/zammad/Chart_20250912105725.yaml b/.history/zammad/Chart_20250912105725.yaml deleted file mode 100644 index ec7ddf9d..00000000 --- a/.history/zammad/Chart_20250912105725.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: v2 -name: zammad -version: 15.2.1 -appVersion: 6.5.1 -description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. -home: https://zammad.org -icon: https://raw.githubusercontent.com/zammad/zammad-documentation/main/images/zammad_logo_600x520.png -sources: - - https://github.com/zammad/zammad - - https://github.com/zammad/zammad-helm -maintainers: - - name: monotek - email: monotek23@gmail.com - - name: mgruner - email: enjoy@zammad.com -dependencies: - - name: elasticsearch - repository: https://charts.bitnami.com/bitnami - version: 21.6.3 - condition: zammadConfig.elasticsearch.enabled - - name: minio - version: 14.10.5 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.minio.enabled - - name: memcached - version: 7.9.3 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.memcached.enabled - - name: postgresql - version: 16.7.21 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.postgresql.enabled - - name: redis - version: 20.13.4 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.redis.enabled diff --git a/.history/zammad/Chart_20250912110501.yaml b/.history/zammad/Chart_20250912110501.yaml deleted file mode 100644 index ddcdae26..00000000 --- a/.history/zammad/Chart_20250912110501.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: v2 -name: zammad -version: 15.2.2 -appVersion: 6.5.1 -description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. -home: https://zammad.org -icon: https://raw.githubusercontent.com/zammad/zammad-documentation/main/images/zammad_logo_600x520.png -sources: - - https://github.com/zammad/zammad - - https://github.com/zammad/zammad-helm -maintainers: - - name: monotek - email: monotek23@gmail.com - - name: mgruner - email: enjoy@zammad.com -dependencies: - - name: elasticsearch - repository: https://charts.bitnami.com/bitnami - version: 21.6.3 - condition: zammadConfig.elasticsearch.enabled - - name: minio - version: 14.10.5 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.minio.enabled - - name: memcached - version: 7.9.3 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.memcached.enabled - - name: postgresql - version: 16.7.21 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.postgresql.enabled - - name: redis - version: 20.13.4 - repository: https://charts.bitnami.com/bitnami - condition: zammadConfig.redis.enabled diff --git a/.history/zammad/templates/_helpers_20250912105725.tpl b/.history/zammad/templates/_helpers_20250912105725.tpl deleted file mode 100644 index 80c4e3a6..00000000 --- a/.history/zammad/templates/_helpers_20250912105725.tpl +++ /dev/null @@ -1,352 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "zammad.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "zammad.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "zammad.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "zammad.labels" -}} -helm.sh/chart: {{ include "zammad.chart" . }} -{{ include "zammad.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- with .Values.commonLabels }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Pod labels -*/}} -{{- define "zammad.podLabels" -}} -{{ include "zammad.labels" . }} -{{- with .Values.podLabels }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Selector labels -*/}} -{{- define "zammad.selectorLabels" -}} -app.kubernetes.io/name: {{ include "zammad.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{/* -Common annotations -*/}} -{{- define "zammad.annotations" -}} -{{- with .Values.commonAnnotations }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Pod annotations -*/}} -{{- define "zammad.podAnnotations" -}} -{{ include "zammad.annotations" . }} -{{- with .Values.podAnnotations }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "zammad.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} -{{ default (include "zammad.fullname" .) .Values.serviceAccount.name }} -{{- else -}} -{{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -autowizard secret name -*/}} -{{- define "zammad.autowizardSecretName" -}} -{{- if .Values.secrets.autowizard.useExisting -}} -{{ .Values.secrets.autowizard.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.autowizard.secretName }} -{{- end -}} -{{- end -}} - -{{/* -elasticsearch secret name -*/}} -{{- define "zammad.elasticsearchSecretName" -}} -{{- if .Values.secrets.elasticsearch.useExisting -}} -{{ .Values.secrets.elasticsearch.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.elasticsearch.secretName }} -{{- end -}} -{{- end -}} - -{{/* -postgresql secret name -*/}} -{{- define "zammad.postgresqlSecretName" -}} -{{- if .Values.secrets.postgresql.useExisting -}} -{{ .Values.secrets.postgresql.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.postgresql.secretName }} -{{- end -}} -{{- end -}} - -{{/* -redis secret name -*/}} -{{- define "zammad.redisSecretName" -}} -{{- if .Values.secrets.redis.useExisting -}} -{{ .Values.secrets.redis.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.redis.secretName }} -{{- end -}} -{{- end -}} - -{{/* -S3 access URL -*/}} -{{- define "zammad.env.S3_URL" -}} -{{- with .Values.zammadConfig.minio.externalS3Url -}} -- name: S3_URL - value: {{ . | quote }} -{{- else -}} -{{- if .Values.zammadConfig.minio.enabled -}} -{{- if .Values.minio.auth.existingSecret -}} -- name: MINIO_ROOT_USER - valueFrom: - secretKeyRef: - key: root-user - name: {{ .Values.minio.auth.existingSecret }} -- name: MINIO_ROOT_PASSWORD - valueFrom: - secretKeyRef: - key: root-password - name: {{ .Values.minio.auth.existingSecret }} -- name: S3_URL - value: "http://$(MINIO_ROOT_USER):$(MINIO_ROOT_PASSWORD)@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" -{{- else -}} -- name: S3_URL - value: "http://{{ .Values.minio.auth.rootUser }}:{{ .Values.minio.auth.rootPassword }}@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" -{{- end -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -environment variables for the Zammad Rails stack -*/}} -{{- define "zammad.env" -}} -{{- if or .Values.zammadConfig.redis.pass .Values.secrets.redis.useExisting -}} -- name: REDIS_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "zammad.redisSecretName" . }} - key: {{ .Values.secrets.redis.secretKey }} -{{- end }} -- name: MEMCACHE_SERVERS - value: "{{ if .Values.zammadConfig.memcached.enabled }}{{ .Release.Name }}-memcached{{ else }}{{ .Values.zammadConfig.memcached.host }}{{ end }}:{{ .Values.zammadConfig.memcached.port }}" -- name: RAILS_TRUSTED_PROXIES - value: "{{ .Values.zammadConfig.railsserver.trustedProxies }}" -- name: REDIS_URL - value: "redis://:$(REDIS_PASSWORD)@{{ if .Values.zammadConfig.redis.enabled }}{{ .Release.Name }}-redis-master{{ else }}{{ .Values.zammadConfig.redis.host }}{{ end }}:{{ .Values.zammadConfig.redis.port }}" -- name: POSTGRESQL_PASS - valueFrom: - secretKeyRef: - name: {{ include "zammad.postgresqlSecretName" . }} - key: {{ .Values.secrets.postgresql.secretKey }} -- name: DATABASE_URL - value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}?{{ .Values.zammadConfig.postgresql.options }}" -{{ include "zammad.env.S3_URL" . }} -- name: TMP # All zammad containers need the possibility to create temporary files, e.g. for file uploads or image resizing. - value: {{ .Values.zammadConfig.railsserver.tmpdir }} -{{- with .Values.extraEnv }} -{{ toYaml . }} -{{- end }} -{{- if .Values.autoWizard.enabled }} -- name: AUTOWIZARD_RELATIVE_PATH - value: tmp/auto_wizard/auto_wizard.json -{{- end }} -{{- end -}} - -{{/* -environment variable to let Rails fail during startup if migrations are pending -*/}} -{{- define "zammad.env.failOnPendingMigrations" -}} -# Let containers fail if migrations are pending. -- name: RAILS_CHECK_PENDING_MIGRATIONS - value: 'true' -{{- end -}} - -{{/* -volume mounts for the Zammad Rails stack -*/}} -{{- define "zammad.volumeMounts" -}} -- name: {{ include "zammad.fullname" . }}-tmp - mountPath: /tmp -- name: {{ include "zammad.fullname" . }}-tmp - mountPath: /opt/zammad/tmp -{{- if .Values.zammadConfig.storageVolume.enabled }} -- name: {{ include "zammad.fullname" . }}-storage - mountPath: /opt/zammad/storage -{{- end -}} -{{- if .Values.autoWizard.enabled }} -- name: autowizard - mountPath: "/opt/zammad/tmp/auto_wizard" -{{- end }} -{{- with .Values.zammadConfig.customVolumeMounts }} -{{ toYaml . }} -{{- end -}} -{{- end -}} - -{{/* -volumes for the Zammad Rails stack -*/}} -{{- define "zammad.volumes" -}} -- name: {{ include "zammad.fullname" . }}-tmp - {{- toYaml .Values.zammadConfig.tmpDirVolume | nindent 2 }} -{{- if .Values.zammadConfig.storageVolume.enabled }} -{{- if .Values.zammadConfig.storageVolume.existingClaim }} -- name: {{ include "zammad.fullname" . }}-storage - persistentVolumeClaim: - claimName: {{ .Values.zammadConfig.storageVolume.existingClaim | default (include "zammad.fullname" .) }} -{{- else }} - {{ fail "Please provide an existing PersistentVolumeClaim with ReadWriteMany access if you enable .Values.zammadConfig.storageVolume." }} -{{- end -}} -{{- end -}} -{{- if .Values.autoWizard.enabled }} -- name: autowizard - secret: - secretName: {{ include "zammad.autowizardSecretName" . }} - items: - - key: {{ .Values.secrets.autowizard.secretKey }} - path: auto_wizard.json -{{- end }} -{{- with .Values.zammadConfig.customVolumes }} -{{ toYaml . }} -{{- end -}} -{{- end -}} - -{{/* -shared configuration for Zammad Pods -*/}} -{{- define "zammad.podSpec" -}} -{{- with .Values.image.imagePullSecrets }} -imagePullSecrets: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- if .Values.serviceAccount.create }} -serviceAccountName: {{ include "zammad.serviceAccountName" . }} -{{- end }} -{{- with .Values.nodeSelector }} -nodeSelector: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .Values.affinity }} -affinity: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .Values.tolerations }} -tolerations: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .Values.securityContext }} -securityContext: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- end -}} - -{{/* -init containers for Zammad Pods -*/}} -{{- define "zammad.podSpec.initContainers" -}} -{{- if .Values.zammadConfig.initContainers.volumePermissions.enabled }} -- name: zammad-volume-permissions - image: "{{ .Values.zammadConfig.initContainers.volumePermissions.image.repository }}:{{ .Values.zammadConfig.initContainers.volumePermissions.image.tag }}" - imagePullPolicy: {{ .Values.zammadConfig.initContainers.volumePermissions.image.pullPolicy }} - command: - {{- .Values.zammadConfig.initContainers.volumePermissions.command | toYaml | nindent 4 }} - {{- with .Values.zammadConfig.initContainers.volumePermissions.resources }} - resources: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.zammadConfig.initContainers.volumePermissions.securityContext }} - securityContext: - {{- toYaml . | nindent 4 }} - {{- end }} - volumeMounts: - {{- include "zammad.volumeMounts" . | nindent 4 }} -{{- end }} -{{- end -}} - -{{/* -shared configuration for Zammad Deployment Pods -*/}} -{{- define "zammad.podSpec.deployment" -}} -{{ include "zammad.podSpec" . }} -initContainers: -{{ include "zammad.podSpec.initContainers" . | nindent 2 }} -{{- end -}} - -{{/* -shared configuration for Zammad containers -*/}} -{{- define "zammad.containerSpec" -}} -image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" -imagePullPolicy: {{ .Values.image.pullPolicy }} -{{- with .containerConfig.startupProbe }} -startupProbe: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.livenessProbe }} -livenessProbe: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.readinessProbe }} -readinessProbe: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.resources }} -resources: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.securityContext }} -securityContext: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- end -}} diff --git a/.history/zammad/templates/_helpers_20250912105853.tpl b/.history/zammad/templates/_helpers_20250912105853.tpl deleted file mode 100644 index 569051cb..00000000 --- a/.history/zammad/templates/_helpers_20250912105853.tpl +++ /dev/null @@ -1,355 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "zammad.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "zammad.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "zammad.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "zammad.labels" -}} -helm.sh/chart: {{ include "zammad.chart" . }} -{{ include "zammad.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- with .Values.commonLabels }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Pod labels -*/}} -{{- define "zammad.podLabels" -}} -{{ include "zammad.labels" . }} -{{- with .Values.podLabels }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Selector labels -*/}} -{{- define "zammad.selectorLabels" -}} -app.kubernetes.io/name: {{ include "zammad.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end -}} - -{{/* -Common annotations -*/}} -{{- define "zammad.annotations" -}} -{{- with .Values.commonAnnotations }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Pod annotations -*/}} -{{- define "zammad.podAnnotations" -}} -{{ include "zammad.annotations" . }} -{{- with .Values.podAnnotations }} -{{ toYaml . }} -{{- end }} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "zammad.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} -{{ default (include "zammad.fullname" .) .Values.serviceAccount.name }} -{{- else -}} -{{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -autowizard secret name -*/}} -{{- define "zammad.autowizardSecretName" -}} -{{- if .Values.secrets.autowizard.useExisting -}} -{{ .Values.secrets.autowizard.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.autowizard.secretName }} -{{- end -}} -{{- end -}} - -{{/* -elasticsearch secret name -*/}} -{{- define "zammad.elasticsearchSecretName" -}} -{{- if .Values.secrets.elasticsearch.useExisting -}} -{{ .Values.secrets.elasticsearch.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.elasticsearch.secretName }} -{{- end -}} -{{- end -}} - -{{/* -postgresql secret name -*/}} -{{- define "zammad.postgresqlSecretName" -}} -{{- if .Values.secrets.postgresql.useExisting -}} -{{ .Values.secrets.postgresql.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.postgresql.secretName }} -{{- end -}} -{{- end -}} - -{{/* -redis secret name -*/}} -{{- define "zammad.redisSecretName" -}} -{{- if .Values.secrets.redis.useExisting -}} -{{ .Values.secrets.redis.secretName }} -{{- else -}} -{{ include "zammad.fullname" . }}-{{ .Values.secrets.redis.secretName }} -{{- end -}} -{{- end -}} - -{{/* -S3 access URL -*/}} -{{- define "zammad.env.S3_URL" -}} -{{- with .Values.zammadConfig.minio.externalS3Url -}} -- name: S3_URL - value: {{ . | quote }} -{{- else -}} -{{- if .Values.zammadConfig.minio.enabled -}} -{{- if .Values.minio.auth.existingSecret -}} -- name: MINIO_ROOT_USER - valueFrom: - secretKeyRef: - key: root-user - name: {{ .Values.minio.auth.existingSecret }} -- name: MINIO_ROOT_PASSWORD - valueFrom: - secretKeyRef: - key: root-password - name: {{ .Values.minio.auth.existingSecret }} -- name: S3_URL - value: "http://$(MINIO_ROOT_USER):$(MINIO_ROOT_PASSWORD)@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" -{{- else -}} -- name: S3_URL - value: "http://{{ .Values.minio.auth.rootUser }}:{{ .Values.minio.auth.rootPassword }}@{{ include "zammad.fullname" . }}-minio:9000/zammad?region=zammad&force_path_style=true" -{{- end -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -environment variables for the Zammad Rails stack -*/}} -{{- define "zammad.env" -}} -{{- if or .Values.zammadConfig.redis.pass .Values.secrets.redis.useExisting -}} -- name: REDIS_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "zammad.redisSecretName" . }} - key: {{ .Values.secrets.redis.secretKey }} -{{- end }} -- name: MEMCACHE_SERVERS - value: "{{ if .Values.zammadConfig.memcached.enabled }}{{ .Release.Name }}-memcached{{ else }}{{ .Values.zammadConfig.memcached.host }}{{ end }}:{{ .Values.zammadConfig.memcached.port }}" -- name: RAILS_TRUSTED_PROXIES - value: "{{ .Values.zammadConfig.railsserver.trustedProxies }}" -- name: REDIS_URL - value: "redis://:$(REDIS_PASSWORD)@{{ if .Values.zammadConfig.redis.enabled }}{{ .Release.Name }}-redis-master{{ else }}{{ .Values.zammadConfig.redis.host }}{{ end }}:{{ .Values.zammadConfig.redis.port }}" -- name: POSTGRESQL_PASS - valueFrom: - secretKeyRef: - name: {{ include "zammad.postgresqlSecretName" . }} - key: {{ .Values.secrets.postgresql.secretKey }} -- name: DATABASE_URL - value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}?{{ .Values.zammadConfig.postgresql.options }}" -{{ include "zammad.env.S3_URL" . }} -- name: TMP # All zammad containers need the possibility to create temporary files, e.g. for file uploads or image resizing. - value: {{ .Values.zammadConfig.railsserver.tmpdir }} -{{- with .Values.extraEnv }} -{{ toYaml . }} -{{- end }} -{{- if .Values.autoWizard.enabled }} -- name: AUTOWIZARD_RELATIVE_PATH - value: tmp/auto_wizard/auto_wizard.json -{{- end }} -{{- end -}} - -{{/* -environment variable to let Rails fail during startup if migrations are pending -*/}} -{{- define "zammad.env.failOnPendingMigrations" -}} -# Let containers fail if migrations are pending. -- name: RAILS_CHECK_PENDING_MIGRATIONS - value: 'true' -{{- end -}} - -{{/* -volume mounts for the Zammad Rails stack -*/}} -{{- define "zammad.volumeMounts" -}} -- name: {{ include "zammad.fullname" . }}-tmp - mountPath: /tmp -- name: {{ include "zammad.fullname" . }}-tmp - mountPath: /opt/zammad/tmp -{{- if .Values.zammadConfig.storageVolume.enabled }} -- name: {{ include "zammad.fullname" . }}-storage - mountPath: /opt/zammad/storage -{{- end -}} -{{- if .Values.autoWizard.enabled }} -- name: autowizard - mountPath: "/opt/zammad/tmp/auto_wizard" -{{- end }} -{{- with .Values.zammadConfig.customVolumeMounts }} -{{ toYaml . }} -{{- end -}} -{{- end -}} - -{{/* -volumes for the Zammad Rails stack -*/}} -{{- define "zammad.volumes" -}} -- name: {{ include "zammad.fullname" . }}-tmp - {{- toYaml .Values.zammadConfig.tmpDirVolume | nindent 2 }} -{{- if .Values.zammadConfig.storageVolume.enabled }} -{{- if .Values.zammadConfig.storageVolume.existingClaim }} -- name: {{ include "zammad.fullname" . }}-storage - persistentVolumeClaim: - claimName: {{ .Values.zammadConfig.storageVolume.existingClaim | default (include "zammad.fullname" .) }} -{{- else }} - {{ fail "Please provide an existing PersistentVolumeClaim with ReadWriteMany access if you enable .Values.zammadConfig.storageVolume." }} -{{- end -}} -{{- end -}} -{{- if .Values.autoWizard.enabled }} -- name: autowizard - secret: - secretName: {{ include "zammad.autowizardSecretName" . }} - items: - - key: {{ .Values.secrets.autowizard.secretKey }} - path: auto_wizard.json -{{- end }} -{{- with .Values.zammadConfig.customVolumes }} -{{ toYaml . }} -{{- end -}} -{{- end -}} - -{{/* -shared configuration for Zammad Pods -*/}} -{{- define "zammad.podSpec" -}} -{{- with .Values.image.imagePullSecrets }} -imagePullSecrets: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- if .Values.serviceAccount.create }} -serviceAccountName: {{ include "zammad.serviceAccountName" . }} -{{- end }} -{{- if .Values.priorityClassName }} -priorityClassName: {{ .Values.priorityClassName }} -{{- end }} -{{- with .Values.nodeSelector }} -nodeSelector: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .Values.affinity }} -affinity: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .Values.tolerations }} -tolerations: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .Values.securityContext }} -securityContext: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- end -}} - -{{/* -init containers for Zammad Pods -*/}} -{{- define "zammad.podSpec.initContainers" -}} -{{- if .Values.zammadConfig.initContainers.volumePermissions.enabled }} -- name: zammad-volume-permissions - image: "{{ .Values.zammadConfig.initContainers.volumePermissions.image.repository }}:{{ .Values.zammadConfig.initContainers.volumePermissions.image.tag }}" - imagePullPolicy: {{ .Values.zammadConfig.initContainers.volumePermissions.image.pullPolicy }} - command: - {{- .Values.zammadConfig.initContainers.volumePermissions.command | toYaml | nindent 4 }} - {{- with .Values.zammadConfig.initContainers.volumePermissions.resources }} - resources: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.zammadConfig.initContainers.volumePermissions.securityContext }} - securityContext: - {{- toYaml . | nindent 4 }} - {{- end }} - volumeMounts: - {{- include "zammad.volumeMounts" . | nindent 4 }} -{{- end }} -{{- end -}} - -{{/* -shared configuration for Zammad Deployment Pods -*/}} -{{- define "zammad.podSpec.deployment" -}} -{{ include "zammad.podSpec" . }} -initContainers: -{{ include "zammad.podSpec.initContainers" . | nindent 2 }} -{{- end -}} - -{{/* -shared configuration for Zammad containers -*/}} -{{- define "zammad.containerSpec" -}} -image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" -imagePullPolicy: {{ .Values.image.pullPolicy }} -{{- with .containerConfig.startupProbe }} -startupProbe: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.livenessProbe }} -livenessProbe: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.readinessProbe }} -readinessProbe: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.resources }} -resources: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- with .containerConfig.securityContext }} -securityContext: - {{- toYaml . | nindent 2 }} -{{- end }} -{{- end -}} From 6be10bcf1935092d268bd38c8ce2002fae62ee5e Mon Sep 17 00:00:00 2001 From: Ceejay Kelly Date: Tue, 23 Sep 2025 05:28:36 +1000 Subject: [PATCH 4/5] Implemented separated priorityClass into all zammad pods Signed-off-by: Ceejay Kelly --- zammad/Chart.yaml | 2 +- zammad/templates/_helpers.tpl | 12 +++++++++--- zammad/templates/cronjob-reindex.yaml | 1 + zammad/templates/deployment-nginx.yaml | 1 + zammad/templates/deployment-railsserver.yaml | 1 + zammad/templates/deployment-scheduler.yaml | 1 + zammad/templates/deployment-websocket.yaml | 1 + zammad/templates/job-init.yaml | 1 + 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/zammad/Chart.yaml b/zammad/Chart.yaml index ddcdae26..0e89a0d0 100755 --- a/zammad/Chart.yaml +++ b/zammad/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: zammad -version: 15.2.2 +version: 15.3.0 appVersion: 6.5.1 description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. home: https://zammad.org diff --git a/zammad/templates/_helpers.tpl b/zammad/templates/_helpers.tpl index 569051cb..58f550ae 100755 --- a/zammad/templates/_helpers.tpl +++ b/zammad/templates/_helpers.tpl @@ -273,9 +273,6 @@ imagePullSecrets: {{- if .Values.serviceAccount.create }} serviceAccountName: {{ include "zammad.serviceAccountName" . }} {{- end }} -{{- if .Values.priorityClassName }} -priorityClassName: {{ .Values.priorityClassName }} -{{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 2 }} @@ -326,6 +323,15 @@ initContainers: {{ include "zammad.podSpec.initContainers" . | nindent 2 }} {{- end -}} +{{/* +shared priority class configuration +*/}} +{{- define "zammad.podSpec.priorityClass" -}} +{{- if .priorityClassName }} +priorityClassName: {{ .priorityClassName }} +{{- end}} +{{- end -}} + {{/* shared configuration for Zammad containers */}} diff --git a/zammad/templates/cronjob-reindex.yaml b/zammad/templates/cronjob-reindex.yaml index c2273cb3..1ef6380e 100755 --- a/zammad/templates/cronjob-reindex.yaml +++ b/zammad/templates/cronjob-reindex.yaml @@ -30,6 +30,7 @@ spec: {{- toYaml . | nindent 12}} {{- end }} spec: + {{- include "zammad.podSpec.priorityClass" .Values.zammadConfig.cronJob | nindent 10 }} {{- include "zammad.podSpec" . | nindent 10 }} {{- with .Values.zammadConfig.cronJob.reindex.podSpec }} {{- toYaml . | nindent 10}} diff --git a/zammad/templates/deployment-nginx.yaml b/zammad/templates/deployment-nginx.yaml index 6fc5fa6f..6a9ef939 100644 --- a/zammad/templates/deployment-nginx.yaml +++ b/zammad/templates/deployment-nginx.yaml @@ -27,6 +27,7 @@ spec: {{- toYaml . | nindent 8}} {{- end }} spec: + {{- include "zammad.podSpec.priorityClass" .Values.zammadConfig.nginx | nindent 6 }} {{- include "zammad.podSpec.deployment" . | nindent 6 }} {{- with .Values.zammadConfig.nginx.nodeSelector }} nodeSelector: diff --git a/zammad/templates/deployment-railsserver.yaml b/zammad/templates/deployment-railsserver.yaml index 4818839f..cada4789 100644 --- a/zammad/templates/deployment-railsserver.yaml +++ b/zammad/templates/deployment-railsserver.yaml @@ -27,6 +27,7 @@ spec: {{- toYaml . | nindent 8}} {{- end }} spec: + {{- include "zammad.podSpec.priorityClass" .Values.zammadConfig.railsserver | nindent 6 }} {{- include "zammad.podSpec.deployment" . | nindent 6 }} {{- with .Values.zammadConfig.railsserver.nodeSelector }} nodeSelector: diff --git a/zammad/templates/deployment-scheduler.yaml b/zammad/templates/deployment-scheduler.yaml index 283f87b4..e9947546 100644 --- a/zammad/templates/deployment-scheduler.yaml +++ b/zammad/templates/deployment-scheduler.yaml @@ -31,6 +31,7 @@ spec: {{- toYaml . | nindent 8}} {{- end }} spec: + {{- include "zammad.podSpec.priorityClass" .Values.zammadConfig.scheduler | nindent 6 }} {{- include "zammad.podSpec.deployment" . | nindent 6 }} {{- with .Values.zammadConfig.scheduler.nodeSelector }} nodeSelector: diff --git a/zammad/templates/deployment-websocket.yaml b/zammad/templates/deployment-websocket.yaml index 4844246e..8ab8f0e8 100755 --- a/zammad/templates/deployment-websocket.yaml +++ b/zammad/templates/deployment-websocket.yaml @@ -29,6 +29,7 @@ spec: {{- toYaml . | nindent 8}} {{- end }} spec: + {{- include "zammad.podSpec.priorityClass" .Values.zammadConfig.websocket | nindent 6 }} {{- include "zammad.podSpec.deployment" . | nindent 6 }} {{- with .Values.zammadConfig.websocket.topologySpreadConstraints }} topologySpreadConstraints: diff --git a/zammad/templates/job-init.yaml b/zammad/templates/job-init.yaml index 702008fd..1dd6be72 100755 --- a/zammad/templates/job-init.yaml +++ b/zammad/templates/job-init.yaml @@ -34,6 +34,7 @@ spec: {{- toYaml . | nindent 8}} {{- end }} spec: + {{- include "zammad.podSpec.priorityClass" .Values.zammadConfig.initJob | nindent 6 }} {{- include "zammad.podSpec" . | nindent 6 }} {{- with .Values.zammadConfig.initJob.podSpec }} {{- toYaml . | nindent 6}} From a51b131ee5bd0775516ee272dde9f582f70b8099 Mon Sep 17 00:00:00 2001 From: Ceejay Kelly Date: Tue, 23 Sep 2025 05:30:41 +1000 Subject: [PATCH 5/5] Modified helper comment Signed-off-by: Ceejay Kelly --- zammad/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zammad/templates/_helpers.tpl b/zammad/templates/_helpers.tpl index 58f550ae..46d43f82 100755 --- a/zammad/templates/_helpers.tpl +++ b/zammad/templates/_helpers.tpl @@ -324,7 +324,7 @@ initContainers: {{- end -}} {{/* -shared priority class configuration +priority class configuration for Zammad pods */}} {{- define "zammad.podSpec.priorityClass" -}} {{- if .priorityClassName }}