From 9a80afa66b25779beafa4c0c5451f73bb1b2b220 Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 10 Nov 2023 19:07:29 -0500 Subject: [PATCH] up --- Chart.lock | 7 +++++-- Chart.yaml | 5 +++++ templates/_helpers.tpl | 10 ++++++++-- values.yaml | 16 +++++++++++++++- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Chart.lock b/Chart.lock index 908e3d5..d9be4a5 100644 --- a/Chart.lock +++ b/Chart.lock @@ -8,5 +8,8 @@ dependencies: - name: redis-cluster repository: oci://registry-1.docker.io/bitnamicharts version: 9.1.1 -digest: sha256:35358da69169541a009540a2d6a840584390e5b53dad5b647b19bd5c14c88f93 -generated: "2023-11-06T00:07:24.742145709Z" +- name: redis + repository: oci://registry-1.docker.io/bitnamicharts + version: 18.3.2 +digest: sha256:e2a5ec18698a82e1e1e69c7185efa07836e56463f505fef230baaf45b0788a86 +generated: "2023-11-10T07:59:46.844492907-05:00" diff --git a/Chart.yaml b/Chart.yaml index 5ce023a..eac72dd 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -48,3 +48,8 @@ dependencies: repository: oci://registry-1.docker.io/bitnamicharts version: 9.1.1 condition: redis-cluster.enabled + # https://github.com/bitnami/charts/blob/main/bitnami/redis/Chart.yaml + - name: redis + repository: oci://registry-1.docker.io/bitnamicharts + version: 18.3.2 + condition: redis.enabled \ No newline at end of file diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 003d39f..bb47cd2 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -132,18 +132,24 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- define "redis.dns" -}} {{- if (index .Values "redis-cluster").enabled -}} {{- printf "redis+cluster://:%s@%s-redis-cluster-headless.%s.svc.%s:%g/0?pool_size=100&idle_timeout=180s&" (index .Values "redis-cluster").global.redis.password .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "redis-cluster").service.ports.redis -}} +{{- else if (index .Values "redis").enabled -}} +{{- printf "redis://:%s@%s-redis-headless.%s.svc.%s:%g/0?pool_size=100&idle_timeout=180s&" (index .Values "redis").global.redis.password .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "redis").master.service.ports.redis -}} {{- end -}} {{- end -}} {{- define "redis.port" -}} {{- if (index .Values "redis-cluster").enabled -}} {{ (index .Values "redis-cluster").service.ports.redis }} +{{- else if (index .Values "redis").enabled -}} +{{ (index .Values "redis").master.service.ports.redis }} {{- end -}} {{- end -}} {{- define "redis.servicename" -}} {{- if (index .Values "redis-cluster").enabled -}} {{- printf "%s-redis-cluster-headless.%s.svc.%s" .Release.Name .Release.Namespace .Values.clusterDomain -}} +{{- else if (index .Values "redis").enabled -}} +{{- printf "%s-redis-headless.%s.svc.%s" .Release.Name .Release.Namespace .Values.clusterDomain -}} {{- end -}} {{- end -}} @@ -287,7 +293,7 @@ https {{- if not (hasKey .Values.gitea.config.metrics "ENABLED") -}} {{- $_ := set .Values.gitea.config.metrics "ENABLED" .Values.gitea.metrics.enabled -}} {{- end -}} - {{- if (index .Values "redis-cluster").enabled -}} + {{- if or ((index .Values "redis-cluster").enabled) ((index .Values "redis").enabled) -}} {{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}} {{- $_ := set .Values.gitea.config.cache "ADAPTER" "redis" -}} {{- if not (.Values.gitea.config.cache.HOST) -}} @@ -295,7 +301,7 @@ https {{- end -}} {{- end -}} {{- /* redis queue */ -}} - {{- if (index .Values "redis-cluster").enabled -}} + {{- if or ((index .Values "redis-cluster").enabled) ((index .Values "redis").enabled) -}} {{- $_ := set .Values.gitea.config.queue "TYPE" "redis" -}} {{- $_ := set .Values.gitea.config.queue "CONN_STR" (include "redis.dns" .) -}} {{- end -}} diff --git a/values.yaml b/values.yaml index 34c859d..928cf1a 100644 --- a/values.yaml +++ b/values.yaml @@ -475,12 +475,26 @@ gitea: failureThreshold: 10 ## @section redis-cluster -## @param redis-cluster.enabled Enable redis +## @param redis-cluster.enabled Enable redis cluster ## @param redis-cluster.usePassword Whether to use password authentication redis-cluster: enabled: true usePassword: false +## @section redis +## @param redis.enabled Enable redis standalone or replicated +## @param redis.architecture Whether to use standalone or replication +## @param redis.global.redis.password Required password +## @param redis.replica.replicaCount Number of replicas under master(s) +redis: + enabled: false + architecture: replication + global: + redis: + password: changeme + replica: + replicaCount: 3 + ## @section postgresql-ha # ## @param postgresql-ha.enabled Enable postgresql-ha