Skip to content

Commit

Permalink
feat(helm): support password-protected redis (#847)
Browse files Browse the repository at this point in the history
REANA can now connect to password-protected Redis instances.
  • Loading branch information
mdonadoni committed Nov 22, 2024
1 parent 1ca9dea commit be12076
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/reana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ This Helm automatically prefixes all names using the release name to avoid colli
| `reana_hostname` | REANA hostname (e.g. reana.example.org) | None |
| `namespace_runtime` | Namespace in which the REANA runtime pods (workflow engines, jobs etc...) will run | `.Release.Namespace` |
| `naming_scheme` | REANA component naming scheme | None |
| `secrets.cache.password` | **[Do not use in production, use secrets instead]** Cache (Redis) password | None |
| `secrets.cern.sso.CERN_CONSUMER_KEY` | CERN SSO consumer key | None |
| `secrets.cern.sso.CERN_CONSUMER_SECRET` | **[Do not use in production, use secrets instead]** CERN SSO consumer secret | None |
| `secrets.database.password` | **[Do not use in production, use secrets instead]** PostgreSQL database password | None |
Expand Down
9 changes: 9 additions & 0 deletions helm/reana/templates/reana-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ spec:
containers:
- name: cache
image: docker.io/library/redis:5.0.5
env:
- name: REANA_CACHE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "reana.prefix" . }}-cache-secrets
key: password
args:
- "--requirepass"
- "$(REANA_CACHE_PASSWORD)"
ports:
- containerPort: 6379
{{- if .Values.node_label_infrastructure }}
Expand Down
5 changes: 5 additions & 0 deletions helm/reana/templates/reana-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ spec:
secretKeyRef:
name: {{ include "reana.prefix" . }}-secrets
key: REANA_SECRET_KEY
- name: REANA_CACHE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "reana.prefix" . }}-cache-secrets
key: password
{{- if .Values.debug.enabled }}
# Disable CORS in development environment, for example
# to connect from an external React application.
Expand Down
11 changes: 11 additions & 0 deletions helm/reana/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ data:
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "reana.prefix" . }}-cache-secrets
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/resource-policy": keep
type: Opaque
data:
password: {{ .Values.secrets.cache.password | default "" | b64enc | quote }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "reana.prefix" . }}-cern-sso-secrets
namespace: {{ .Release.Namespace }}
Expand Down
1 change: 1 addition & 0 deletions helm/reana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ infrastructure_storage: {}

secrets:
database: {}
cache: {}
gitlab: {}
cern:
sso: {}
Expand Down

0 comments on commit be12076

Please sign in to comment.