Skip to content

Commit

Permalink
Merge pull request #3692 from StratoAG/chart/extra-volumes
Browse files Browse the repository at this point in the history
Add extraVolumeSecrets chart value
  • Loading branch information
k8s-ci-robot authored Dec 3, 2020
2 parents 19582d9 + 5cd7fba commit b201c8d
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.1.0
version: 9.2.0
1 change: 1 addition & 0 deletions charts/cluster-autoscaler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _
| extraEnv | object | `{}` | Additional container environment variables. |
| extraEnvConfigMaps | object | `{}` | Additional container environment variables from ConfigMaps. |
| extraEnvSecrets | object | `{}` | Additional container environment variables from Secrets. |
| 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 @@ -179,16 +179,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 @@ -205,16 +212,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 @@ -162,6 +162,17 @@ envFromConfigMap: ""
# envFromSecret -- Secret name to use as envFrom.
envFromSecret: ""

# 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 b201c8d

Please sign in to comment.