Skip to content

Commit

Permalink
Add extraVolumeSecrets chart value
Browse files Browse the repository at this point in the history
This value can be used to render `volumes` and `volumeMounts`.
  • Loading branch information
avorima committed Nov 23, 2020
1 parent 383a506 commit e166237
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-autoscaler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ name: cluster-autoscaler
sources:
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
type: application
version: 9.0.0
version: 9.0.1
1 change: 1 addition & 0 deletions charts/cluster-autoscaler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _
| expanderPriorities | object | `{}` | The expanderPriorities is used if `extraArgs.expander` is set to `priority` and expanderPriorities is also set with the priorities. If `extraArgs.expander` is set to `priority`, then expanderPriorities is used to define cluster-autoscaler-priority-expander priorities. See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md |
| extraArgs | object | `{"logtostderr":true,"stderrthreshold":"info","v":4}` | Additional container arguments. |
| extraEnv | object | `{}` | Additional container environment variables. |
| extraVolumeSecrets | object | `{}` | Additional volumes to mount from Secrets. |
| fullnameOverride | string | `""` | String to fully override `cluster-autoscaler.fullname` template. |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.pullSecrets | list | `[]` | Image pull secrets |
Expand Down
22 changes: 20 additions & 2 deletions charts/cluster-autoscaler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,23 @@ spec:
securityContext:
{{ toYaml .Values.containerSecurityContext | nindent 12 | trim }}
{{- end }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") .Values.extraVolumeSecrets }}
volumeMounts:
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
- name: cloudconfig
mountPath: {{ .Values.cloudConfigPath }}
readOnly: true
{{- end }}
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
- name: ca-bundle
mountPath: {{ .Values.magnumCABundlePath }}
readOnly: true
{{- end }}
{{- range $key, $value := .Values.extraVolumeSecrets }}
- name: {{ $key }}
mountPath: {{ required "Must specify mountPath!" $value.mountPath }}
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.affinity }}
affinity:
Expand All @@ -199,16 +206,27 @@ spec:
securityContext:
{{ toYaml .Values.securityContext | nindent 8 | trim }}
{{- end }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") .Values.extraVolumeSecrets }}
volumes:
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
- name: cloudconfig
hostPath:
path: {{ .Values.cloudConfigPath }}
{{- end }}
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
- name: ca-bundle
hostPath:
path: {{ .Values.magnumCABundlePath }}
{{- end }}
{{- range $key, $value := .Values.extraVolumeSecrets }}
- name: {{ $key }}
secret:
secretName: {{ default (include "cluster-autoscaler.fullname" $) $value.name }}
{{- if $value.items }}
items:
{{- toYaml $value.items | nindent 14 }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
Expand Down
11 changes: 11 additions & 0 deletions charts/cluster-autoscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ extraArgs:
# extraEnv -- Additional container environment variables.
extraEnv: {}

# extraVolumeSecrets -- Additional volumes to mount from Secrets.
extraVolumeSecrets: {}
# autoscaler-vol:
# mountPath: /data/autoscaler/
# custom-vol:
# name: custom-secret
# mountPath: /data/custom/
# items:
# - key: subkey
# path: mypath

# fullnameOverride -- String to fully override `cluster-autoscaler.fullname` template.
fullnameOverride: ""

Expand Down

0 comments on commit e166237

Please sign in to comment.