Skip to content
Open
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
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: 15.4.1
appVersion: 6.5.2-43
version: 15.5.0
appVersion: develop
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO revert this change, for testing only

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
11 changes: 11 additions & 0 deletions zammad/ci/full-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ secrets:
useExisting: true
secretKey: redis-password
secretName: redis-existing-secret
sentinel:
useExisting: true
secretKey: redis-password
secretName: redis-existing-secret

autoWizard:
enabled: true
Expand All @@ -30,10 +34,14 @@ minio:
auth:
existingSecret: minio-existing-secret

# Use existing Redis secrets and run in Redis Sentinel mode.
redis:
auth:
existingSecret: redis-existing-secret
existingSecretPasswordKey: redis-password
sentinel:
enabled: true
architecture: replication

zammadConfig:
storageVolume:
Expand All @@ -60,6 +68,9 @@ zammadConfig:
my-railsserver-pod-label: my-railsserver-pod-label-value
podAnnotations:
my-railsserver-pod-annotation: my-railsserver-pod-annotation-value
redis:
sentinel:
enabled: true
scheduler:
podLabels:
my-scheduler-pod-label: my-scheduler-pod-label-value
Expand Down
56 changes: 51 additions & 5 deletions zammad/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ redis secret name
{{- end -}}
{{- end -}}

{{/*
redis sentinel secret name
*/}}
{{- define "zammad.redisSentinelSecretName" -}}
{{- if .Values.secrets.redis.sentinel.useExisting -}}
{{ .Values.secrets.redis.sentinel.secretName }}
{{- else -}}
{{ include "zammad.fullname" . }}-{{ .Values.secrets.redis.sentinel.secretName }}
{{- end -}}
{{- end -}}

{{/*
S3 access URL
*/}}
Expand Down Expand Up @@ -176,22 +187,57 @@ S3 access URL
{{- end -}}

{{/*
environment variables for the Zammad Rails stack
Redis Variables
*/}}
{{- define "zammad.env" -}}
{{- if or .Values.zammadConfig.redis.pass .Values.secrets.redis.useExisting -}}
{{- define "zammad.env.redisVariables" -}}
{{- if .Values.zammadConfig.redis.sentinel.username }}
- name: REDIS_USERNAME
value: "{{ .Values.zammadConfig.redis.username }}"
{{- end }}
{{- 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 }}
# sentinel
{{- if .Values.zammadConfig.redis.sentinel.enabled }}
- name: REDIS_SENTINELS
{{- if .Values.zammadConfig.redis.enabled }}
value: "{{ .Release.Name }}-redis"
{{- else }}
value: "{{ join "," .Values.zammadConfig.redis.sentinel.sentinels }}"
{{- end }}
- name: REDIS_SENTINEL_NAME
value: "{{ .Values.zammadConfig.redis.sentinel.masterName | default "mymaster" }}"
{{- if .Values.zammadConfig.redis.sentinel.username }}
- name: REDIS_SENTINEL_USERNAME
value: "{{ .Values.zammadConfig.redis.sentinel.username }}"
{{- end }}
{{- if or .Values.zammadConfig.redis.sentinel.pass .Values.secrets.redis.useExisting }}
- name: REDIS_SENTINEL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "zammad.redisSentinelSecretName" . }}
key: {{ .Values.secrets.redis.sentinel.secretKey }}
{{- end }}
{{- else }}
# standalone
- name: REDIS_URL
value: "redis://{{ .Values.zammadConfig.redis.username }}:$(REDIS_PASSWORD)@{{ if .Values.zammadConfig.redis.enabled }}{{ .Release.Name }}-redis-master{{ else }}{{ .Values.zammadConfig.redis.host }}{{ end }}:{{ .Values.zammadConfig.redis.port }}"
{{- end }}
{{- end }}

{{/*
environment variables for the Zammad Rails stack
*/}}
{{- define "zammad.env" -}}
{{ include "zammad.env.redisVariables" . }}
- 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:
Expand Down
17 changes: 17 additions & 0 deletions zammad/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,20 @@ type: Opaque
data:
{{ .Values.secrets.redis.secretKey }}: {{ .Values.zammadConfig.redis.pass | b64enc | quote }}
{{ end }}

{{ if and .Values.zammadConfig.redis.sentinel.enabled }}
{{ if and .Values.zammadConfig.redis.sentinel.pass (not .Values.secrets.redis.sentinel.useExisting) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "zammad.redisSentinelSecretName" . }}
labels:
{{- include "zammad.labels" . | nindent 4 }}
annotations:
{{- include "zammad.annotations" . | nindent 4 }}
type: Opaque
data:
{{ .Values.secrets.redis.sentinel.secretKey }}: {{ .Values.zammadConfig.redis.sentinel.pass | b64enc | quote }}
{{ end }}
{{ end }}
29 changes: 23 additions & 6 deletions zammad/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ secrets:
useExisting: false
secretKey: redis-password
secretName: redis-pass
sentinel:
useExisting: false
secretKey: redis-sentinel-password
secretName: redis-sentinel-pass
s3:
useExisting: false
secretKey: s3-url
Expand Down Expand Up @@ -268,10 +272,21 @@ zammadConfig:
redis:
# enable/disable redis chart dependency
enabled: true
host: "zammad-redis-master"
host: zammad-redis-master
port: 6379
# leave empty if no username is required
username:
# needs to be the same as the redis.auth.password
pass: zammad
port: 6379

sentinel:
enabled: false # set to true to enable Redis Sentinel
sentinels:
- zammad-redis:26379
masterName: mymaster
# leave empty if no username is required
username:
pass: zammad

scheduler:
resources: {}
Expand Down Expand Up @@ -809,20 +824,22 @@ redis:
metrics:
image:
repository: bitnamilegacy/redis-exporter
sentinel:
image:
repository: bitnamilegacy/redis-sentinel
kubectl:
image:
repository: bitnamilegacy/kubectl
sysctl:
image:
repository: bitnamilegacy/os-shell
sentinel:
image:
repository: bitnamilegacy/redis-sentinel
# set to true to enable Redis Sentinel
enabled: false
global:
security:
allowInsecureImages: true

architecture: standalone
architecture: standalone # set to 'replication' to use Redis Sentinel
auth:
password: zammad
# To avoid passwords in your values.yaml, you can comment out the line above
Expand Down
Loading