Skip to content

Commit d3d9c54

Browse files
committed
fix: Switch to official redis image (#10173)
1 parent b1ef4a1 commit d3d9c54

File tree

8 files changed

+54
-26
lines changed

8 files changed

+54
-26
lines changed

.github/workflows/deploy-dependencies.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,4 @@ jobs:
4545
-f environments/${ENV}/dependencies/values.yaml \
4646
--create-namespace \
4747
--set hostname=${{ vars.DOMAIN }} \
48-
--set storage_type=host_path \
4948
--atomic

.github/workflows/deploy-opencrvs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ jobs:
8484
--set hostname=${{ vars.DOMAIN }} \
8585
--create-namespace \
8686
--atomic
87+
- name: Copy secrets from dependencies into application namespace
88+
# Only redis secret for now needs to be copied
89+
run: |
90+
secrets=(
91+
"redis-opencrvs-users"
92+
)
93+
for secret in "${secrets[@]}"; do
94+
kubectl get secret $secret -n opencrvs-deps-e2e -o yaml \
95+
| sed "s#namespace: opencrvs-deps-e2e#namespace: opencrvs-${ENV}#" \
96+
| grep -vE 'resourceVersion|uid|creationTimestamp' \
97+
| kubectl apply -n opencrvs-${ENV} -f - \
98+
|| echo "Secret $secret doesn't exist in opencrvs-deps-e2e namespace"
99+
done
87100
- name: "FIXME: temporary remove data-migration job due to issues"
88101
run: |
89102
kubectl delete job -n "opencrvs-${ENV}" --ignore-not-found=true data-migration || true

.github/workflows/k8s-reset-data.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
type: choice
1313
options:
1414
- demo
15+
- dev
1516
workflow_call:
1617
inputs:
1718
environment:

.github/workflows/k8s-seed-data.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
type: choice
1111
options:
1212
- demo
13+
- dev
1314
workflow_call:
1415
inputs:
1516
environment:

charts/dependencies/templates/redis-secrets.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,17 @@ data:
6363
{{- end }}
6464

6565
{{- end }}
66+
---
67+
apiVersion: v1
68+
kind: ConfigMap
69+
metadata:
70+
name: redis-opencrvs-conf
71+
data:
72+
redis.conf: |
73+
bind 0.0.0.0
74+
protected-mode yes
75+
port 6379
76+
77+
# path to ACL file (from the Secret mount)
78+
aclfile /usr/local/etc/redis/users.acl
6679
{{- end }}

charts/dependencies/templates/redis.yaml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,40 @@ spec:
3030
labels:
3131
app: redis
3232
spec:
33+
securityContext:
34+
runAsUser: 999
35+
runAsGroup: 999
36+
fsGroup: 999
3337
containers:
34-
# FIXME: https://github.com/opencrvs/opencrvs-core/issues/10173
35-
- image: public.ecr.aws/bitnami/redis:8.2
38+
- image: redis:8
39+
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
3640
name: redis
41+
{{- if .Values.redis.env }}
3742
env:
38-
{{- if eq .Values.redis.auth_mode "acl" }}
39-
- name: REDIS_ACLFILE
40-
value: /opt/bitnami/redis/mounted-etc/users.acl
41-
- name: REDIS_PASSWORD
42-
value: "false"
43-
{{- else if eq .Values.redis.auth_mode "password" }}
44-
- name: REDIS_PASSWORD
45-
valueFrom:
46-
secretKeyRef:
47-
name: redis-opencrvs-users
48-
key: DEFAULT_REDIS_PASSWORD
49-
{{- else }}
50-
- name: ALLOW_EMPTY_PASSWORD
51-
value: "yes"
52-
{{- end }}
53-
5443
{{- include "render-env-vars" (dict "service_name" "redis" "Values" .Values) }}
44+
{{- end }}
5545
ports:
5646
- containerPort: 6379
5747
protocol: TCP
5848
{{- if eq .Values.redis.auth_mode "acl" }}
5949
volumeMounts:
60-
- name: redis-opencrvs-acl
61-
mountPath: /opt/bitnami/redis/mounted-etc
62-
# subPath: redis-acl.conf
50+
- name: redis-conf
51+
mountPath: /usr/local/etc/redis/redis.conf
52+
subPath: redis.conf
53+
readOnly: true
54+
- name: redis-acl
55+
mountPath: /usr/local/etc/redis/users.acl
56+
subPath: users.acl
57+
readOnly: true
6358
{{- end }}
6459
restartPolicy: Always
6560
volumes:
66-
{{- if eq .Values.redis.auth_mode "acl" }}
67-
- name: redis-opencrvs-acl
61+
{{- if eq .Values.redis.auth_mode "acl" }}
62+
- name: redis-acl
6863
secret:
6964
secretName: redis-opencrvs-acl
70-
{{- end }}
65+
- name: redis-conf
66+
configMap:
67+
name: redis-opencrvs-conf
68+
{{- end }}
7169
{{- end }}

environments/dev/dependencies/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ postgres:
1717

1818
monitoring:
1919
enabled: true
20+
21+
redis:
22+
auth_mode: acl

environments/dev/opencrvs-services/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ mongodb:
3131
host: mongodb-0.mongodb.opencrvs-deps-dev.svc.cluster.local
3232

3333
redis:
34-
auth_mode: disabled
34+
auth_mode: use_secret
3535
host: redis-0.redis.opencrvs-deps-dev.svc.cluster.local
3636

3737
postgres:

0 commit comments

Comments
 (0)