Skip to content

Commit 03b8aeb

Browse files
authored
Merge pull request #6656 from rbnis/feature/chart-add-civo-provider
feat(chart): Add support for civo provider
2 parents 9559204 + c246345 commit 03b8aeb

File tree

6 files changed

+90
-6
lines changed

6 files changed

+90
-6
lines changed

charts/cluster-autoscaler/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ name: cluster-autoscaler
1111
sources:
1212
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
1313
type: application
14-
version: 9.45.1
14+
version: 9.46.0

charts/cluster-autoscaler/README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ To create a valid configuration, follow instructions for your cloud provider:
7575
- [Cluster API](#cluster-api)
7676
- [Exoscale](#exoscale)
7777
- [Hetzner Cloud](#hetzner-cloud)
78+
- [Civo](#civo)
7879

7980
### Templating the autoDiscovery.clusterName
8081

@@ -282,6 +283,23 @@ Each autoscaling group requires an additional `instanceType` and `region` key to
282283

283284
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.
284285

286+
### Civo
287+
288+
The following parameters are required:
289+
290+
- `cloudProvider=civo`
291+
- `autoscalingGroups=...`
292+
293+
When installing the helm chart to the namespace `kube-system`, you can set `secretKeyRefNameOverride` to `civo-api-access`.
294+
Otherwise specify the following parameters:
295+
296+
- `civoApiUrl=https://api.civo.com`
297+
- `civoApiKey=...`
298+
- `civoClusterID=...`
299+
- `civoRegion=...`
300+
301+
Read [cluster-autoscaler/cloudprovider/civo/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/civo/README.md) for further information on the setup without helm.
302+
285303
## Uninstalling the Chart
286304

287305
To uninstall `my-release`:
@@ -421,8 +439,12 @@ vpa:
421439
| azureUseManagedIdentityExtension | bool | `false` | Whether to use Azure's managed identity extension for credentials. If using MSI, ensure subscription ID, resource group, and azure AKS cluster name are set. You can only use one authentication method at a time, either azureUseWorkloadIdentityExtension or azureUseManagedIdentityExtension should be set. |
422440
| azureUseWorkloadIdentityExtension | bool | `false` | Whether to use Azure's workload identity extension for credentials. See the project here: https://github.com/Azure/azure-workload-identity for more details. You can only use one authentication method at a time, either azureUseWorkloadIdentityExtension or azureUseManagedIdentityExtension should be set. |
423441
| azureVMType | string | `"vmss"` | Azure VM type. |
442+
| civoApiKey | string | `""` | API key for the Civo API. Required if `cloudProvider=civo` |
443+
| civoApiUrl | string | `"https://api.civo.com"` | URL for the Civo API. Required if `cloudProvider=civo` |
444+
| civoClusterID | string | `""` | Cluster ID for the Civo cluster. Required if `cloudProvider=civo` |
445+
| civoRegion | string | `""` | Region for the Civo cluster. Required if `cloudProvider=civo` |
424446
| cloudConfigPath | string | `""` | Configuration file for cloud provider. |
425-
| cloudProvider | string | `"aws"` | The cloud provider where the autoscaler runs. Currently only `gce`, `aws`, `azure`, `magnum` and `clusterapi` are supported. `aws` supported for AWS. `gce` for GCE. `azure` for Azure AKS. `magnum` for OpenStack Magnum, `clusterapi` for Cluster API. |
447+
| cloudProvider | string | `"aws"` | The cloud provider where the autoscaler runs. Currently only `gce`, `aws`, `azure`, `magnum`, `clusterapi` and `civo` are supported. `aws` supported for AWS. `gce` for GCE. `azure` for Azure AKS. `magnum` for OpenStack Magnum, `clusterapi` for Cluster API. `civo` for Civo Cloud. |
426448
| clusterAPICloudConfigPath | string | `"/etc/kubernetes/mgmt-kubeconfig"` | Path to kubeconfig for connecting to Cluster API Management Cluster, only used if `clusterAPIMode=kubeconfig-kubeconfig or incluster-kubeconfig` |
427449
| clusterAPIConfigMapsNamespace | string | `""` | Namespace on the workload cluster to store Leader election and status configmaps |
428450
| clusterAPIKubeconfigSecret | string | `""` | Secret containing kubeconfig for connecting to Cluster API managed workloadcluster Required if `cloudProvider=clusterapi` and `clusterAPIMode=kubeconfig-kubeconfig,kubeconfig-incluster or incluster-kubeconfig` |
@@ -476,7 +498,7 @@ vpa:
476498
| replicaCount | int | `1` | Desired number of pods |
477499
| resources | object | `{}` | Pod resource requests and limits. |
478500
| revisionHistoryLimit | int | `10` | The number of revisions to keep. |
479-
| secretKeyRefNameOverride | string | `""` | Overrides the name of the Secret to use when loading the secretKeyRef for AWS and Azure env variables |
501+
| secretKeyRefNameOverride | string | `""` | Overrides the name of the Secret to use when loading the secretKeyRef for AWS, Azure and Civo env variables |
480502
| securityContext | object | `{}` | [Security context for pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
481503
| service.annotations | object | `{}` | Annotations to add to service |
482504
| service.clusterIP | string | `""` | IP address to assign to service |

charts/cluster-autoscaler/README.md.gotmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ To create a valid configuration, follow instructions for your cloud provider:
7575
- [Cluster API](#cluster-api)
7676
- [Exoscale](#exoscale)
7777
- [Hetzner Cloud](#hetzner-cloud)
78+
- [Civo](#civo)
7879

7980
### Templating the autoDiscovery.clusterName
8081

@@ -282,6 +283,23 @@ Each autoscaling group requires an additional `instanceType` and `region` key to
282283

283284
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.
284285

286+
### Civo
287+
288+
The following parameters are required:
289+
290+
- `cloudProvider=civo`
291+
- `autoscalingGroups=...`
292+
293+
When installing the helm chart to the namespace `kube-system`, you can set `secretKeyRefNameOverride` to `civo-api-access`.
294+
Otherwise specify the following parameters:
295+
296+
- `civoApiUrl=https://api.civo.com`
297+
- `civoApiKey=...`
298+
- `civoClusterID=...`
299+
- `civoRegion=...`
300+
301+
Read [cluster-autoscaler/cloudprovider/civo/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/civo/README.md) for further information on the setup without helm.
302+
285303
## Uninstalling the Chart
286304

287305
To uninstall `my-release`:

charts/cluster-autoscaler/templates/deployment.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,27 @@ spec:
221221
{{- else if eq .Values.cloudProvider "kwok" }}
222222
- name: KWOK_PROVIDER_CONFIGMAP
223223
value: "{{.Values.kwokConfigMapName | default "kwok-provider-config"}}"
224+
{{- else if eq .Values.cloudProvider "civo" }}
225+
- name: CIVO_API_URL
226+
valueFrom:
227+
secretKeyRef:
228+
key: api-url
229+
name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }}
230+
- name: CIVO_API_KEY
231+
valueFrom:
232+
secretKeyRef:
233+
key: api-key
234+
name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }}
235+
- name: CIVO_CLUSTER_ID
236+
valueFrom:
237+
secretKeyRef:
238+
key: cluster-id
239+
name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }}
240+
- name: CIVO_REGION
241+
valueFrom:
242+
secretKeyRef:
243+
key: region
244+
name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }}
224245
{{- end }}
225246
{{- range $key, $value := .Values.extraEnv }}
226247
- name: {{ $key }}

charts/cluster-autoscaler/templates/secret.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
{{- $isAzure := eq .Values.cloudProvider "azure" }}
33
{{- $isAws := eq .Values.cloudProvider "aws" }}
44
{{- $awsCredentialsProvided := and .Values.awsAccessKeyID .Values.awsSecretAccessKey }}
5+
{{- $isCivo := eq .Values.cloudProvider "civo" }}
56

6-
{{- if or $isAzure (and $isAws $awsCredentialsProvided) }}
7+
{{- if or $isAzure (and $isAws $awsCredentialsProvided) $isCivo }}
78
apiVersion: v1
89
kind: Secret
910
metadata:
@@ -20,6 +21,11 @@ data:
2021
{{- else if $isAws }}
2122
AwsAccessKeyId: "{{ .Values.awsAccessKeyID | b64enc }}"
2223
AwsSecretAccessKey: "{{ .Values.awsSecretAccessKey | b64enc }}"
24+
{{- else if $isCivo }}
25+
api-url: "{{ .Values.civoApiUrl | b64enc }}"
26+
api-key: "{{ .Values.civoApiKey | b64enc }}"
27+
cluster-id: "{{ .Values.civoClusterID | b64enc }}"
28+
region: "{{ .Values.civoRegion | b64enc }}"
2329
{{- end }}
2430
{{- end }}
2531
{{- end }}

charts/cluster-autoscaler/values.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,30 @@ azureVMType: "vmss"
110110
# azureEnableForceDelete -- Whether to force delete VMs or VMSS instances when scaling down.
111111
azureEnableForceDelete: false
112112

113+
# civoApiUrl -- URL for the Civo API.
114+
# Required if `cloudProvider=civo`
115+
civoApiUrl: "https://api.civo.com"
116+
117+
# civoApiKey -- API key for the Civo API.
118+
# Required if `cloudProvider=civo`
119+
civoApiKey: ""
120+
121+
# civoClusterID -- Cluster ID for the Civo cluster.
122+
# Required if `cloudProvider=civo`
123+
civoClusterID: ""
124+
125+
# civoRegion -- Region for the Civo cluster.
126+
# Required if `cloudProvider=civo`
127+
civoRegion: ""
128+
113129
# cloudConfigPath -- Configuration file for cloud provider.
114130
cloudConfigPath: ""
115131

116132
# cloudProvider -- The cloud provider where the autoscaler runs.
117-
# Currently only `gce`, `aws`, `azure`, `magnum` and `clusterapi` are supported.
133+
# Currently only `gce`, `aws`, `azure`, `magnum`, `clusterapi` and `civo` are supported.
118134
# `aws` supported for AWS. `gce` for GCE. `azure` for Azure AKS.
119135
# `magnum` for OpenStack Magnum, `clusterapi` for Cluster API.
136+
# `civo` for Civo Cloud.
120137
cloudProvider: aws
121138

122139
# clusterAPICloudConfigPath -- Path to kubeconfig for connecting to Cluster API Management Cluster, only used if `clusterAPIMode=kubeconfig-kubeconfig or incluster-kubeconfig`
@@ -446,5 +463,5 @@ vpa:
446463
# vpa.containerPolicy -- [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled.
447464
containerPolicy: {}
448465

449-
# secretKeyRefNameOverride -- Overrides the name of the Secret to use when loading the secretKeyRef for AWS and Azure env variables
466+
# secretKeyRefNameOverride -- Overrides the name of the Secret to use when loading the secretKeyRef for AWS, Azure and Civo env variables
450467
secretKeyRefNameOverride: ""

0 commit comments

Comments
 (0)