Closed nojnhuh closed 1 week ago
/cherry-pick release-1.15 /area managedclusters /assign @willie-yao
@willie-yao This is the diff to the templates I was using to test this:
diff --git a/templates/cluster-template-aks-aso.yaml b/templates/cluster-template-aks-aso.yaml
index 29f77594e..f8dab4ed2 100644
--- a/templates/cluster-template-aks-aso.yaml
+++ b/templates/cluster-template-aks-aso.yaml
@@ -99,6 +99,8 @@ spec:
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
+ annotations:
+ cluster.x-k8s.io/replicas-managed-by: cluster-autoscaler
name: ${CLUSTER_NAME}-pool1
namespace: default
spec:
diff --git a/templates/flavors/aks-aso/cluster-template.yaml b/templates/flavors/aks-aso/cluster-template.yaml
index f71a8258f..5909bfc91 100644
--- a/templates/flavors/aks-aso/cluster-template.yaml
+++ b/templates/flavors/aks-aso/cluster-template.yaml
@@ -97,6 +97,8 @@ apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
name: "${CLUSTER_NAME}-pool1"
+ annotations:
+ cluster.x-k8s.io/replicas-managed-by: cluster-autoscaler
spec:
clusterName: "${CLUSTER_NAME}"
replicas: ${WORKER_MACHINE_COUNT:=2}
diff --git a/templates/test/ci/cluster-template-prow-aks-aso.yaml b/templates/test/ci/cluster-template-prow-aks-aso.yaml
index 5eb38cbaf..7be94e6d4 100644
--- a/templates/test/ci/cluster-template-prow-aks-aso.yaml
+++ b/templates/test/ci/cluster-template-prow-aks-aso.yaml
@@ -107,6 +107,8 @@ spec:
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
+ annotations:
+ cluster.x-k8s.io/replicas-managed-by: cluster-autoscaler
name: ${CLUSTER_NAME}-pool1
namespace: default
spec:
If you spin up an aks-aso
cluster you should be able to change pool1's replica count from anywhere (except the MachinePool spec) and it should stick even after restarting ASO to trigger a reconciliation.
@nojnhuh: once the present PR merges, I will cherry-pick it on top of release-1.15 in a new PR and assign it to you.
/cherry-pick release-1.15
@nojnhuh: once the present PR merges, I will cherry-pick it on top of release-1.15 in a new PR and assign it to you.
Attention: Patch coverage is 80.00000%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 62.19%. Comparing base (
772d354
) to head (92e6ed0
). Report is 5 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
exp/mutators/azureasomanagedmachinepool.go | 75.00% | 1 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: mboersma
The full list of commands accepted by this bot can be found here.
The pull request process is described here
@nojnhuh: new pull request created: #4935
What type of PR is this? /kind bug
What this PR does / why we need it:
Currently, AzureASOManagedMachinePool only handles autoscaled machine pools when the autoscaler is AKS's built-in cluster-autoscaler exposed through the AKS API. This change fixes an issue where using a non-
"aks"
autoscaler defined in a MachinePool'scluster.x-k8s.io/replicas-managed-by
annotation would cause CAPZ/ASO and the autoscaler to fight over the replica count.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged): Fixes #Special notes for your reviewer:
TODOs:
Release note: