diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 2c6a181633bd..3d35fa3d79dd 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.19.4 +version: 9.20.0 diff --git a/charts/cluster-autoscaler/templates/deployment.yaml b/charts/cluster-autoscaler/templates/deployment.yaml index 7f5f7feb477f..2801a8ce976c 100644 --- a/charts/cluster-autoscaler/templates/deployment.yaml +++ b/charts/cluster-autoscaler/templates/deployment.yaml @@ -63,6 +63,9 @@ spec: {{- if .Values.autoDiscovery.clusterName }} - --node-group-auto-discovery=asg:tag={{ tpl (join "," .Values.autoDiscovery.tags) . }} {{- end }} + {{- if .Values.cloudConfigPath }} + - --cloud-config={{ .Values.cloudConfigPath }} + {{- end }} {{- else if eq .Values.cloudProvider "gce" }} {{- if .Values.autoscalingGroupsnamePrefix }} {{- range .Values.autoscalingGroupsnamePrefix }} diff --git a/cluster-autoscaler/cloudprovider/aws/README.md b/cluster-autoscaler/cloudprovider/aws/README.md index 3ff3bd7df101..e56f4cadaad2 100644 --- a/cluster-autoscaler/cloudprovider/aws/README.md +++ b/cluster-autoscaler/cloudprovider/aws/README.md @@ -420,6 +420,42 @@ If you want to update the vendored AWS SDK to a newer version, please make sure 2. Update the import statements within the newly-copied AWS SDK to reference the new paths (e.g., `github.com/aws/aws-sdk-go/aws/awsutil` -> `k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil`). 3. Update the version number above to indicate the new vendored version. +## Using cloud config with helm + +If you want to use custom AWS cloud config e.g. endpoint urls + +1. Create ConfigMap with cloud config file definition (see [example](examples/configmap-cloudconfig-example.yaml)): + ```shell + kubectl apply -f examples/configmap-cloudconfig-example.yaml + ``` +2. Add the following in your `values.yaml`: + ```yaml + cloudConfigPath: config/cloud.conf + + extraVolumes: + - name: cloud-config + configMap: + name: cloud-config + + extraVolumeMounts: + - name: cloud-config + mountPath: config + ``` +3. Install (or upgrade) helm chart with updated values (see [example](examples/values-cloudconfig-example.yaml)) + +Please note: it is also possible to mount the cloud config file from host: +```yaml + extraVolumes: + - name: cloud-config + hostPath: + path: /path/to/file/on/host + + extraVolumeMounts: + - name: cloud-config + mountPath: config/cloud.conf + readOnly: true +``` + ## Common Notes and Gotchas: - The `/etc/ssl/certs/ca-bundle.crt` should exist by default on ec2 instance in diff --git a/cluster-autoscaler/cloudprovider/aws/examples/configmap-cloudconfig-example.yaml b/cluster-autoscaler/cloudprovider/aws/examples/configmap-cloudconfig-example.yaml new file mode 100644 index 000000000000..e4871c97399b --- /dev/null +++ b/cluster-autoscaler/cloudprovider/aws/examples/configmap-cloudconfig-example.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: cloud-config +data: + cloud.conf: | + [Global] + Zone= + [ServiceOverride "ec2"] + Service=ec2 + Region= + URL= + SigningRegion= + [ServiceOverride "autoscaling"] + Service=autoscaling + Region= + URL= + SigningRegion= diff --git a/cluster-autoscaler/cloudprovider/aws/examples/values-cloudconfig-example.yaml b/cluster-autoscaler/cloudprovider/aws/examples/values-cloudconfig-example.yaml new file mode 100644 index 000000000000..08586e09cc04 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/aws/examples/values-cloudconfig-example.yaml @@ -0,0 +1,22 @@ +cloudProvider: aws + +autoscalingGroups: + - name: aws-asg-name + minSize: 1 + maxSize: 2 + +awsRegion: eu-west-1 +awsAccessKeyID: "******" +awsSecretAccessKey: "******" + +cloudConfigPath: config/cloud.conf + +extraVolumes: + - name: cloud-config + configMap: + name: cloud-config + +extraVolumeMounts: + - name: cloud-config + mountPath: config +