From b7b45f739d04df685672233b22872f0c0a88c028 Mon Sep 17 00:00:00 2001 From: Thomas Stadler Date: Sat, 4 Nov 2023 10:53:24 +0100 Subject: [PATCH 1/3] feat(helm): add support for exoscale provider Signed-off-by: Thomas Stadler --- charts/cluster-autoscaler/README.md | 26 +++++++++++++++++++ .../templates/deployment.yaml | 16 ++++++++++++ 2 files changed, 42 insertions(+) diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index dd6171b780e7..9c860daee76f 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -230,6 +230,32 @@ Additional config parameters available, see the `values.yaml` for more details - `clusterAPIWorkloadKubeconfigPath` - `clusterAPICloudConfigPath` +### Exoscale + +The following parameters are required: + +- `cloudProvider=exoscale` +- `autoDiscovery.clusterName=` + +Create an Exoscale API key with appropriate permissions as described in [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md). +A secret of name `-exoscale-cluster-autoscaler` needs to be created, containing the api key and secret, as well as the zone. + +```console +$ kubectl create secret generic my-release-exoscale-cluster-autoscaler \ + --from-literal=api-key="EXOxxxxxxxxxxxxxxxxxxxxxxxx" \ + --from-literal=api-secret="xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --from-literal=api-zone="ch-gva-2" +``` + +After creating the secret, the chart may be installed: + +```console +$ helm install my-release autoscaler/cluster-autoscaler \ + --set cloudProvider=exoscale \ + --set autoDiscovery.clusterName= +``` + +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. + ## Uninstalling the Chart To uninstall `my-release`: diff --git a/charts/cluster-autoscaler/templates/deployment.yaml b/charts/cluster-autoscaler/templates/deployment.yaml index 2b5bba272b01..dc93f220b7d8 100644 --- a/charts/cluster-autoscaler/templates/deployment.yaml +++ b/charts/cluster-autoscaler/templates/deployment.yaml @@ -190,6 +190,22 @@ spec: key: NodeResourceGroup name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} {{- end }} + {{- else if eq .Values.cloudProvider "exoscale" }} + - name: EXOSCALE_API_KEY + valueFrom: + secretKeyRef: + key: api-key + name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + - name: EXOSCALE_API_SECRET + valueFrom: + secretKeyRef: + key: api-secret + name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + - name: EXOSCALE_ZONE + valueFrom: + secretKeyRef: + key: api-zone + name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} {{- end }} {{- range $key, $value := .Values.extraEnv }} - name: {{ $key }} From 185cae3d36ccf880367913941bfb97dea6eaedd1 Mon Sep 17 00:00:00 2001 From: Thomas Stadler Date: Wed, 8 Nov 2023 12:52:46 +0100 Subject: [PATCH 2/3] chore(helm): bump version of cluster-autoscaler Signed-off-by: Thomas Stadler --- 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 c5219cf940d0..7ca44ac5d2f9 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.29.4 +version: 9.29.5 From c873215aa25e72cba6bed8a9d83fbdc72d2e934c Mon Sep 17 00:00:00 2001 From: Thomas Stadler Date: Wed, 8 Nov 2023 13:43:52 +0100 Subject: [PATCH 3/3] chore(helm): docs, update README template Signed-off-by: Thomas Stadler --- charts/cluster-autoscaler/README.md.gotmpl | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/charts/cluster-autoscaler/README.md.gotmpl b/charts/cluster-autoscaler/README.md.gotmpl index 611ad6bb121f..e85c6008150c 100644 --- a/charts/cluster-autoscaler/README.md.gotmpl +++ b/charts/cluster-autoscaler/README.md.gotmpl @@ -230,6 +230,32 @@ Additional config parameters available, see the `values.yaml` for more details - `clusterAPIWorkloadKubeconfigPath` - `clusterAPICloudConfigPath` +### Exoscale + +The following parameters are required: + +- `cloudProvider=exoscale` +- `autoDiscovery.clusterName=` + +Create an Exoscale API key with appropriate permissions as described in [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md). +A secret of name `-exoscale-cluster-autoscaler` needs to be created, containing the api key and secret, as well as the zone. + +```console +$ kubectl create secret generic my-release-exoscale-cluster-autoscaler \ + --from-literal=api-key="EXOxxxxxxxxxxxxxxxxxxxxxxxx" \ + --from-literal=api-secret="xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --from-literal=api-zone="ch-gva-2" +``` + +After creating the secret, the chart may be installed: + +```console +$ helm install my-release autoscaler/cluster-autoscaler \ + --set cloudProvider=exoscale \ + --set autoDiscovery.clusterName= +``` + +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. + ## Uninstalling the Chart To uninstall `my-release`: