diff --git a/README.md b/README.md index 6dc9bcf..5b3107f 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