From a459132dcecc7554e8e8b90ab2d1d853d5d4cfa1 Mon Sep 17 00:00:00 2001 From: Shubham Gupta <69793468+shubham-cmyk@users.noreply.github.com> Date: Wed, 11 Oct 2023 01:00:06 +0530 Subject: [PATCH] [ Fix ] : Redis Cluster Chart (#152) * space Signed-off-by: Shubham Gupta * fix name Signed-off-by: Shubham Gupta * fix lint Signed-off-by: Shubham Gupta * fix helpers.tpl Signed-off-by: Shubham Gupta * bump version Signed-off-by: Shubham Gupta --------- Signed-off-by: Shubham Gupta --- charts/redis-cluster/Chart.yaml | 2 +- charts/redis-cluster/templates/_helpers.tpl | 18 +++++++++++++----- .../redis-cluster/templates/redis-cluster.yaml | 4 ++-- charts/redis-cluster/values.yaml | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/charts/redis-cluster/Chart.yaml b/charts/redis-cluster/Chart.yaml index fc0f16f2..c6c920c5 100644 --- a/charts/redis-cluster/Chart.yaml +++ b/charts/redis-cluster/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: redis-cluster description: Provides easy redis setup definitions for Kubernetes services, and deployment. -version: 0.15.7 +version: 0.15.8 appVersion: "0.15.1" home: https://github.com/ot-container-kit/redis-operator sources: diff --git a/charts/redis-cluster/templates/_helpers.tpl b/charts/redis-cluster/templates/_helpers.tpl index 7ca79dbd..cb9c07a7 100644 --- a/charts/redis-cluster/templates/_helpers.tpl +++ b/charts/redis-cluster/templates/_helpers.tpl @@ -17,19 +17,27 @@ app.kubernetes.io/component: middleware {{/* Helper for Redis Cluster (leader & follower) */}} {{- define "redis.role" -}} -{{- with .affinity }} +{{- if .affinity }} affinity: - {{- toYaml . | nindent 4 }} + {{- toYaml .affinity | nindent 2 }} +{{- end }} +{{- if .tolerations }} +tolerations: + {{- toYaml .tolerations | nindent 2 }} {{- end }} {{- if .pdb.enabled }} pdb: - enabled: "{{ .pdb.enabled | quote }}" + enabled: {{ .pdb.enabled }} maxUnavailable: {{ .pdb.maxUnavailable }} - minAvailable: {{ .pdb.minUnavailable }} + minAvailable: {{ .pdb.minAvailable }} {{- end }} {{- if .nodeSelector }} nodeSelector: - {{- toYaml .nodeSelector | nindent 4 }} + {{- toYaml .nodeSelector | nindent 2 }} +{{- end }} +{{- if .securityContext }} +securityContext: + {{- toYaml .securityContext | nindent 2 }} {{- end }} {{- end -}} diff --git a/charts/redis-cluster/templates/redis-cluster.yaml b/charts/redis-cluster/templates/redis-cluster.yaml index 615d4787..ccbfb12e 100644 --- a/charts/redis-cluster/templates/redis-cluster.yaml +++ b/charts/redis-cluster/templates/redis-cluster.yaml @@ -10,14 +10,14 @@ spec: clusterVersion: {{ .Values.redisCluster.clusterVersion }} redisLeader: {{- include "redis.role" .Values.redisCluster.leader | nindent 4 }} - replicas: {{ .Values.redisCluster.leader.replicas}} + replicas: {{ .Values.redisCluster.leader.replicas }} {{- if .Values.externalConfig.enabled }} redisConfig: additionalRedisConfig: "{{ .Release.Name }}-ext-config" {{- end }} redisFollower: {{- include "redis.role" .Values.redisCluster.follower | nindent 4 }} - replicas: {{ .Values.redisCluster.follower.replicas}} + replicas: {{ .Values.redisCluster.follower.replicas }} {{- if .Values.externalConfig.enabled }} redisConfig: additionalRedisConfig: "{{ .Release.Name }}-ext-config" diff --git a/charts/redis-cluster/values.yaml b/charts/redis-cluster/values.yaml index 320dbc00..b268ceb3 100644 --- a/charts/redis-cluster/values.yaml +++ b/charts/redis-cluster/values.yaml @@ -41,7 +41,7 @@ redisCluster: pdb: enabled: false maxUnavailable: 1 - minUnavailable: 1 + minAvailable: 1 follower: replicas: 3 @@ -66,7 +66,7 @@ redisCluster: pdb: enabled: false maxUnavailable: 1 - minUnavailable: 1 + minAvailable: 1 labels: {} # foo: bar