Skip to content

Commit b201c8d

Browse files
authored
Merge pull request kubernetes#3692 from StratoAG/chart/extra-volumes
Add extraVolumeSecrets chart value
2 parents 19582d9 + 5cd7fba commit b201c8d

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

charts/cluster-autoscaler/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ name: cluster-autoscaler
1717
sources:
1818
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
1919
type: application
20-
version: 9.1.0
20+
version: 9.2.0

charts/cluster-autoscaler/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _
354354
| extraEnv | object | `{}` | Additional container environment variables. |
355355
| extraEnvConfigMaps | object | `{}` | Additional container environment variables from ConfigMaps. |
356356
| extraEnvSecrets | object | `{}` | Additional container environment variables from Secrets. |
357+
| extraVolumeSecrets | object | `{}` | Additional volumes to mount from Secrets. |
357358
| fullnameOverride | string | `""` | String to fully override `cluster-autoscaler.fullname` template. |
358359
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
359360
| image.pullSecrets | list | `[]` | Image pull secrets |

charts/cluster-autoscaler/templates/deployment.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,23 @@ spec:
179179
securityContext:
180180
{{ toYaml .Values.containerSecurityContext | nindent 12 | trim }}
181181
{{- end }}
182-
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
182+
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") .Values.extraVolumeSecrets }}
183183
volumeMounts:
184+
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
184185
- name: cloudconfig
185186
mountPath: {{ .Values.cloudConfigPath }}
186187
readOnly: true
188+
{{- end }}
187189
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
188190
- name: ca-bundle
189191
mountPath: {{ .Values.magnumCABundlePath }}
190192
readOnly: true
191193
{{- end }}
194+
{{- range $key, $value := .Values.extraVolumeSecrets }}
195+
- name: {{ $key }}
196+
mountPath: {{ required "Must specify mountPath!" $value.mountPath }}
197+
readOnly: true
198+
{{- end }}
192199
{{- end }}
193200
{{- if .Values.affinity }}
194201
affinity:
@@ -205,16 +212,27 @@ spec:
205212
securityContext:
206213
{{ toYaml .Values.securityContext | nindent 8 | trim }}
207214
{{- end }}
208-
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
215+
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") .Values.extraVolumeSecrets }}
209216
volumes:
217+
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
210218
- name: cloudconfig
211219
hostPath:
212220
path: {{ .Values.cloudConfigPath }}
221+
{{- end }}
213222
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
214223
- name: ca-bundle
215224
hostPath:
216225
path: {{ .Values.magnumCABundlePath }}
217226
{{- end }}
227+
{{- range $key, $value := .Values.extraVolumeSecrets }}
228+
- name: {{ $key }}
229+
secret:
230+
secretName: {{ default (include "cluster-autoscaler.fullname" $) $value.name }}
231+
{{- if $value.items }}
232+
items:
233+
{{- toYaml $value.items | nindent 14 }}
234+
{{- end }}
235+
{{- end }}
218236
{{- end }}
219237
{{- if .Values.image.pullSecrets }}
220238
imagePullSecrets:

charts/cluster-autoscaler/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ envFromConfigMap: ""
162162
# envFromSecret -- Secret name to use as envFrom.
163163
envFromSecret: ""
164164

165+
# extraVolumeSecrets -- Additional volumes to mount from Secrets.
166+
extraVolumeSecrets: {}
167+
# autoscaler-vol:
168+
# mountPath: /data/autoscaler/
169+
# custom-vol:
170+
# name: custom-secret
171+
# mountPath: /data/custom/
172+
# items:
173+
# - key: subkey
174+
# path: mypath
175+
165176
# fullnameOverride -- String to fully override `cluster-autoscaler.fullname` template.
166177
fullnameOverride: ""
167178

0 commit comments

Comments
 (0)