Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Update cluster-autoscaler to version v1.1.0 #1137

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/charts/components/cluster-autoscaler/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.0.2
version: 1.1.0
162 changes: 94 additions & 68 deletions assets/charts/components/cluster-autoscaler/README.md

Large diffs are not rendered by default.

31 changes: 27 additions & 4 deletions assets/charts/components/cluster-autoscaler/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ You must provide some minimal configuration, either to specify instance groups o

Either:

- Set `autoDiscovery.clusterName` and tag your autoscaling groups appropriately (`--cloud-provider=aws` only) **or**
- Set at least one ASG as an element in the `autoscalingGroups` array with its three values: `name`, `minSize` and `maxSize`.
- Set `autoDiscovery.clusterName` and provide additional autodiscovery options if necessary **or**
- Set static node group configurations for one or more node groups (using `autoscalingGroups` or `autoscalingGroupsnamePrefix`).

To install the chart with the release name `my-release`:
To create a valid configuration, follow instructions for your cloud provider:

* [AWS](#aws---using-auto-discovery-of-tagged-instance-groups)
* [GCE](#gce)
* [Azure AKS](#azure-aks)
* [OpenStack Magnum](#openstack-magnum)

### AWS - Using auto-discovery of tagged instance groups

Expand Down Expand Up @@ -163,6 +168,24 @@ The following parameters are required:
- `azureVMType: "AKS"`
- `azureNodeResourceGroup: "your-aks-cluster-node-resource-group"`

### OpenStack Magnum

`cloudProvider: magnum` must be set, and then one of

- `magnumClusterName=<cluster name or ID>` and `autoscalingGroups` with the names of node groups and min/max node counts
- or `autoDiscovery.clusterName=<cluster name or ID>` with one or more `autoDiscovery.roles`.

Additionally, `cloudConfigPath: "/etc/kubernetes/cloud-config"` must be set as this should be the location
of the cloud-config file on the host.

Example values files can be found [here](../../cluster-autoscaler/cloudprovider/magnum/examples).

Install the chart with

```
$ helm install my-release autoscaler/cluster-autoscaler-chart -f myvalues.yaml
```

## Uninstalling the Chart

To uninstall `my-release`:
Expand Down Expand Up @@ -252,7 +275,7 @@ For Kubernetes clusters that use Amazon EKS, the service account can be configur

In order to accomplish this, you will first need to create a new IAM role with the above mentions policies. Take care in [configuring the trust relationship](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html#iam-role-configuration) to restrict access just to the service account used by cluster autoscaler.

Once you have the IAM role configured, you would then need to `--set rbac.serviceAccountAnnotations."eks\.amazonaws\.com/role-arn"=arn:aws:iam::123456789012:role/MyRoleName` when installing.
Once you have the IAM role configured, you would then need to `--set rbac.serviceAccount.annotations."eks\.amazonaws\.com/role-arn"=arn:aws:iam::123456789012:role/MyRoleName` when installing.

## Troubleshooting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,22 @@ spec:
- --node-group-auto-discovery=mig:namePrefix={{ .name }},min={{ .minSize }},max={{ .maxSize }}
{{- end }}
{{- end }}
{{- else if eq .Values.cloudProvider "magnum" }}
{{- if .Values.autoDiscovery.clusterName }}
- --cluster-name={{ .Values.autoDiscovery.clusterName }}
- --node-group-auto-discovery=magnum:role={{ tpl (join "," .Values.autoDiscovery.roles) . }}
{{- else }}
- --cluster-name={{ .Values.magnumClusterName }}
{{- end }}
{{- end }}
{{- if eq .Values.cloudProvider "gce" }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
- --cloud-config={{ .Values.cloudConfigPath }}
{{- else if eq .Values.cloudProvider "packet" }}
- --cloud-config={{ .Values.cloudConfigPath }}/cloud-config
{{- end }}
{{- range $key, $value := .Values.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}

env:
{{- if and (eq .Values.cloudProvider "aws") (ne .Values.awsRegion "") }}
- name: AWS_REGION
Expand Down Expand Up @@ -188,11 +194,16 @@ spec:
securityContext:
{{ toYaml .Values.containerSecurityContext | nindent 12 | trim }}
{{- end }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "packet") }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") (eq .Values.cloudProvider "packet") }}
volumeMounts:
- name: cloudconfig
mountPath: {{ .Values.cloudConfigPath }}
readOnly: true
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
- name: ca-bundle
mountPath: {{ .Values.magnumCABundlePath }}
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.affinity }}
affinity:
Expand All @@ -210,14 +221,19 @@ spec:
{{ toYaml .Values.securityContext | nindent 8 | trim }}
{{- end }}
volumes:
{{- if eq .Values.cloudProvider "gce" }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
- name: cloudconfig
hostPath:
path: {{ .Values.cloudConfigPath }}
{{- else if eq .Values.cloudProvider "packet" }}
- name: cloudconfig
secret:
secretName: {{ template "cluster-autoscaler.fullname" . }}
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
- name: ca-bundle
hostPath:
path: {{ .Values.magnumCABundlePath }}
{{- end }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
{{- end }}
labels:
{{ include "cluster-autoscaler.labels" . | indent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
name: {{ template "cluster-autoscaler.fullname" . }}
spec:
{{- if .Values.service.clusterIP }}
Expand Down
27 changes: 22 additions & 5 deletions assets/charts/components/cluster-autoscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@
affinity: {}

autoDiscovery:
# Only cloudProvider `aws` and `gce` are supported by auto-discovery at this time
# cloudProviders `aws`, `gce` and `magnum` are supported by auto-discovery at this time
# AWS: Set tags as described in https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#auto-discovery-setup
# autoDiscovery.clusterName -- Enable autodiscovery for name in ASG tag (only `cloudProvider=aws`). Must be set for `cloudProvider=gce`, but no MIG tagging required.

# autoDiscovery.clusterName -- Enable autodiscovery for `cloudProvider=aws`, for groups matching `autoDiscovery.tags`.
# Enable autodiscovery for `cloudProvider=gce`, but no MIG tagging required.
# Enable autodiscovery for `cloudProvider=magnum`, for groups matching `autoDiscovery.roles`.
clusterName: # cluster.local

# autoDiscovery.tags -- ASG tags to match, run through `tpl`.
tags:
- k8s.io/cluster-autoscaler/enabled
- k8s.io/cluster-autoscaler/{{ .Values.autoDiscovery.clusterName }}
# - kubernetes.io/cluster/{{ .Values.autoDiscovery.clusterName }}

# autoscalingGroups -- For AWS. At least one element is required if not using `autoDiscovery`. For example:
# autoDiscovery.roles -- Magnum node group roles to match.
roles:
- worker

# autoscalingGroups -- For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
# <pre>
# - name: asg1<br />
# maxSize: 2<br />
Expand Down Expand Up @@ -93,12 +101,20 @@ packetFacility: ""
packetOSChannel: ""
packetNodeType: ""

# magnumClusterName -- Cluster name or ID in Magnum.
# Required if `cloudProvider=magnum` and not setting `autoDiscovery.clusterName`.
magnumClusterName: ""

# magnumCABundlePath -- Path to the host's CA bundle, from `ca-file` in the cloud-config file.
magnumCABundlePath: "/etc/kubernetes/ca-bundle.crt"

# cloudConfigPath -- Configuration file for cloud provider.
cloudConfigPath: /etc/gce.conf

# cloudProvider -- The cloud provider where the autoscaler runs.
# Currently only `gce`, `aws`, `azure`, `spotinst` & `packet` are supported
# Currently only `gce`, `aws`, `azure`, `spotinst`, `packet` and `magnum` are supported.
# `aws` supported for AWS. `gce` for GCE. `azure` for Azure AKS.
# `magnum` for OpenStack Magnum.
cloudProvider: aws

# containerSecurityContext -- [Security context for container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
Expand Down Expand Up @@ -138,7 +154,6 @@ extraArgs:
# scale-down-delay-after-delete: 0s
# scale-down-delay-after-failure: 3m
# scale-down-unneeded-time: 10m
# skip-nodes-with-local-storage: false
# skip-nodes-with-system-pods: true

# extraEnv -- Additional container environment variables.
Expand Down Expand Up @@ -220,6 +235,8 @@ securityContext: {}
service:
# service.annotations -- Annotations to add to service
annotations: {}
# service.labels -- Labels to add to service
labels: {}
# service.externalIPs -- List of IP addresses at which the service is available. Ref: https://kubernetes.io/docs/user-guide/services/#external-ips.
externalIPs: []

Expand Down
22 changes: 11 additions & 11 deletions pkg/assets/generated_assets.go

Large diffs are not rendered by default.