Skip to content

Commit 08679ba

Browse files
authoredJan 22, 2024
[bitnami/redis] fix: 🔒 Move service-account token auto-mount to pod declaration (#22455)
* [bitnami/redis] fix: 🔒 Move service-account token auto-mount to pod declaration Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com> * test: ✅ Update goss test to reflect new value Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com> * fix: 🐛 Remove duplicate deployment value Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com> --------- Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com> Signed-off-by: Javier J. Salmerón-García <jsalmeron@vmware.com>
1 parent 9d9508b commit 08679ba

File tree

8 files changed

+14
-6
lines changed

8 files changed

+14
-6
lines changed
 

‎.vib/redis/goss/goss.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ command:
3838
# or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
3939
exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
4040
exit-status: 0
41-
{{ if .Vars.master.serviceAccount.automountServiceAccountToken }}
41+
{{ if .Vars.master.automountServiceAccountToken }}
4242
check-sa:
4343
exec: cat /var/run/secrets/kubernetes.io/serviceaccount/token | cut -d '.' -f 2 | xargs -I '{}' echo '{}====' | fold -w 4 | sed '$ d' | tr -d '\n' | base64 -d
4444
exit-status: 0

‎.vib/redis/runtime-parameters.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ master:
2525
type: LoadBalancer
2626
serviceAccount:
2727
create: true
28-
automountServiceAccountToken: true
28+
automountServiceAccountToken: true
2929
replica:
3030
replicaCount: 3
3131
containerPorts:

‎bitnami/redis/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ maintainers:
3434
name: redis
3535
sources:
3636
- https://github.com/bitnami/charts/tree/main/bitnami/redis
37-
version: 18.7.1
37+
version: 18.8.0

‎bitnami/redis/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ The command removes all the Kubernetes components associated with the chart and
180180
| `master.updateStrategy.type` | Redis&reg; master statefulset strategy type | `RollingUpdate` |
181181
| `master.minReadySeconds` | How many seconds a pod needs to be ready before killing the next, during update | `0` |
182182
| `master.priorityClassName` | Redis&reg; master pods' priorityClassName | `""` |
183+
| `master.automountServiceAccountToken` | Mount Service Account token in pod | `false` |
183184
| `master.hostAliases` | Redis&reg; master pods host aliases | `[]` |
184185
| `master.podLabels` | Extra labels for Redis&reg; master pods | `{}` |
185186
| `master.podAnnotations` | Annotations for Redis&reg; master pods | `{}` |
@@ -298,6 +299,7 @@ The command removes all the Kubernetes components associated with the chart and
298299
| `replica.minReadySeconds` | How many seconds a pod needs to be ready before killing the next, during update | `0` |
299300
| `replica.priorityClassName` | Redis&reg; replicas pods' priorityClassName | `""` |
300301
| `replica.podManagementPolicy` | podManagementPolicy to manage scaling operation of %%MAIN_CONTAINER_NAME%% pods | `""` |
302+
| `replica.automountServiceAccountToken` | Mount Service Account token in pod | `false` |
301303
| `replica.hostAliases` | Redis&reg; replicas pods host aliases | `[]` |
302304
| `replica.podLabels` | Extra labels for Redis&reg; replicas pods | `{}` |
303305
| `replica.podAnnotations` | Annotations for Redis&reg; replicas pods | `{}` |

‎bitnami/redis/templates/master/application.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
securityContext: {{- omit .Values.master.podSecurityContext "enabled" | toYaml | nindent 8 }}
6666
{{- end }}
6767
serviceAccountName: {{ template "redis.masterServiceAccountName" . }}
68-
automountServiceAccountToken: {{ .Values.master.serviceAccount.automountServiceAccountToken }}
68+
automountServiceAccountToken: {{ .Values.master.automountServiceAccountToken }}
6969
{{- if .Values.master.priorityClassName }}
7070
priorityClassName: {{ .Values.master.priorityClassName | quote }}
7171
{{- end }}

‎bitnami/redis/templates/replicas/application.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spec:
6363
securityContext: {{- omit .Values.replica.podSecurityContext "enabled" | toYaml | nindent 8 }}
6464
{{- end }}
6565
serviceAccountName: {{ template "redis.replicaServiceAccountName" . }}
66-
automountServiceAccountToken: {{ .Values.replica.serviceAccount.automountServiceAccountToken }}
66+
automountServiceAccountToken: {{ .Values.replica.automountServiceAccountToken }}
6767
{{- if .Values.replica.priorityClassName }}
6868
priorityClassName: {{ .Values.replica.priorityClassName | quote }}
6969
{{- end }}

‎bitnami/redis/templates/sentinel/statefulset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ spec:
5454
{{- end }}
5555
spec:
5656
{{- include "redis.imagePullSecrets" . | nindent 6 }}
57+
automountServiceAccountToken: {{ .Values.replica.automountServiceAccountToken }}
5758
{{- if .Values.replica.hostAliases }}
5859
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.replica.hostAliases "context" $) | nindent 8 }}
5960
{{- end }}
6061
{{- if .Values.replica.podSecurityContext.enabled }}
6162
securityContext: {{- omit .Values.replica.podSecurityContext "enabled" | toYaml | nindent 8 }}
6263
{{- end }}
63-
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
6464
serviceAccountName: {{ template "redis.serviceAccountName" . }}
6565
{{- if .Values.replica.priorityClassName }}
6666
priorityClassName: {{ .Values.replica.priorityClassName | quote }}

‎bitnami/redis/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ master:
333333
## @param master.priorityClassName Redis&reg; master pods' priorityClassName
334334
##
335335
priorityClassName: ""
336+
## @param master.automountServiceAccountToken Mount Service Account token in pod
337+
##
338+
automountServiceAccountToken: false
336339
## @param master.hostAliases Redis&reg; master pods host aliases
337340
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
338341
##
@@ -792,6 +795,9 @@ replica:
792795
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies
793796
##
794797
podManagementPolicy: ""
798+
## @param replica.automountServiceAccountToken Mount Service Account token in pod
799+
##
800+
automountServiceAccountToken: false
795801
## @param replica.hostAliases Redis&reg; replicas pods host aliases
796802
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
797803
##

0 commit comments

Comments
 (0)
Please sign in to comment.