Skip to content

Commit

Permalink
Add possibility to specify custom volumes and volumeMounts for Zammad…
Browse files Browse the repository at this point in the history
… Pods (#272)
  • Loading branch information
mgruner authored May 8, 2024
1 parent 9cf7a42 commit 9a940ce
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 3 deletions.
4 changes: 2 additions & 2 deletions zammad/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: zammad
version: 12.0.3
appVersion: 6.3.0-17
version: 12.1.0
appVersion: 6.3.0-20
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
Expand Down
9 changes: 9 additions & 0 deletions zammad/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
zammadConfig:
customVolumes:
- name: custom-volume
configMap:
name: helm-tests
customVolumeMounts:
- name: custom-volume
mountPath: /opt/zammad/lib/tasks/helm
readOnly: true
19 changes: 19 additions & 0 deletions zammad/ci/full-objects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,22 @@ spec:
resources:
requests:
storage: 32Mi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: helm-tests
namespace: zammad
data:
helm-test.rake: |-
namespace :zammad do
namespace :helm do
desc 'Runs a set of Helm tests'
task test: :environment do |_task, args|
puts 'Checking if temporary file can be created...'
Tempfile.create do |f|
puts ' Temporary file was created successfully.'
end
end
end
end
8 changes: 8 additions & 0 deletions zammad/ci/full-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ zammadConfig:
existingClaim: 'storage-volume-claim'
minio:
enabled: true
customVolumes:
- name: custom-volume
configMap:
name: helm-tests
customVolumeMounts:
- name: custom-volume
mountPath: /opt/zammad/lib/tasks/helm
readOnly: true
6 changes: 6 additions & 0 deletions zammad/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ volume mounts for the Zammad Rails stack
- name: autowizard
mountPath: "/opt/zammad/tmp/auto_wizard"
{{- end }}
{{- with .Values.zammadConfig.customVolumeMounts }}
{{ toYaml . }}
{{- end -}}
{{- end -}}

{{/*
Expand All @@ -222,6 +225,9 @@ volumes for the Zammad Rails stack
- key: {{ .Values.secrets.autowizard.secretKey }}
path: auto_wizard.json
{{- end }}
{{- with .Values.zammadConfig.customVolumes }}
{{ toYaml . }}
{{- end -}}
{{- end -}}

{{/*
Expand Down
23 changes: 23 additions & 0 deletions zammad/templates/tests/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "zammad.fullname" . }}-run-tests"
labels:
{{- include "zammad.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
{{- include "zammad.podSpec.deployment" . | nindent 4 }}
containers:
- name: zammad-run-tests
{{- include "zammad.containerSpec" (merge (dict "containerConfig" dict) .) | nindent 8 }}
command: ['bundle']
args: ['exec', 'rake', 'zammad:helm:test']
env:
{{- include "zammad.env" . | nindent 12 }}
{{- include "zammad.env.failOnPendingMigrations" . | nindent 12 }}
volumeMounts:
{{- include "zammad.volumeMounts" . | nindent 10 }}
volumes:
{{- include "zammad.volumes" . | nindent 6 }}
restartPolicy: Never
14 changes: 13 additions & 1 deletion zammad/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,18 @@ zammadConfig:
# see: https://github.com/kubernetes/kubernetes/issues/76158 & https://github.com/kubernetes/kubernetes/issues/110835
# medium: Memory

# Custom volumes for all Zammad Pods.
customVolumes:
# - name: custom-volume
# configMap:
# name: my-config-map

# Custom volumeMounts for all Zammad Pods.
customVolumeMounts:
# - name: custom-volume
# mountPath: "/opt/zammad/config_map"
# readOnly: true

websocket:
livenessProbe:
tcpSocket:
Expand Down Expand Up @@ -365,7 +377,7 @@ autoWizard:
# "lastname": "Admin",
# "email": "email@example.org",
# "organization": "ZammadTest",
# "password": "YourPassword"
# "password": "..."
# }
# ],
# "Settings": [
Expand Down

0 comments on commit 9a940ce

Please sign in to comment.