diff --git a/zammad/Chart.yaml b/zammad/Chart.yaml index 35f6370f..8c730d69 100755 --- a/zammad/Chart.yaml +++ b/zammad/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: zammad -version: 15.4.1 -appVersion: 6.5.2-43 +version: 15.5.0 +appVersion: develop 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 diff --git a/zammad/ci/full-values.yaml b/zammad/ci/full-values.yaml index 66310765..db3ef2dc 100755 --- a/zammad/ci/full-values.yaml +++ b/zammad/ci/full-values.yaml @@ -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 @@ -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: @@ -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 diff --git a/zammad/templates/_helpers.tpl b/zammad/templates/_helpers.tpl index 16fa3ba2..ce093e5c 100755 --- a/zammad/templates/_helpers.tpl +++ b/zammad/templates/_helpers.tpl @@ -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 */}} @@ -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: diff --git a/zammad/templates/secrets.yaml b/zammad/templates/secrets.yaml index 0e472330..c707684e 100644 --- a/zammad/templates/secrets.yaml +++ b/zammad/templates/secrets.yaml @@ -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 }} diff --git a/zammad/values.yaml b/zammad/values.yaml index dfa8e106..74313643 100755 --- a/zammad/values.yaml +++ b/zammad/values.yaml @@ -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 @@ -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: {} @@ -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