From 6f5810e9a47bdddfbd8dce894f892b49e5d468ee Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 3 Feb 2024 17:12:35 +0100 Subject: [PATCH 1/8] Add instanceType/region support in Helm chart for Hetzner cloud provider --- charts/cluster-autoscaler/README.md | 12 ++++++++++++ charts/cluster-autoscaler/templates/deployment.yaml | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 9bc2619ca048..59195516ac46 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -259,6 +259,18 @@ $ helm install my-release autoscaler/cluster-autoscaler \ Read [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md) for further information on the setup without helm. +### Hetzner Cloud + +The following parameters are required: + +- `cloudProvider=hetzner` +- `extraEnv.HCLOUD_TOKEN=...` +- `autoscalingGroups=...` + +In addition, each autoscaling group requires an additional `instanceType` and `region` key to be set. + +Read [cluster-autoscaler/cloudprovider/hetzner/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/hetzner/README.md) for further information on the setup without helm. + ## Uninstalling the Chart To uninstall `my-release`: diff --git a/charts/cluster-autoscaler/templates/deployment.yaml b/charts/cluster-autoscaler/templates/deployment.yaml index ccbe4353edc8..99c552a83caf 100644 --- a/charts/cluster-autoscaler/templates/deployment.yaml +++ b/charts/cluster-autoscaler/templates/deployment.yaml @@ -60,8 +60,12 @@ spec: {{- end }} {{- if .Values.autoscalingGroups }} {{- range .Values.autoscalingGroups }} + {{- if eq $.Values.cloudProvider "hetzner" }} + - --nodes={{ .minSize }}:{{ .maxSize }}:{{ .instanceType }}:{{ .region }}:{{ .name }} + {{- else }} - --nodes={{ .minSize }}:{{ .maxSize }}:{{ .name }} {{- end }} + {{- end }} {{- end }} {{- if eq .Values.cloudProvider "rancher" }} {{- if .Values.cloudConfigPath }} From 1410185143debedbc184bf02fa70dbc1286a751a Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Mon, 5 Feb 2024 10:15:28 +0100 Subject: [PATCH 2/8] Update charts/cluster-autoscaler/README.md --- charts/cluster-autoscaler/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 59195516ac46..9b4defe7a675 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -267,7 +267,7 @@ The following parameters are required: - `extraEnv.HCLOUD_TOKEN=...` - `autoscalingGroups=...` -In addition, each autoscaling group requires an additional `instanceType` and `region` key to be set. +Each autoscaling group requires an additional `instanceType` and `region` key to be set. Read [cluster-autoscaler/cloudprovider/hetzner/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/hetzner/README.md) for further information on the setup without helm. From 6b78974ce4f1702fda4fb0a7507baca6d2923cf1 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Tue, 6 Feb 2024 23:21:14 +0100 Subject: [PATCH 3/8] update README.md.gotmpl and added Helm docs for Hetzner Cloud --- charts/cluster-autoscaler/README.md | 4 +++- charts/cluster-autoscaler/README.md.gotmpl | 14 ++++++++++++++ charts/cluster-autoscaler/values.yaml | 9 +++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 03fb622e7fec..2084c561fb19 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -73,6 +73,8 @@ To create a valid configuration, follow instructions for your cloud provider: - [Azure](#azure) - [OpenStack Magnum](#openstack-magnum) - [Cluster API](#cluster-api) +- [Exoscale](#exoscale) +- [Hetzner Cloud](#hetzner-cloud) ### Templating the autoDiscovery.clusterName @@ -387,7 +389,7 @@ vpa: | autoDiscovery.labels | list | `[]` | Cluster-API labels to match https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#configuring-node-group-auto-discovery | | autoDiscovery.roles | list | `["worker"]` | Magnum node group roles to match. | | autoDiscovery.tags | list | `["k8s.io/cluster-autoscaler/enabled","k8s.io/cluster-autoscaler/{{ .Values.autoDiscovery.clusterName }}"]` | ASG tags to match, run through `tpl`. | -| autoscalingGroups | list | `[]` | For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
 - name: asg1
