Skip to content

Commit

Permalink
feat: add support for specifying a service account (#4)
Browse files Browse the repository at this point in the history
* feat: add support for specifying a service account

* docs: fix typo
  • Loading branch information
mojixcoder authored Sep 4, 2024
1 parent 2bc692f commit 9c28b1c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
3 changes: 3 additions & 0 deletions templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ fullnameOverride: ""
minReadySeconds: 0
priorityClassName: ""

serviceAccount:
enabled: false
name: ""

redis:
image: redis:7.2.4
port: 6379
Expand Down

0 comments on commit 9c28b1c

Please sign in to comment.