Skip to content

Commit

Permalink
Add extraEnvConfigMaps and document some values
Browse files Browse the repository at this point in the history
There already is `envFromSecret` and `extraEnvSecrets`, so I made
`envFromConfigMap` behave like `envFromSecret` and added
`extraEnvConfigMaps` to replace it.

This pattern should make the intended use of the values clearer.
  • Loading branch information
avorima committed Nov 17, 2020
1 parent dfc5619 commit 0fb17f4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-autoscaler-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ name: cluster-autoscaler-chart
sources:
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
type: application
version: 1.1.1
version: 1.1.2
8 changes: 8 additions & 0 deletions charts/cluster-autoscaler-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ The previous `cluster-autoscaler` Helm chart hosted at [helm/charts](https://git
- This repository **only** supports Helm chart installations using Helm 3+ since the `apiVersion` on the charts has been marked as `v2`.
- Previous versions of the Helm chart have not been migrated, and the version was reset to `1.0.0` at the onset. If you are looking for old versions of the chart, it's best to run `helm pull stable/cluster-autoscaler --version <your-version>` until you are ready to move to this repository's version.

### Migrating values

Starting from chart version `9.0.0` the `envFromConfigMap` value is expected to contain a ConfigMap name that is used as ref for `envFrom`. If you want to keep the previous behaviour of `envFromConfigMap` you must rename it to `extraEnvConfigMaps`.

## Installing the Chart

**By default, no deployment is created and nothing will autoscale**.
Expand Down Expand Up @@ -334,9 +338,13 @@ Though enough for the majority of installations, the default PodSecurityPolicy _
| cloudProvider | string | `"aws"` | The cloud provider where the autoscaler runs. Currently only `gce`, `aws`, `azure` and `magnum` are supported. `aws` supported for AWS. `gce` for GCE. `azure` for Azure AKS. `magnum` for OpenStack Magnum. |
| containerSecurityContext | object | `{}` | [Security context for container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
| dnsPolicy | string | `"ClusterFirst"` | Defaults to `ClusterFirst`. Valid values are: `ClusterFirstWithHostNet`, `ClusterFirst`, `Default` or `None`. If autoscaler does not depend on cluster DNS, recommended to set this to `Default`. |
| envFromConfigMap | string | `""` | ConfigMap name to use as envFrom. |
| envFromSecret | string | `""` | Secret name to use as envFrom. |
| 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. |
| extraEnvConfigMaps | object | `{}` | Additional container environment variables from ConfigMaps. |
| extraEnvSecrets | object | `{}` | Additional container environment variables 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
4 changes: 4 additions & 0 deletions charts/cluster-autoscaler-chart/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ The previous `cluster-autoscaler` Helm chart hosted at [helm/charts](https://git
- This repository **only** supports Helm chart installations using Helm 3+ since the `apiVersion` on the charts has been marked as `v2`.
- Previous versions of the Helm chart have not been migrated, and the version was reset to `1.0.0` at the onset. If you are looking for old versions of the chart, it's best to run `helm pull stable/cluster-autoscaler --version <your-version>` until you are ready to move to this repository's version.

### Migrating values

Starting from chart version `9.0.0` the `envFromConfigMap` value is expected to contain a ConfigMap name that is used as ref for `envFrom`. If you want to keep the previous behaviour of `envFromConfigMap` you must rename it to `extraEnvConfigMaps`.

## Installing the Chart

**By default, no deployment is created and nothing will autoscale**.
Expand Down
10 changes: 8 additions & 2 deletions charts/cluster-autoscaler-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ spec:
- name: {{ $key }}
value: "{{ $value }}"
{{- end }}
{{- range $key, $value := .Values.envFromConfigMap }}
{{- range $key, $value := .Values.extraEnvConfigMaps }}
- name: {{ $key }}
valueFrom:
configMapKeyRef:
Expand All @@ -156,11 +156,17 @@ spec:
name: {{ default (include "cluster-autoscaler.fullname" $) $value.name }}
key: {{ required "Must specify key!" $value.key }}
{{- end }}
{{- if .Values.envFromSecret }}
{{- if or .Values.envFromSecret .Values.envFromConfigMap }}
envFrom:
{{- if .Values.envFromSecret }}
- secretRef:
name: {{ .Values.envFromSecret }}
{{- end }}
{{- if .Values.envFromConfigMap }}
- configMapRef:
name: {{ .Values.envFromConfigMap }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /health-check
Expand Down
12 changes: 12 additions & 0 deletions charts/cluster-autoscaler-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ extraArgs:
# extraEnv -- Additional container environment variables.
extraEnv: {}

# extraEnvConfigMaps -- Additional container environment variables from ConfigMaps.
extraEnvConfigMaps: {}

# extraEnvSecrets -- Additional container environment variables from Secrets.
extraEnvSecrets: {}

# envFromConfigMap -- ConfigMap name to use as envFrom.
envFromConfigMap: ""

# envFromSecret -- Secret name to use as envFrom.
envFromSecret: ""

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

Expand Down

0 comments on commit 0fb17f4

Please sign in to comment.