From 0fb9e7753a686be1bb67d8d8c6f9faf7628e2c50 Mon Sep 17 00:00:00 2001 From: Mojtaba Arezoomand Date: Wed, 4 Sep 2024 19:32:48 +0330 Subject: [PATCH 1/2] feat: add support for specifying a service account --- README.md | 2 ++ templates/statefulset.yaml | 3 +++ values.yaml | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 6dc9bcf..d5b6147 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ This repository contains Redis cluster helm charts that can survive pod restarts `securityContext` | Pod's security context | `{}` `minReadySeconds` | minimum number of seconds for which a newly created Pod should be running and ready without any of its containers crashing, for it to be considered available | `10` `priorityClassName` | Priority indicates the importance of a Pod relative to other Pods | `high-priority` +`serviceAccount.enabled` | Enable or disable service account | `false` +`serviceAccount.name` | Name of the service account | `"default"` `redis.image` | Redis docker image | `redis:7.2.4` `redis.port` | Redis server port | `6379` `redis.bus` | Redis cluster bus port | `16379` diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index cb0f77a..1898ce8 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -16,6 +16,9 @@ spec: metadata: labels: {{ include "redis-cluster.labels" . | nindent 8 }} spec: + {{- if and .Values.serviceAccount .Values.serviceAccount.enabled }} + serviceAccountName: {{ .Values.serviceAccount.name }} + {{- end }} {{- if and .Values.securityContext .Values.securityContext.enabled }} securityContext: {{ omit .Values.securityContext "enabled" | toYaml | nindent 8 }} {{- end }} diff --git a/values.yaml b/values.yaml index 5294d38..9ab5265 100644 --- a/values.yaml +++ b/values.yaml @@ -4,6 +4,10 @@ fullnameOverride: "" minReadySeconds: 0 priorityClassName: "" +serviceAccount: + enabled: false + name: "" + redis: image: redis:7.2.4 port: 6379 From b80211b0ef154e8d4e7a4c72998b6f00fd733de5 Mon Sep 17 00:00:00 2001 From: Mojtaba Arezoomand Date: Wed, 4 Sep 2024 19:34:14 +0330 Subject: [PATCH 2/2] docs: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d5b6147..5b3107f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repository contains Redis cluster helm charts that can survive pod restarts `minReadySeconds` | minimum number of seconds for which a newly created Pod should be running and ready without any of its containers crashing, for it to be considered available | `10` `priorityClassName` | Priority indicates the importance of a Pod relative to other Pods | `high-priority` `serviceAccount.enabled` | Enable or disable service account | `false` -`serviceAccount.name` | Name of the service account | `"default"` +`serviceAccount.name` | Name of the service account | `default` `redis.image` | Redis docker image | `redis:7.2.4` `redis.port` | Redis server port | `6379` `redis.bus` | Redis cluster bus port | `16379`