Skip to content

Commit

Permalink
Merge pull request #5105 from khizunov/allow-aws-cloud-config
Browse files Browse the repository at this point in the history
helm chart - Allow cloud config path for AWS provider
  • Loading branch information
k8s-ci-robot authored Aug 25, 2022
2 parents 832154b + b0ffcce commit b718e74
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/cluster-autoscaler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions charts/cluster-autoscaler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
36 changes: 36 additions & 0 deletions cluster-autoscaler/cloudprovider/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cloud-config
data:
cloud.conf: |
[Global]
Zone=<region><az>
[ServiceOverride "ec2"]
Service=ec2
Region=<region>
URL=<endpoint_url>
SigningRegion=<region>
[ServiceOverride "autoscaling"]
Service=autoscaling
Region=<region>
URL=<endpoint_url>
SigningRegion=<region>
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b718e74

Please sign in to comment.