Skip to content

Commit e9e32f3

Browse files
sssash18k8s-ci-robotdbenqueelmikoShubham82
authored
Sync upstream v1.30.1 (#317)
* Comment to explain why test is done on STS ownerRef * add informer argument to clusterapi provider builder This change adds the informer factory as an argument to the `buildCloudProvider` function for clusterapi so that building with tags will work properly. * Add informer argument to the CloudProviders builder. * clusterapi: add missing error check * Add instanceType/region support in Helm chart for Hetzner cloud provider * doc: cluster-autoscaler: Oracle provider: Add small security note * doc: cluster-autoscaler: Oracle provider: Add small security note * doc: cluster-autoscaler: Oracle provider: Add small security note * Update charts/cluster-autoscaler/README.md * Update Auto Labels of Subprojects * check empty ProviderID in ali NodeGroupForNode * add gce constructor with custom timeout * update README.md.gotmpl and added Helm docs for Hetzner Cloud * bump chart version * use older helm-docs version and remove empty line in values comment * add missing line breaks * Update charts/cluster-autoscaler/Chart.yaml Co-authored-by: Shubham <[email protected]> * Reduce log spam in AtomicResizeFilteringProcessor Also, introduce default per-node logging quotas. For now, identical to the per-pod ones. * Bump golang in /vertical-pod-autoscaler/pkg/updater Bumps golang from 1.21.6 to 1.22.0. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/recommender Bumps golang from 1.21.6 to 1.22.0. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/admission-controller Bumps golang from 1.21.6 to 1.22.0. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Update Chart.yaml * Move estimatorBuilder from AutoscalingContext to Orchestrator Init * VPA: bump golang.org/x/net to fix CVE-2023-39325 The version of golang.org/x/net currently used is vulnerable to https://avd.aquasec.com/nvd/2023/cve-2023-39325/, bump it to fix that. * Bump go version. * Fix e2e test setup * helm: enable clusterapi namespace autodiscovery * Fix expectedToRegister to respect instances with nil status * add option to keep node group backoff on OutOfResource error * remove changes to backoff interface * attach errors to scale-up request and add comments * revert optionally keeping node group backoff * remove RemoveBackoff from updateScaleRequests * Add ProvisioningRequestProcessor (kubernetes#6488) * Add kube-env to MigInfoProvider * CA: GCE: add pricing for new Z3 machines * Introduce LocalSSDSizeProvider interface for GCE * Use KubeEnv in gce/templates.go * Add templateName to kube-env to ensure that correct value is cached * Add unit-tests * extract create group to function * Merged PR 1379: added retry for creatingAzureManager in case of throttled requests added retry for forceRefresh in case of throttled requests ran tests MallocNanoZone=0 go test -race k8s.io/autoscaler/cluster-autoscaler/cloudprovider/azure -- passed and commented out unit test -- commented out as it takes 10 minutes to complete func TestCreateAzureManagerWithRetryError(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() mockVMClient := mockvmclient.NewMockInterface(ctrl) mockVMSSClient := mockvmssclient.NewMockInterface(ctrl) mockVMSSClient.EXPECT().List(gomock.Any(), "fakeId").Return([]compute.VirtualMachineScaleSet{}, retry.NewError(true, errors.New("test"))).AnyTimes() mockAzClient := &azClient{ virtualMachinesClient: mockVMClient, virtualMachineScaleSetsClient: mockVMSSClient, } manager, err := createAzureManagerInternal(strings.NewReader(validAzureCfg), cloudprovider.NodeGroupDiscoveryOptions{}, config.AutoscalingOptions{}, mockAzClient) assert.Nil(t, manager) assert.NotNil(t, err) } * docs: update outdated/deprecated taints in the examples Refactor references to taints & tolerations, replacing master key with control-plane across all the example YAMLs. Signed-off-by: Feruzjon Muyassarov <[email protected]> * CA FAQ: clarify the point about scheduling constraints blocking scale-down * Add warning about vendor removal to Makefile build target Signed-off-by: Feruzjon Muyassarov <[email protected]> * fix: add missing ephemeral-storage resource definition * Add BuildTestNodeWithAllocatable test utility method. * Add ProvisioningRequest injector (kubernetes#6529) * Add ProvisioningRequests injector * Add test case for Accepted conditions and add supported provreq classes list * Use Passive clock * Consider preemption policy for expandable pods * Fix a bug where atomic scale-down failure could affect subsequent atomic scale-downs * Update gce_price_info.go * Migrate from satori/go.uuid to google/uuid * Delay force refresh by DefaultInterval when OCI GetNodePool call returns 404 * CA: update dependencies to k8s v1.30.0-alpha.3, go1.21.8 * Bump golang in /vertical-pod-autoscaler/pkg/admission-controller Bumps golang from 1.22.0 to 1.22.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/updater Bumps golang from 1.22.0 to 1.22.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/recommender Bumps golang from 1.22.0 to 1.22.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update expander options for the AWS cloud provider README * Remove shadow err variable in deleteCreatedNodesWithErros func * fix memory leak in NodeDeleteTracker * CA - Add 1.29 to version compatibility matrix * ClusterAutoscaler: Put APIs in a separate go module Signed-off-by: Yuki Iwai <[email protected]> * Extend update-deps.sh so that we can automatically update k8s libraries in the apis pkg Signed-off-by: Yuki Iwai <[email protected]> * Clean up update-deps.sh Signed-off-by: Yuki Iwai <[email protected]> * Update apis version to v1.29.2 Signed-off-by: Yuki Iwai <[email protected]> * Allow to override rancher provider settings Currently it is only possible to set provider settings over yaml file. This commit introduces env variables to override URL, token and cluster name. If particular environment variable is set it overrides value supplied in yaml file. Signed-off-by: Dinar Valeev <[email protected]> Co-authored-by: Donovan Muller <[email protected]> * Bump VPA version to 1.1.0 * Deprecate the Linode Cluster Autoscaler provider Signed-off-by: Ondrej Kokes <[email protected]> * add price info for n4 * update n4 price info format * Set "pd-balanced" as DefaultBootDiskType It is a default since v1.24 Ref: https://cloud.google.com/kubernetes-engine/docs/how-to/custom-boot-disks#specify * Clarify VPA and HPA limitations Signed-off-by: Luke Addison <[email protected]> * Update ionos-cloud-sdk-go and mocks * Update provider code * Add cloud API request metrics. * Fix and update README * Ignore ionos-cloud-sdk-go spelling * fix n4 price format * Add listManagedInstancesResults to GceCache. * [clusterapi] Do not skip nodegroups with minSize=maxSize * [clusterapi] Update tests for nodegroups with minSize=maxSize * add tests * made changes to support MIGs that use regional instance templates * modified current unit tests to support the new modifications * added comment to InstanceTemplateNameType * Ran hack/go-fmtupdate.h on mig_info_provider_test.go * Use KubeEnv in gce/templates.go * Add templateName to kube-env to ensure that correct value is cached * rebased and resolved conflicts * added fix for unit tests * changed InstanceTemplateNameType to InstanceTemplateName * separated url parser to its own function, created unit test for the function * separated url parser to its own function, created unit test for the function * added unit test with regional MIG * Migrate GCE client to server side operation wait * Track type of node group created/deleted in auto-provisioned group metrics. * trigger tests * fix comment * Add AtomicScaleUp method to NodeGroup interface * Add an option to Cluster Autoscaler that allows triggering new loops more frequently: based on new unschedulable pods and every time a previous iteration was productive. * Refactor StartDeletion usage patterns and enforce periodic scaledown status processor calls. * Bump golang to 1.22 * updated admission-controller to have adjustable --min-tls-version and --tls-ciphers * CA: Move the ProvisioningRequest CRD to apis module Signed-off-by: Yuki Iwai <[email protected]> * Bump default VPA version to 1.1.0 As part of the 1.1.0 release: kubernetes#6388 * Format README * Add chart versions * Add script to update required chart versions in README * Add chart version column in version matrix * Move cluster-autoscaler update-chart-version-readme script to /hack * Only check recent revisions when updating README * Update min cluster-autoscaler chart for Kubernetes 1.29 * Remove unused NodeInfoProcessor * Fix broken link in README.md to point to equinixmetal readme * review comments - simplify retry logic * CA: Before we perform go test, synchronizing go vendor Signed-off-by: Yuki Iwai <[email protected]> * Cleanup ProvReq wrapper * Make the Estimate func accept pods grouped. The grouping should be made by the schedulability equivalence meaning we can introduce optimizations to the binpacking. Introduce a benchmark that estimates capacity needed for 51k pods, which can be grouped to two equivalence groups 50k and 1k. * Update CAPI docs Add a link to the sample manifest and update the image used in the example. Signed-off-by: Lennart Jern <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/updater Bumps golang from 1.22.1 to 1.22.2. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/admission-controller Bumps golang from 1.22.1 to 1.22.2. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump golang in /vertical-pod-autoscaler/pkg/recommender Bumps golang from 1.22.1 to 1.22.2. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Introduce binbacking optimization for similar pods. The optimization uses the fact that pods which are equivalent do not need to be check multiple times against already filled nodes. This changes the time complexity from O(pods*nodes) to O(pods). * CA: Fix apis vendoring * Add g6 EC2 instance type for AWS * Copyright boilerplate * Lower errors verbosity for kube-env label missing * parentController may be nil when owner isn't scalable * Update ProvisioningClass API Group * Fix Autoscaling for worker nodes with invalid ProviderID This change fixes a bug that arises when the user's cluster includes worker nodes not from Hetzner Cloud, such as a Hetzner Dedicated server or any server resource other than Hetzner. It also corrects the behavior when a server has been physically deleted from Hetzner Cloud. Signed-off-by: Maksim Paskal <[email protected]> * Add tests for Pods owner that doesn't implement /scale * Add provreqOrchestrator that handle ProvReq classes (kubernetes#6627) * Add provreqOrchestrator that handle ProvReq classes * Review remarks * Review remarks * Cluster Autoscaler: Sync k8s.io dependencies to k/k v1.30.0, bump Go to 1.22.2 * [v1.30] fix(hetzner): hostname label is not considered The Node Group info we currently return does not include the `kubernetes.io/hostname` label, which is usually set on every node. This causes issues when the user has an unscheduled pod with a `topologySpreadConstraint` on `topologyKey: kubernetes.io/hostname`. cluster-autoscaler is unable to fulfill this constraint and does not scale up any of the node groups. Related to kubernetes#6715 * Remove the flag for enabling ProvisioningRequests The API is not stable yet, we don't want people to depend on the current version. * fix: scale up broken for providers not implementing NodeGroup.GetOptions() Properly handle calls to `NodeGroup.GetOptions()` that return `cloudprovider.ErrNotImplemented` in the scale up path. * Add --enable-provisioning-requests flag * [cluster-autoscaler-release-1.30] Fix ProvisioningRequest update (kubernetes#6825) * Fix ProvisioningRequest update * Review remarks --------- Co-authored-by: Yaroslava Serdiuk <[email protected]> * Update k/k vendor to 1.30.1 for CA 1.30 * sync changes * added sync changes file * golint fix * update vpa vendor * fixed volcengine * ran gofmt * synched azure * synched azure * synched IT * removed IT log file * addressed review comments --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Feruzjon Muyassarov <[email protected]> Signed-off-by: Yuki Iwai <[email protected]> Signed-off-by: Dinar Valeev <[email protected]> Signed-off-by: Ondrej Kokes <[email protected]> Signed-off-by: Luke Addison <[email protected]> Signed-off-by: Lennart Jern <[email protected]> Signed-off-by: Maksim Paskal <[email protected]> Co-authored-by: Kubernetes Prow Robot <[email protected]> Co-authored-by: David Benque <[email protected]> Co-authored-by: michael mccune <[email protected]> Co-authored-by: shubham82 <[email protected]> Co-authored-by: Markus Lehtonen <[email protected]> Co-authored-by: Niklas Rosenstein <[email protected]> Co-authored-by: Ky-Anh Huynh <[email protected]> Co-authored-by: Niklas Rosenstein <[email protected]> Co-authored-by: Guy Templeton <[email protected]> Co-authored-by: daimaxiaxie <[email protected]> Co-authored-by: daimaxiaxie <[email protected]> Co-authored-by: Michal Pitr <[email protected]> Co-authored-by: Daniel Kłobuszewski <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Artur Żyliński <[email protected]> Co-authored-by: Alvaro Aleman <[email protected]> Co-authored-by: Marco Voelz <[email protected]> Co-authored-by: Jack Francis <[email protected]> Co-authored-by: Yarin Miran <[email protected]> Co-authored-by: Will Bowers <[email protected]> Co-authored-by: Yaroslava Serdiuk <[email protected]> Co-authored-by: Bartłomiej Wróblewski <[email protected]> Co-authored-by: Anish Shah <[email protected]> Co-authored-by: Mahmoud Atwa <[email protected]> Co-authored-by: pawel siwek <[email protected]> Co-authored-by: Miranda Craghead <[email protected]> Co-authored-by: Feruzjon Muyassarov <[email protected]> Co-authored-by: Kuba Tużnik <[email protected]> Co-authored-by: Johnnie Ho <[email protected]> Co-authored-by: Walid Ghallab <[email protected]> Co-authored-by: Karol Wychowaniec <[email protected]> Co-authored-by: oksanabaza <[email protected]> Co-authored-by: Vijay Bhargav Eshappa <[email protected]> Co-authored-by: David <[email protected]> Co-authored-by: Damika Gamlath <[email protected]> Co-authored-by: Ashish Pani <[email protected]> Co-authored-by: Yuki Iwai <[email protected]> Co-authored-by: Dinar Valeev <[email protected]> Co-authored-by: Donovan Muller <[email protected]> Co-authored-by: Luiz Antonio <[email protected]> Co-authored-by: Ondrej Kokes <[email protected]> Co-authored-by: Yuan <[email protected]> Co-authored-by: Luke Addison <[email protected]> Co-authored-by: Mario Valderrama <[email protected]> Co-authored-by: Max Fedotov <[email protected]> Co-authored-by: Daniel-Redeploy <[email protected]> Co-authored-by: Edwinhr716 <[email protected]> Co-authored-by: Maksym Fuhol <[email protected]> Co-authored-by: Allen Mun <[email protected]> Co-authored-by: mewa <[email protected]> Co-authored-by: Aayush Rangwala <[email protected]> Co-authored-by: prachigandhi <[email protected]> Co-authored-by: Daniel Gutowski <[email protected]> Co-authored-by: Lennart Jern <[email protected]> Co-authored-by: mendelski <[email protected]> Co-authored-by: ceuity <[email protected]> Co-authored-by: Maksim Paskal <[email protected]> Co-authored-by: Julian Tölle <[email protected]> Co-authored-by: k8s-infra-cherrypick-robot <[email protected]>
1 parent 2f7cf88 commit e9e32f3

File tree

2,726 files changed

+120474
-340594
lines changed

Some content is hidden

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

2,726 files changed

+120474
-340594
lines changed

Diff for: .github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ updates:
2828
open-pull-requests-limit: 3
2929
labels:
3030
- "vertical-pod-autoscaler"
31+
- package-ecosystem: gomod
32+
directory: "/addon-resizer"
33+
schedule:
34+
interval: daily
35+
target-branch: "addon-resizer-release-1.8"
36+
open-pull-requests-limit: 3

Diff for: .github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.21.6'
20+
go-version: '1.22.1'
2121

2222
- uses: actions/checkout@v2
2323
with:

Diff for: addon-resizer/OWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ emeritus_approvers:
88
- bskiba # 2022-09-30
99
- wojtek-t # 2022-09-30
1010
labels:
11-
- addon-resizer
11+
- area/addon-resizer

Diff for: balancer/OWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ reviewers:
55
- mwielgus
66
- kgolab
77
labels:
8-
- balancer
8+
- area/balancer

Diff for: builder/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
FROM golang:1.22.2
1716
LABEL maintainer="Marcin Wielgus <[email protected]>"
1817

@@ -22,6 +21,6 @@ ENV GO111MODULE auto
2221

2322
RUN apt-get update && apt-get --yes install libseccomp-dev
2423
RUN go version
25-
RUN go get github.com/tools/godep
24+
RUN go install github.com/tools/godep@latest
2625
RUN godep version
2726
CMD ["/bin/bash"]

Diff for: charts/OWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ reviewers:
44
- gjtempleton
55

66
labels:
7-
- helm-charts
7+
- area/helm-charts

Diff for: charts/cluster-autoscaler/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
appVersion: 1.28.2
2+
appVersion: 1.29.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.34.1
14+
version: 9.36.0

Diff for: charts/cluster-autoscaler/README.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ To create a valid configuration, follow instructions for your cloud provider:
7373
- [Azure](#azure)
7474
- [OpenStack Magnum](#openstack-magnum)
7575
- [Cluster API](#cluster-api)
76+
- [Exoscale](#exoscale)
77+
- [Hetzner Cloud](#hetzner-cloud)
7678

7779
### Templating the autoDiscovery.clusterName
7880

@@ -222,6 +224,7 @@ $ helm install my-release autoscaler/cluster-autoscaler -f myvalues.yaml
222224
`cloudProvider: clusterapi` must be set, and then one or more of
223225

224226
- `autoDiscovery.clusterName`
227+
- or `autoDiscovery.namespace`
225228
- or `autoDiscovery.labels`
226229

227230
See [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#configuring-node-group-auto-discovery) for more details.
@@ -259,6 +262,18 @@ $ helm install my-release autoscaler/cluster-autoscaler \
259262

260263
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.
261264

265+
### Hetzner Cloud
266+
267+
The following parameters are required:
268+
269+
- `cloudProvider=hetzner`
270+
- `extraEnv.HCLOUD_TOKEN=...`
271+
- `autoscalingGroups=...`
272+
273+
Each autoscaling group requires an additional `instanceType` and `region` key to be set.
274+
275+
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.
276+
262277
## Uninstalling the Chart
263278

264279
To uninstall `my-release`:
@@ -373,17 +388,17 @@ vpa:
373388
| affinity | object | `{}` | Affinity for pod assignment |
374389
| autoDiscovery.clusterName | string | `nil` | Enable autodiscovery for `cloudProvider=aws`, for groups matching `autoDiscovery.tags`. autoDiscovery.clusterName -- Enable autodiscovery for `cloudProvider=azure`, using tags defined in https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/azure/README.md#auto-discovery-setup. Enable autodiscovery for `cloudProvider=clusterapi`, for groups matching `autoDiscovery.labels`. Enable autodiscovery for `cloudProvider=gce`, but no MIG tagging required. Enable autodiscovery for `cloudProvider=magnum`, for groups matching `autoDiscovery.roles`. |
375390
| 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 |
391+
| autoDiscovery.namespace | string | `nil` | Enable autodiscovery via cluster namespace for for `cloudProvider=clusterapi` |
376392
| autoDiscovery.roles | list | `["worker"]` | Magnum node group roles to match. |
377393
| autoDiscovery.tags | list | `["k8s.io/cluster-autoscaler/enabled","k8s.io/cluster-autoscaler/{{ .Values.autoDiscovery.clusterName }}"]` | ASG tags to match, run through `tpl`. |
378-
| autoscalingGroups | list | `[]` | 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 /> minSize: 1 </pre> |
394+
| autoscalingGroups | list | `[]` | 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 /> minSize: 1 </pre> For Hetzner Cloud, the `instanceType` and `region` keys are also required. <pre> - name: mypool<br /> maxSize: 2<br /> minSize: 1<br /> instanceType: CPX21<br /> region: FSN1 </pre> |
379395
| autoscalingGroupsnamePrefix | list | `[]` | For GCE. At least one element is required if not using `autoDiscovery`. For example: <pre> - name: ig01<br /> maxSize: 10<br /> minSize: 0 </pre> |
380396
| 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)) |
381397
| awsRegion | string | `"us-east-1"` | AWS region (required if `cloudProvider=aws`) |
382398
| awsSecretAccessKey | string | `""` | AWS access secret key ([if AWS user keys used](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials)) |
383399
| azureClientID | string | `""` | Service Principal ClientID with contributor permission to Cluster and Node ResourceGroup. Required if `cloudProvider=azure` |
384400
| azureClientSecret | string | `""` | Service Principal ClientSecret with contributor permission to Cluster and Node ResourceGroup. Required if `cloudProvider=azure` |
385-
| azureClusterName | string | `""` | Azure AKS cluster name. Required if `cloudProvider=azure` |
386-
| azureNodeResourceGroup | string | `""` | Azure resource group where the cluster's nodes are located, typically set as `MC_<cluster-resource-group-name>_<cluster-name>_<location>`. Required if `cloudProvider=azure` |
401+
| azureEnableForceDelete | bool | `false` | Whether to force delete VMs or VMSS instances when scaling down. |
387402
| azureResourceGroup | string | `""` | Azure resource group that the cluster is located. Required if `cloudProvider=azure` |
388403
| azureSubscriptionID | string | `""` | Azure subscription where the resources are located. Required if `cloudProvider=azure` |
389404
| azureTenantID | string | `""` | Azure tenant where the resources are located. Required if `cloudProvider=azure` |
@@ -415,7 +430,7 @@ vpa:
415430
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
416431
| image.pullSecrets | list | `[]` | Image pull secrets |
417432
| image.repository | string | `"registry.k8s.io/autoscaling/cluster-autoscaler"` | Image repository |
418-
| image.tag | string | `"v1.28.2"` | Image tag |
433+
| image.tag | string | `"v1.29.0"` | Image tag |
419434
| kubeTargetVersionOverride | string | `""` | Allow overriding the `.Capabilities.KubeVersion.GitVersion` check. Useful for `helm template` commands. |
420435
| kwokConfigMapName | string | `"kwok-provider-config"` | configmap for configuring kwok provider |
421436
| magnumCABundlePath | string | `"/etc/kubernetes/ca-bundle.crt"` | Path to the host's CA bundle, from `ca-file` in the cloud-config file. |

Diff for: charts/cluster-autoscaler/README.md.gotmpl

+15
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ To create a valid configuration, follow instructions for your cloud provider:
7373
- [Azure](#azure)
7474
- [OpenStack Magnum](#openstack-magnum)
7575
- [Cluster API](#cluster-api)
76+
- [Exoscale](#exoscale)
77+
- [Hetzner Cloud](#hetzner-cloud)
7678

7779
### Templating the autoDiscovery.clusterName
7880

@@ -222,6 +224,7 @@ $ helm install my-release autoscaler/cluster-autoscaler -f myvalues.yaml
222224
`cloudProvider: clusterapi` must be set, and then one or more of
223225

224226
- `autoDiscovery.clusterName`
227+
- or `autoDiscovery.namespace`
225228
- or `autoDiscovery.labels`
226229

227230
See [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/README.md#configuring-node-group-auto-discovery) for more details.
@@ -259,6 +262,18 @@ $ helm install my-release autoscaler/cluster-autoscaler \
259262

260263
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.
261264

265+
### Hetzner Cloud
266+
267+
The following parameters are required:
268+
269+
- `cloudProvider=hetzner`
270+
- `extraEnv.HCLOUD_TOKEN=...`
271+
- `autoscalingGroups=...`
272+
273+
Each autoscaling group requires an additional `instanceType` and `region` key to be set.
274+
275+
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.
276+
262277
## Uninstalling the Chart
263278

264279
To uninstall `my-release`:

Diff for: charts/cluster-autoscaler/templates/NOTES.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if or .Values.autoDiscovery.clusterName .Values.autoscalingGroups -}}
1+
{{- if or ( or .Values.autoDiscovery.clusterName .Values.autoDiscovery.namespace .Values.autoDiscovery.labels ) .Values.autoscalingGroups }}
22

33
To verify that cluster-autoscaler has started, run:
44

@@ -8,7 +8,7 @@ To verify that cluster-autoscaler has started, run:
88

99
##############################################################################
1010
#### ERROR: You must specify values for either ####
11-
#### autoDiscovery.clusterName or autoscalingGroups[] ####
11+
#### autoDiscovery or autoscalingGroups[] ####
1212
##############################################################################
1313

1414
The deployment and pod will not be created and the installation is not functional

Diff for: charts/cluster-autoscaler/templates/_helpers.tpl

+38-10
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,11 @@ app.kubernetes.io/name: {{ include "cluster-autoscaler.name" . | quote }}
4040

4141

4242
{{/*
43-
Return labels, including instance, name and version.
43+
Return labels, including instance and name.
4444
*/}}
4545
{{- define "cluster-autoscaler.labels" -}}
4646
{{ include "cluster-autoscaler.instance-name" . }}
4747
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
48-
{{- if .Chart.AppVersion }}
49-
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
50-
{{- end }}
5148
helm.sh/chart: {{ include "cluster-autoscaler.chart" . | quote }}
5249
{{- if .Values.additionalLabels }}
5350
{{ toYaml .Values.additionalLabels }}
@@ -112,21 +109,52 @@ Return true if the priority expander is enabled
112109
{{- end -}}
113110

114111
{{/*
115-
Return the autodiscoveryparameters for clusterapi.
112+
autoDiscovery.clusterName for clusterapi.
116113
*/}}
117-
{{- define "cluster-autoscaler.capiAutodiscoveryConfig" -}}
118-
{{- if .Values.autoDiscovery.clusterName -}}
114+
{{- define "cluster-autoscaler.capiAutodiscovery.clusterName" -}}
119115
{{- print "clusterName=" -}}{{ tpl (.Values.autoDiscovery.clusterName) . }}
120116
{{- end -}}
121-
{{- if and .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels -}}
122-
{{- print "," -}}
117+
118+
{{/*
119+
autoDiscovery.namespace for clusterapi.
120+
*/}}
121+
{{- define "cluster-autoscaler.capiAutodiscovery.namespace" -}}
122+
{{- print "namespace=" }}{{ .Values.autoDiscovery.namespace -}}
123123
{{- end -}}
124-
{{- if .Values.autoDiscovery.labels -}}
124+
125+
{{/*
126+
autoDiscovery.labels for clusterapi.
127+
*/}}
128+
{{- define "cluster-autoscaler.capiAutodiscovery.labels" -}}
125129
{{- range $i, $el := .Values.autoDiscovery.labels -}}
126130
{{- if $i -}}{{- print "," -}}{{- end -}}
127131
{{- range $key, $val := $el -}}
128132
{{- $key -}}{{- print "=" -}}{{- $val -}}
129133
{{- end -}}
130134
{{- end -}}
131135
{{- end -}}
136+
137+
{{/*
138+
Return the autodiscoveryparameters for clusterapi.
139+
*/}}
140+
{{- define "cluster-autoscaler.capiAutodiscoveryConfig" -}}
141+
{{- if .Values.autoDiscovery.clusterName -}}
142+
{{ include "cluster-autoscaler.capiAutodiscovery.clusterName" . }}
143+
{{- if .Values.autoDiscovery.namespace }}
144+
{{- print "," -}}
145+
{{ include "cluster-autoscaler.capiAutodiscovery.namespace" . }}
146+
{{- end -}}
147+
{{- if .Values.autoDiscovery.labels }}
148+
{{- print "," -}}
149+
{{ include "cluster-autoscaler.capiAutodiscovery.labels" . }}
150+
{{- end -}}
151+
{{- else if .Values.autoDiscovery.namespace -}}
152+
{{ include "cluster-autoscaler.capiAutodiscovery.namespace" . }}
153+
{{- if .Values.autoDiscovery.labels }}
154+
{{- print "," -}}
155+
{{ include "cluster-autoscaler.capiAutodiscovery.labels" . }}
156+
{{- end -}}
157+
{{- else if .Values.autoDiscovery.labels -}}
158+
{{ include "cluster-autoscaler.capiAutodiscovery.labels" . }}
159+
{{- end -}}
132160
{{- end -}}

Diff for: charts/cluster-autoscaler/templates/deployment.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if or ( or .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels ) .Values.autoscalingGroups }}
1+
{{- if or ( or .Values.autoDiscovery.clusterName .Values.autoDiscovery.namespace .Values.autoDiscovery.labels ) .Values.autoscalingGroups }}
22
{{/* one of the above is required */}}
33
apiVersion: {{ template "deployment.apiVersion" . }}
44
kind: Deployment
@@ -60,8 +60,12 @@ spec:
6060
{{- end }}
6161
{{- if .Values.autoscalingGroups }}
6262
{{- range .Values.autoscalingGroups }}
63+
{{- if eq $.Values.cloudProvider "hetzner" }}
64+
- --nodes={{ .minSize }}:{{ .maxSize }}:{{ .instanceType }}:{{ .region }}:{{ .name }}
65+
{{- else }}
6366
- --nodes={{ .minSize }}:{{ .maxSize }}:{{ .name }}
6467
{{- end }}
68+
{{- end }}
6569
{{- end }}
6670
{{- if eq .Values.cloudProvider "rancher" }}
6771
{{- if .Values.cloudConfigPath }}
@@ -95,7 +99,7 @@ spec:
9599
- --cluster-name={{ tpl (.Values.magnumClusterName) . }}
96100
{{- end }}
97101
{{- else if eq .Values.cloudProvider "clusterapi" }}
98-
{{- if or .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels }}
102+
{{- if or .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels .Values.autoDiscovery.namepace }}
99103
- --node-group-auto-discovery=clusterapi:{{ template "cluster-autoscaler.capiAutodiscoveryConfig" . }}
100104
{{- end }}
101105
{{- if eq .Values.clusterAPIMode "incluster-kubeconfig"}}
@@ -166,6 +170,8 @@ spec:
166170
secretKeyRef:
167171
key: VMType
168172
name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }}
173+
- name: AZURE_ENABLE_FORCE_DELETE
174+
value: "{{ .Values.azureEnableForceDelete }}"
169175
{{- if .Values.azureUseWorkloadIdentityExtension }}
170176
- name: ARM_USE_WORKLOAD_IDENTITY_EXTENSION
171177
value: "true"

Diff for: charts/cluster-autoscaler/values.yaml

+15-10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ autoDiscovery:
1616
# Enable autodiscovery for `cloudProvider=magnum`, for groups matching `autoDiscovery.roles`.
1717
clusterName: # cluster.local
1818

19+
# autoDiscovery.namespace -- Enable autodiscovery via cluster namespace for for `cloudProvider=clusterapi`
20+
namespace: # default
21+
1922
# autoDiscovery.tags -- ASG tags to match, run through `tpl`.
2023
tags:
2124
- k8s.io/cluster-autoscaler/enabled
@@ -36,6 +39,14 @@ autoDiscovery:
3639
# maxSize: 2<br />
3740
# minSize: 1
3841
# </pre>
42+
# For Hetzner Cloud, the `instanceType` and `region` keys are also required.
43+
# <pre>
44+
# - name: mypool<br />
45+
# maxSize: 2<br />
46+
# minSize: 1<br />
47+
# instanceType: CPX21<br />
48+
# region: FSN1
49+
# </pre>
3950
autoscalingGroups: []
4051
# - name: asg1
4152
# maxSize: 2
@@ -75,14 +86,6 @@ azureClientID: ""
7586
# Required if `cloudProvider=azure`
7687
azureClientSecret: ""
7788

78-
# azureClusterName -- Azure AKS cluster name.
79-
# Required if `cloudProvider=azure`
80-
azureClusterName: ""
81-
82-
# azureNodeResourceGroup -- Azure resource group where the cluster's nodes are located, typically set as `MC_<cluster-resource-group-name>_<cluster-name>_<location>`.
83-
# Required if `cloudProvider=azure`
84-
azureNodeResourceGroup: ""
85-
8689
# azureResourceGroup -- Azure resource group that the cluster is located.
8790
# Required if `cloudProvider=azure`
8891
azureResourceGroup: ""
@@ -104,6 +107,9 @@ azureUseWorkloadIdentityExtension: false
104107
# azureVMType -- Azure VM type.
105108
azureVMType: "vmss"
106109

110+
# azureEnableForceDelete -- Whether to force delete VMs or VMSS instances when scaling down.
111+
azureEnableForceDelete: false
112+
107113
# cloudConfigPath -- Configuration file for cloud provider.
108114
cloudConfigPath: ""
109115

@@ -230,7 +236,7 @@ image:
230236
# image.repository -- Image repository
231237
repository: registry.k8s.io/autoscaling/cluster-autoscaler
232238
# image.tag -- Image tag
233-
tag: v1.28.2
239+
tag: v1.29.0
234240
# image.pullPolicy -- Image pull policy
235241
pullPolicy: IfNotPresent
236242
## Optionally specify an array of imagePullSecrets.
@@ -375,7 +381,6 @@ serviceMonitor:
375381
# serviceMonitor.metricRelabelings -- MetricRelabelConfigs to apply to samples before ingestion.
376382
metricRelabelings: {}
377383

378-
379384
# tolerations -- List of node taints to tolerate (requires Kubernetes >= 1.6).
380385
tolerations: []
381386

Diff for: cluster-autoscaler/.gitignore

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
cluster-autoscaler
2-
cluster-autoscaler-amd64
3-
cluster-autoscaler-arm64
4-
cluster-autoscaler-s390x
5-
cluster_autoscaler
6-
main
7-
.cover
1+
/cluster-autoscaler
2+
/cluster-autoscaler-amd64
3+
/cluster-autoscaler-arm64
4+
/cluster-autoscaler-s390x
5+
/.cover
86

97
# Vim-related files
108
[._]*.s[a-w][a-z]
@@ -13,4 +11,4 @@ main
1311
Session.vim
1412
.netrwhist
1513
.vscode
16-
/integration/logs
14+
./integration/logs

0 commit comments

Comments
 (0)