maxSize: 2
minSize: 1
| +| autoscalingGroups | list | `[]` | For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
 - name: asg1
maxSize: 2
minSize: 1
For Hetzner Cloud, the `instanceType` and `region` keys are also required.
 - name: mypool
maxSize: 2
minSize: 1 instanceType: CPX21 region: FSN1
| | autoscalingGroupsnamePrefix | list | `[]` | For GCE. At least one element is required if not using `autoDiscovery`. For example:
 - name: ig01
maxSize: 10
minSize: 0
| | awsAccessKeyID | string | `""` | AWS access key ID ([if AWS user keys used](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials)) | | awsRegion | string | `"us-east-1"` | AWS region (required if `cloudProvider=aws`) | diff --git a/charts/cluster-autoscaler/README.md.gotmpl b/charts/cluster-autoscaler/README.md.gotmpl index c91d0d572447..edbd2bd7f914 100644 --- a/charts/cluster-autoscaler/README.md.gotmpl +++ b/charts/cluster-autoscaler/README.md.gotmpl @@ -73,6 +73,8 @@ To create a valid configuration, follow instructions for your cloud provider: - [Azure](#azure) - [OpenStack Magnum](#openstack-magnum) - [Cluster API](#cluster-api) +- [Exoscale](#exoscale) +- [Hetzner Cloud](#hetzner-cloud) ### Templating the autoDiscovery.clusterName @@ -259,6 +261,18 @@ $ helm install my-release autoscaler/cluster-autoscaler \ Read [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md) for further information on the setup without helm. +### Hetzner Cloud + +The following parameters are required: + +- `cloudProvider=hetzner` +- `extraEnv.HCLOUD_TOKEN=...` +- `autoscalingGroups=...` + +Each autoscaling group requires an additional `instanceType` and `region` key to be set. + +Read [cluster-autoscaler/cloudprovider/hetzner/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/hetzner/README.md) for further information on the setup without helm. + ## Uninstalling the Chart To uninstall `my-release`: diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index 0affb0242d31..5503dda51b52 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -36,6 +36,15 @@ autoDiscovery: # maxSize: 2
# minSize: 1 # +# +# For Hetzner Cloud, the `instanceType` and `region` keys are also required. +#
+# - name: mypool
+# maxSize: 2
+# minSize: 1 +# instanceType: CPX21 +# region: FSN1 +#
autoscalingGroups: [] # - name: asg1 # maxSize: 2 From a8e00f454c665e38b782936fadc61d598fb90440 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Tue, 6 Feb 2024 23:24:44 +0100 Subject: [PATCH 4/8] bump chart version --- charts/cluster-autoscaler/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index 80b88c6df678..e58e4b197ba3 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.35.0 +version: 9.36.0 From 14f4c27a2f672db33c62d35cf82a7d4ce91a0a84 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Tue, 6 Feb 2024 23:32:52 +0100 Subject: [PATCH 5/8] use older helm-docs version and remove empty line in values comment --- charts/cluster-autoscaler/README.md | 2 +- charts/cluster-autoscaler/values.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 2084c561fb19..0d87a7351c46 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -389,7 +389,7 @@ vpa: | autoDiscovery.labels | list | `[]` | Cluster-API labels to match https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#configuring-node-group-auto-discovery | | autoDiscovery.roles | list | `["worker"]` | Magnum node group roles to match. | | autoDiscovery.tags | list | `["k8s.io/cluster-autoscaler/enabled","k8s.io/cluster-autoscaler/{{ .Values.autoDiscovery.clusterName }}"]` | ASG tags to match, run through `tpl`. | -| autoscalingGroups | list | `[]` | For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
 - name: asg1
maxSize: 2
minSize: 1
For Hetzner Cloud, the `instanceType` and `region` keys are also required.
 - name: mypool
maxSize: 2
minSize: 1 instanceType: CPX21 region: FSN1
| +| autoscalingGroups | list | `[]` | For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
 - name: asg1
maxSize: 2
minSize: 1
For Hetzner Cloud, the `instanceType` and `region` keys are also required.
 - name: mypool
maxSize: 2
minSize: 1 instanceType: CPX21 region: FSN1
| | autoscalingGroupsnamePrefix | list | `[]` | For GCE. At least one element is required if not using `autoDiscovery`. For example:
 - name: ig01
maxSize: 10
minSize: 0
| | awsAccessKeyID | string | `""` | AWS access key ID ([if AWS user keys used](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials)) | | awsRegion | string | `"us-east-1"` | AWS region (required if `cloudProvider=aws`) | diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index 5503dda51b52..b838afbf1962 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -36,7 +36,6 @@ autoDiscovery: # maxSize: 2
# minSize: 1 # -# # For Hetzner Cloud, the `instanceType` and `region` keys are also required. #
 # - name: mypool
From 9d73b590469409f63c2eb7b858f01e87d75c7f41 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Tue, 6 Feb 2024 23:34:18 +0100 Subject: [PATCH 6/8] add missing line breaks --- charts/cluster-autoscaler/README.md | 2 +- charts/cluster-autoscaler/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 0d87a7351c46..b6171fd0b76d 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -389,7 +389,7 @@ vpa: | autoDiscovery.labels | list | `[]` | Cluster-API labels to match https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#configuring-node-group-auto-discovery | | autoDiscovery.roles | list | `["worker"]` | Magnum node group roles to match. | | autoDiscovery.tags | list | `["k8s.io/cluster-autoscaler/enabled","k8s.io/cluster-autoscaler/{{ .Values.autoDiscovery.clusterName }}"]` | ASG tags to match, run through `tpl`. | -| autoscalingGroups | list | `[]` | For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
 - name: asg1
maxSize: 2
minSize: 1
For Hetzner Cloud, the `instanceType` and `region` keys are also required.
 - name: mypool
maxSize: 2
minSize: 1 instanceType: CPX21 region: FSN1
| +| autoscalingGroups | list | `[]` | For AWS, Azure AKS or Magnum. At least one element is required if not using `autoDiscovery`. For example:
 - name: asg1
maxSize: 2
minSize: 1
For Hetzner Cloud, the `instanceType` and `region` keys are also required.
 - name: mypool
maxSize: 2
minSize: 1
instanceType: CPX21
region: FSN1
| | autoscalingGroupsnamePrefix | list | `[]` | For GCE. At least one element is required if not using `autoDiscovery`. For example:
 - name: ig01
maxSize: 10
minSize: 0
| | awsAccessKeyID | string | `""` | AWS access key ID ([if AWS user keys used](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials)) | | awsRegion | string | `"us-east-1"` | AWS region (required if `cloudProvider=aws`) | diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index b838afbf1962..a845a142d2d2 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -40,8 +40,8 @@ autoDiscovery: #
 # - name: mypool
# maxSize: 2
-# minSize: 1 -# instanceType: CPX21 +# minSize: 1
+# instanceType: CPX21
# region: FSN1 #
autoscalingGroups: [] From b2e3b7aeb5bfc9e8b72895e482b0a8c3b74b682f Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Wed, 7 Feb 2024 11:32:17 +0100 Subject: [PATCH 7/8] Update charts/cluster-autoscaler/Chart.yaml Co-authored-by: Shubham --- charts/cluster-autoscaler/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index e58e4b197ba3..bf634c0323a9 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.36.0 +version: 9.35.1 From c49eefeee935d4b1ee1ee44b66b721e4bfda01a2 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Thu, 8 Feb 2024 12:32:19 +0100 Subject: [PATCH 8/8] Update Chart.yaml --- charts/cluster-autoscaler/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index bf634c0323a9..e58e4b197ba3 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.35.1 +version: 9.36.0