Skip to content
Snippets Groups Projects
Commit 3126341b authored by maik.schaefer's avatar maik.schaefer Committed by julian.baeume
Browse files

Changed: Update redis values in helm chart

parent a1495f40
No related branches found
No related tags found
No related merge requests found
......@@ -14,4 +14,6 @@ REDIS_SENTINEL_MASTER_ID=mymaster
REDIS_DB=0
REDIS_PREFIX=ui-middleware
REDIS_HOSTS=localhost:6379
REDIS_USERNAME=
REDIS_PASSWORD=
ORIGINS=*
......@@ -43,7 +43,9 @@ It is possible to horizontally scale the UI Middleware, as more clients are fetc
| N/A (see above) | `REDIS_HOSTS` | Redis hosts as string | `"localhost:6379"` |
| `redis.db` | `REDIS_DB` | Redis DB, e.g. `"1"` | null |
| `redis.prefix` | `REDIS_PREFIX` | Redis prefix | `"ui-middleware"` |
| `redis.password` | `REDIS_PASSWORD` | Redis password | null |
| `redis.auth.enabled` | N/A | Generate redis auth secret | `false` |
| `redis.username` | `REDIS_USERNAME` | Redis username | `""` |
| `redis.password` | `REDIS_PASSWORD` | Redis password | `""` |
| `redis.sidecar.image` | N/A | Redis sidecar image | `"redis:latest"` |
| `compressFileSize` | `COMPRESS_FILE_SIZE` | Larger files will be gzipped | `600` |
| `compressFileTypes` | `COMPRESS_FILE_TYPES` | Set of compression mime types | application/javascript application/json application/x-javascript application/xml application/xml+rss text/css text/html text/javascript text/plain text/xml image/svg+xml |
......
......@@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.0.1
version: 2.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
......
......@@ -60,3 +60,11 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- define "core-ui-middleware.redisSecret" -}}
{{- if .Values.overrides.redisSecret -}}
{{- .Values.overrides.redisSecret -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name "core-ui-middleware-redis" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
......@@ -41,8 +41,22 @@ spec:
value: "{{ .Values.redis.hosts | join "," }}"
- name: REDIS_DB
value: "{{ .Values.redis.db | int }}"
{{- if eq .Values.redis.mode "sentinel" }}
- name: REDIS_SENTINEL_MASTER_ID
value: {{ .Values.redis.sentinelMasterId | quote }}
{{- end }}
{{- if .Values.redis.auth.enabled }}
- name: REDIS_USERNAME
valueFrom:
secretKeyRef:
name: {{ include "core-ui-middleware.redisSecret" . }}
key: username
- name: REDIS_PASSWORD
value: "{{ .Values.redis.password }}"
valueFrom:
secretKeyRef:
name: {{ include "core-ui-middleware.redisSecret" . }}
key: password
{{- end }}
- name: REDIS_PREFIX
value: "{{ .Values.redis.prefix }}"
ports:
......
{{- if .Values.redis.auth.enabled -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "core-ui-middleware.redisSecret" . }}
type: Opaque
data:
username: {{ .Values.redis.auth.username | b64enc | quote }}
password: {{ .Values.redis.auth.password | b64enc | quote }}
{{- end -}}
......@@ -41,8 +41,22 @@ spec:
value: "{{ .Values.redis.hosts | join "," }}"
- name: REDIS_DB
value: "{{ .Values.redis.db | int }}"
{{- if eq .Values.redis.mode "sentinel" }}
- name: REDIS_SENTINEL_MASTER_ID
value: {{ .Values.redis.sentinelMasterId | quote }}
{{- end }}
{{- if .Values.redis.auth.enabled }}
- name: REDIS_USERNAME
valueFrom:
secretKeyRef:
name: {{ include "core-ui-middleware.redisSecret" . }}
key: username
- name: REDIS_PASSWORD
value: "{{ .Values.redis.password }}"
valueFrom:
secretKeyRef:
name: {{ include "core-ui-middleware.redisSecret" . }}
key: password
{{- end }}
- name: REDIS_PREFIX
value: "{{ .Values.redis.prefix }}"
ports:
......
......@@ -120,7 +120,11 @@ redis:
hosts:
- localhost:6379
db: 0
password: null
sentinelMasterId: "mymaster"
auth:
enabled: false
username: ""
password: ""
prefix: ui-middleware
# This is only used for development. A sidecar container is started in the pod.
# Note: This does not scale!
......
......@@ -32,6 +32,7 @@ const hosts = (process.env.REDIS_HOSTS || '').split(',').map(host => {
export function createClient (id, options = commonQueueOptions) {
options = {
username: process.env.REDIS_USERNAME,
db: Number(process.env.REDIS_DB),
password: process.env.REDIS_PASSWORD,
...options
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment