Skip to content

Commit ad6d6c9

Browse files
authored
Merge branch 'kubernetes:master' into prefixed_extended_resources
2 parents dd6f11b + cf115af commit ad6d6c9

File tree

255 files changed

+11749
-4488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+11749
-4488
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ env:
99

1010
permissions:
1111
contents: read
12+
checks: write
1213

1314
jobs:
1415
test-and-verify:
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: Set up Go
18-
uses: actions/setup-go@v2
19+
uses: actions/setup-go@v5.1.0
1920
with:
2021
go-version: '1.22.2'
2122

22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4.2.2
2324
with:
2425
path: ${{ env.GOPATH }}/src/k8s.io/autoscaler
2526

@@ -38,6 +39,12 @@ jobs:
3839
env:
3940
GO111MODULE: auto
4041

42+
- name: golangci-lint - vertical-pod-autoscaler
43+
uses: golangci/golangci-lint-action@v6
44+
with:
45+
args: --timeout=30m
46+
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler/vertical-pod-autoscaler
47+
4148
- name: Test
4249
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler
4350
run: hack/for-go-proj.sh test

.github/workflows/pr.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4.2.2
1515
- id: filter
1616
uses: dorny/[email protected]
1717
with:
@@ -28,11 +28,11 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v4.2.2
3232
- name: Fetch history
3333
run: git fetch --prune --unshallow
3434
- name: Set up chart-testing
35-
uses: helm/chart-testing-action@v2.0.1
35+
uses: helm/chart-testing-action@v2.6.1
3636
- name: Run chart-testing (lint)
3737
run: ct lint
3838
# Only build a kind cluster if there are chart changes to test.
@@ -45,7 +45,7 @@ jobs:
4545
fi
4646
- if: steps.list-changed.outputs.changed == 'true'
4747
name: Create kind cluster
48-
uses: helm/kind-action@v1.1.0
48+
uses: helm/kind-action@v1.10.0
4949
- if: steps.list-changed.outputs.changed == 'true'
5050
name: Run chart-testing (install)
5151
run: ct install
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v2
60+
uses: actions/checkout@v4.2.2
6161
- name: Run helm-docs
6262
uses: docker://jnorwood/helm-docs:v1.3.0
6363
- name: Check for changes

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v4.2.2
1212
with:
1313
fetch-depth: 0
1414

@@ -18,15 +18,15 @@ jobs:
1818
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
1919
2020
- name: Install Helm
21-
uses: azure/setup-helm@v1
21+
uses: azure/setup-helm@v4.2.0
2222
with:
2323
version: v3.4.0
2424

2525
- env:
2626
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727
CR_RELEASE_NAME_TEMPLATE: "cluster-autoscaler-chart-{{ .Version }}"
2828
name: Run chart-releaser
29-
uses: helm/chart-releaser-action@v1.1.0
29+
uses: helm/chart-releaser-action@v1.6.0
3030
name: Release Charts
3131
on:
3232
push:

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ repos:
1313
files: (README\.md\.gotmpl|(Chart|requirements|values)\.yaml)$
1414
repo: https://github.com/norwoodj/helm-docs
1515
rev: v1.3.0
16+
- hooks:
17+
- id : update-flags
18+
name: Update Cluster-Autoscaler Flags Table
19+
entry: bash cluster-autoscaler/hack/update-faq-flags.sh
20+
language: system
21+
files: cluster-autoscaler/main\.go
22+
repo: local

charts/cluster-autoscaler/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
appVersion: 1.31.0
2+
appVersion: 1.32.0
33
description: Scales Kubernetes worker nodes within autoscaling groups.
44
engine: gotpl
55
home: https://github.com/kubernetes/autoscaler
@@ -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.43.2
14+
version: 9.46.0

charts/cluster-autoscaler/README.md

Lines changed: 34 additions & 3 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`:
@@ -340,6 +358,14 @@ extraVolumeMounts:
340358
readOnly: true
341359
```
342360

361+
### Custom arguments
362+
363+
You can use the `customArgs` value to give any argument to cluster autoscaler command.
364+
365+
Typical use case is to give an environment variable as an argument which will be interpolated at execution time.
366+
367+
This is helpful when you need to inject values from configmap or secret.
368+
343369
## Troubleshooting
344370

345371
The chart will succeed even if the container arguments are incorrect. A few minutes after starting `kubectl logs -l "app=aws-cluster-autoscaler" --tail=50` should loop through something like
@@ -413,14 +439,19 @@ vpa:
413439
| 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. |
414440
| 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. |
415441
| 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` |
416446
| cloudConfigPath | string | `""` | Configuration file for cloud provider. |
417-
| 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. |
418448
| 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` |
419449
| clusterAPIConfigMapsNamespace | string | `""` | Namespace on the workload cluster to store Leader election and status configmaps |
420450
| 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` |
421451
| clusterAPIMode | string | `"incluster-incluster"` | Cluster API mode, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#connecting-cluster-autoscaler-to-cluster-api-management-and-workload-clusters Syntax: workloadClusterMode-ManagementClusterMode for `kubeconfig-kubeconfig`, `incluster-kubeconfig` and `single-kubeconfig` you always must mount the external kubeconfig using either `extraVolumeSecrets` or `extraMounts` and `extraVolumes` if you dont set `clusterAPIKubeconfigSecret`and thus use an in-cluster config or want to use a non capi generated kubeconfig you must do so for the workload kubeconfig as well |
422452
| clusterAPIWorkloadKubeconfigPath | string | `"/etc/kubernetes/value"` | Path to kubeconfig for connecting to Cluster API managed workloadcluster, only used if `clusterAPIMode=kubeconfig-kubeconfig or kubeconfig-incluster` |
423453
| containerSecurityContext | object | `{}` | [Security context for container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
454+
| customArgs | list | `[]` | Additional custom container arguments. Refer to https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca for the full list of cluster autoscaler parameters and their default values. List of arguments as strings. |
424455
| deployment.annotations | object | `{}` | Annotations to add to the Deployment object. |
425456
| dnsPolicy | string | `"ClusterFirst"` | Defaults to `ClusterFirst`. Valid values are: `ClusterFirstWithHostNet`, `ClusterFirst`, `Default` or `None`. If autoscaler does not depend on cluster DNS, recommended to set this to `Default`. |
426457
| envFromConfigMap | string | `""` | ConfigMap name to use as envFrom. |
@@ -439,7 +470,7 @@ vpa:
439470
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
440471
| image.pullSecrets | list | `[]` | Image pull secrets |
441472
| image.repository | string | `"registry.k8s.io/autoscaling/cluster-autoscaler"` | Image repository |
442-
| image.tag | string | `"v1.31.0"` | Image tag |
473+
| image.tag | string | `"v1.32.0"` | Image tag |
443474
| initContainers | list | `[]` | Any additional init containers. |
444475
| kubeTargetVersionOverride | string | `""` | Allow overriding the `.Capabilities.KubeVersion.GitVersion` check. Useful for `helm template` commands. |
445476
| kwokConfigMapName | string | `"kwok-provider-config"` | configmap for configuring kwok provider |
@@ -467,7 +498,7 @@ vpa:
467498
| replicaCount | int | `1` | Desired number of pods |
468499
| resources | object | `{}` | Pod resource requests and limits. |
469500
| revisionHistoryLimit | int | `10` | The number of revisions to keep. |
470-
| 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 |
471502
| securityContext | object | `{}` | [Security context for pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
472503
| service.annotations | object | `{}` | Annotations to add to service |
473504
| service.clusterIP | string | `""` | IP address to assign to service |

charts/cluster-autoscaler/README.md.gotmpl

Lines changed: 26 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`:
@@ -340,6 +358,14 @@ extraVolumeMounts:
340358
readOnly: true
341359
```
342360

361+
### Custom arguments
362+
363+
You can use the `customArgs` value to give any argument to cluster autoscaler command.
364+
365+
Typical use case is to give an environment variable as an argument which will be interpolated at execution time.
366+
367+
This is helpful when you need to inject values from configmap or secret.
368+
343369
## Troubleshooting
344370

345371
The chart will succeed even if the container arguments are incorrect. A few minutes after starting `kubectl logs -l "app=aws-cluster-autoscaler" --tail=50` should loop through something like

charts/cluster-autoscaler/templates/deployment.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ spec:
103103
- --cluster-name={{ tpl (.Values.magnumClusterName) . }}
104104
{{- end }}
105105
{{- else if eq .Values.cloudProvider "clusterapi" }}
106-
{{- if or .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels .Values.autoDiscovery.namepace }}
106+
{{- if or .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels .Values.autoDiscovery.namespace }}
107107
- --node-group-auto-discovery=clusterapi:{{ template "cluster-autoscaler.capiAutodiscoveryConfig" . }}
108108
{{- end }}
109109
{{- if eq .Values.clusterAPIMode "incluster-kubeconfig"}}
@@ -132,6 +132,9 @@ spec:
132132
- --{{ $key | mustRegexFind "^[^_]+" }}
133133
{{- end }}
134134
{{- end }}
135+
{{- range .Values.customArgs }}
136+
- {{ . }}
137+
{{- end }}
135138
env:
136139
- name: POD_NAMESPACE
137140
valueFrom:
@@ -218,6 +221,27 @@ spec:
218221
{{- else if eq .Values.cloudProvider "kwok" }}
219222
- name: KWOK_PROVIDER_CONFIGMAP
220223
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 }}
221245
{{- end }}
222246
{{- range $key, $value := .Values.extraEnv }}
223247
- 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: 28 additions & 3 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`
@@ -192,10 +209,18 @@ extraArgs:
192209
# scale-down-delay-after-delete: 0s
193210
# scale-down-delay-after-failure: 3m
194211
# scale-down-unneeded-time: 10m
212+
# node-deletion-delay-timeout: 2m
213+
# node-deletion-batcher-interval: 0s
195214
# skip-nodes-with-system-pods: true
196215
# balancing-ignore-label_1: first-label-to-ignore
197216
# balancing-ignore-label_2: second-label-to-ignore
198217

218+
# customArgs -- Additional custom container arguments.
219+
# Refer to https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca for the full list of cluster autoscaler
220+
# parameters and their default values.
221+
# List of arguments as strings.
222+
customArgs: []
223+
199224
# extraEnv -- Additional container environment variables.
200225
extraEnv: {}
201226

@@ -257,7 +282,7 @@ image:
257282
# image.repository -- Image repository
258283
repository: registry.k8s.io/autoscaling/cluster-autoscaler
259284
# image.tag -- Image tag
260-
tag: v1.31.0
285+
tag: v1.32.0
261286
# image.pullPolicy -- Image pull policy
262287
pullPolicy: IfNotPresent
263288
## Optionally specify an array of imagePullSecrets.
@@ -438,5 +463,5 @@ vpa:
438463
# 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.
439464
containerPolicy: {}
440465

441-
# 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
442467
secretKeyRefNameOverride: ""

0 commit comments

Comments
 (0)