Skip to content

Commit 3597489

Browse files
committed
Replace custom redis with bitnami redis with persistence storage
1 parent 9bea17a commit 3597489

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

deploy/helm/ifrcgo-helm/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.helm-charts
22
values-local.yaml
3+
charts

deploy/helm/ifrcgo-helm/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ version: 0.0.2-SET-BY-CICD
55

66
sources:
77
- https://github.com/IFRCGo/go-api
8+
9+
dependencies:
10+
- name: redis
11+
version: "20.7.1"
12+
repository: https://charts.bitnami.com/bitnami
13+
condition: redis.enabled
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: redis
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 20.7.1
5+
digest: sha256:1852c9489ae647e0394ccb39fa70787bb29ebbdbe24b89b914ce01a2adc6ff29
6+
generated: "2025-02-18T16:08:53.322089326+05:45"

deploy/helm/ifrcgo-helm/templates/config/configmap.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ metadata:
77
environment: {{ .Values.environment }}
88
release: {{ .Release.Name }}
99
data:
10-
CELERY_REDIS_URL: "redis://{{ template "ifrcgo-helm.fullname" . }}-redis:6379/0"
11-
CACHE_REDIS_URL: "redis://{{ template "ifrcgo-helm.fullname" . }}-redis:6379/1"
10+
# Redis
11+
{{- if .Values.redis.enabled }}
12+
CELERY_REDIS_URL: "redis://{{ printf "%s-master" (include "common.names.fullname" .Subcharts.redis) }}:6379/0"
13+
CACHE_REDIS_URL: "redis://{{ printf "%s-master" (include "common.names.fullname" .Subcharts.redis) }}:6379/1"
14+
{{- else }}
15+
CELERY_REDIS_URL: {{ required "env.CELERY_REDIS_URL" .Values.env.CELERY_REDIS_URL | quote }}
16+
CACHE_REDIS_URL: {{ required "env.CACHE_REDIS_URL" .Values.env.CACHE_REDIS_URL | quote }}
17+
{{- end }}
18+
1219
CACHE_MIDDLEWARE_SECONDS: {{ .Values.env.CACHE_MIDDLEWARE_SECONDS | quote }}
1320
DJANGO_DEBUG: {{ .Values.env.DJANGO_DEBUG | quote }}
1421
ELASTIC_SEARCH_HOST: {{ default (printf "elasticsearch://%s-elasticsearch:9200" (include "ifrcgo-helm.fullname" .)) .Values.env.ELASTIC_SEARCH_HOST | quote }}

deploy/helm/ifrcgo-helm/values.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ secretsAdditional:
8484
# Additional secrets
8585
# EXAMPLE: MY_SECRET: "my-secret-value"
8686

87+
redis:
88+
enabled: true
89+
architecture: standalone
90+
fullnameOverride: go-redis
91+
auth:
92+
enabled: false
93+
master:
94+
persistence:
95+
enabled: true
96+
size: 1Gi
97+
resources:
98+
requests:
99+
cpu: "0.5"
100+
memory: 1Gi
101+
limits:
102+
cpu: "1"
103+
memory: 2Gi
104+
87105
api:
88106
domain: "go-staging.ifrc.org"
89107
tls:
@@ -104,16 +122,6 @@ api:
104122
cpu: "2"
105123
memory: 4Gi
106124

107-
redis:
108-
enabled: true
109-
resources:
110-
requests:
111-
cpu: "0.5"
112-
memory: 1Gi
113-
limits:
114-
cpu: "1"
115-
memory: 2Gi
116-
117125
celery:
118126
enabled: true
119127
resources:

0 commit comments

Comments
 (0)