Skip to content

Commit 3fc72cf

Browse files
authored
Merge pull request #7423 from nicolas-laduguie/issue-7422
feat(helm): custom arguments
2 parents ce01f02 + 6e8a548 commit 3fc72cf

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

charts/cluster-autoscaler/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ name: cluster-autoscaler
1111
sources:
1212
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
1313
type: application
14-
version: 9.43.3
14+
version: 9.44.0

charts/cluster-autoscaler/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ extraVolumeMounts:
340340
readOnly: true
341341
```
342342

343+
### Custom arguments
344+
345+
You can use the `customArgs` value to give any argument to cluster autoscaler command.
346+
347+
Typical use case is to give an environment variable as an argument which will be interpolated at execution time.
348+
349+
This is helpful when you need to inject values from configmap or secret.
350+
343351
## Troubleshooting
344352

345353
The chart will succeed even if the container arguments are incorrect. A few minutes after starting `kubectl logs -l "app=aws-cluster-autoscaler" --tail=50` should loop through something like
@@ -421,6 +429,7 @@ vpa:
421429
| clusterAPIMode | string | `"incluster-incluster"` | Cluster API mode, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#connecting-cluster-autoscaler-to-cluster-api-management-and-workload-clusters Syntax: workloadClusterMode-ManagementClusterMode for `kubeconfig-kubeconfig`, `incluster-kubeconfig` and `single-kubeconfig` you always must mount the external kubeconfig using either `extraVolumeSecrets` or `extraMounts` and `extraVolumes` if you dont set `clusterAPIKubeconfigSecret`and thus use an in-cluster config or want to use a non capi generated kubeconfig you must do so for the workload kubeconfig as well |
422430
| clusterAPIWorkloadKubeconfigPath | string | `"/etc/kubernetes/value"` | Path to kubeconfig for connecting to Cluster API managed workloadcluster, only used if `clusterAPIMode=kubeconfig-kubeconfig or kubeconfig-incluster` |
423431
| containerSecurityContext | object | `{}` | [Security context for container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
432+
| customArgs | list | `[]` | Additional custom container arguments. Refer to https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca for the full list of cluster autoscaler parameters and their default values. List of arguments as strings. |
424433
| deployment.annotations | object | `{}` | Annotations to add to the Deployment object. |
425434
| 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`. |
426435
| envFromConfigMap | string | `""` | ConfigMap name to use as envFrom. |

charts/cluster-autoscaler/README.md.gotmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ extraVolumeMounts:
340340
readOnly: true
341341
```
342342

343+
### Custom arguments
344+
345+
You can use the `customArgs` value to give any argument to cluster autoscaler command.
346+
347+
Typical use case is to give an environment variable as an argument which will be interpolated at execution time.
348+
349+
This is helpful when you need to inject values from configmap or secret.
350+
343351
## Troubleshooting
344352

345353
The chart will succeed even if the container arguments are incorrect. A few minutes after starting `kubectl logs -l "app=aws-cluster-autoscaler" --tail=50` should loop through something like

charts/cluster-autoscaler/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ spec:
132132
- --{{ $key | mustRegexFind "^[^_]+" }}
133133
{{- end }}
134134
{{- end }}
135+
{{- range .Values.customArgs }}
136+
- {{ . }}
137+
{{- end }}
135138
env:
136139
- name: POD_NAMESPACE
137140
valueFrom:

charts/cluster-autoscaler/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ extraArgs:
196196
# balancing-ignore-label_1: first-label-to-ignore
197197
# balancing-ignore-label_2: second-label-to-ignore
198198

199+
# customArgs -- Additional custom container arguments.
200+
# Refer to https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca for the full list of cluster autoscaler
201+
# parameters and their default values.
202+
# List of arguments as strings.
203+
customArgs: []
204+
199205
# extraEnv -- Additional container environment variables.
200206
extraEnv: {}
201207

0 commit comments

Comments
 (0)