Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Fix two autoscaler issues (#4506)
Browse files Browse the repository at this point in the history
Co-authored-by: Ke Zhou <[email protected]>
  • Loading branch information
zhouke1991 and Ke Zhou authored Mar 22, 2023
1 parent 043441a commit 893310a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ kind: MachineDeployment
metadata:
#@overlay/match missing_ok=True
annotations:
cluster.k8s.io/cluster-api-autoscaler-node-group-min-size: #@ "{}".format(data.values.AUTOSCALER_MIN_SIZE_0 or data.values.WORKER_MACHINE_COUNT_0)
cluster.k8s.io/cluster-api-autoscaler-node-group-max-size: #@ "{}".format(data.values.AUTOSCALER_MAX_SIZE_0 or data.values.WORKER_MACHINE_COUNT_0)
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: #@ "{}".format(data.values.AUTOSCALER_MIN_SIZE_0 or data.values.WORKER_MACHINE_COUNT_0)
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: #@ "{}".format(data.values.AUTOSCALER_MAX_SIZE_0 or data.values.WORKER_MACHINE_COUNT_0)

#@overlay/match by=overlay.subset({"kind":"MachineDeployment", "metadata": {"name": data.values.CLUSTER_NAME + "-md-1"}}), missing_ok=True
---
Expand All @@ -20,8 +20,8 @@ kind: MachineDeployment
metadata:
#@overlay/match missing_ok=True
annotations:
cluster.k8s.io/cluster-api-autoscaler-node-group-min-size: #@ "{}".format(data.values.AUTOSCALER_MIN_SIZE_1 or data.values.WORKER_MACHINE_COUNT_1)
cluster.k8s.io/cluster-api-autoscaler-node-group-max-size: #@ "{}".format(data.values.AUTOSCALER_MAX_SIZE_1 or data.values.WORKER_MACHINE_COUNT_1)
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: #@ "{}".format(data.values.AUTOSCALER_MIN_SIZE_1 or data.values.WORKER_MACHINE_COUNT_1)
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: #@ "{}".format(data.values.AUTOSCALER_MAX_SIZE_1 or data.values.WORKER_MACHINE_COUNT_1)

#@overlay/match by=overlay.subset({"kind":"MachineDeployment", "metadata": {"name": data.values.CLUSTER_NAME + "-md-2"}}), missing_ok=True
---
Expand All @@ -30,7 +30,7 @@ kind: MachineDeployment
metadata:
#@overlay/match missing_ok=True
annotations:
cluster.k8s.io/cluster-api-autoscaler-node-group-min-size: #@ "{}".format(data.values.AUTOSCALER_MIN_SIZE_2 or data.values.WORKER_MACHINE_COUNT_2)
cluster.k8s.io/cluster-api-autoscaler-node-group-max-size: #@ "{}".format(data.values.AUTOSCALER_MAX_SIZE_2 or data.values.WORKER_MACHINE_COUNT_2)
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: #@ "{}".format(data.values.AUTOSCALER_MIN_SIZE_2 or data.values.WORKER_MACHINE_COUNT_2)
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: #@ "{}".format(data.values.AUTOSCALER_MAX_SIZE_2 or data.values.WORKER_MACHINE_COUNT_2)

#@ end
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#@ args.append("--v=4")
#@ args.append("--clusterapi-cloud-config-authoritative")
#@ args.append("--kubeconfig=" + autoscaler_kubeconfig_mount_path() + "/value")
#@ args.append("--node-group-auto-discovery=clusterapi:clusterName=" + data.values.CLUSTER_NAME)
#@ args.append("--node-group-auto-discovery=clusterapi:clusterName=" + data.values.CLUSTER_NAME + ",namespace=" +data.values.NAMESPACE)
#@ args.append("--scale-down-delay-after-add=" + data.values.AUTOSCALER_SCALE_DOWN_DELAY_AFTER_ADD)
#@ args.append("--scale-down-delay-after-delete=" + data.values.AUTOSCALER_SCALE_DOWN_DELAY_AFTER_DELETE)
#@ args.append("--scale-down-delay-after-failure=" + data.values.AUTOSCALER_SCALE_DOWN_DELAY_AFTER_FAILURE)
Expand Down Expand Up @@ -234,5 +234,12 @@ rules:
verbs:
- get
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- '*'
verbs:
- get
- list

#@ end
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#@ args.append("--v=4")
#@ args.append("--clusterapi-cloud-config-authoritative")
#@ args.append("--kubeconfig=" + autoscaler_kubeconfig_mount_path() + "/value")
#@ args.append("--node-group-auto-discovery=clusterapi:clusterName=" + data.values.CLUSTER_NAME)
#@ args.append("--node-group-auto-discovery=clusterapi:clusterName=" + data.values.CLUSTER_NAME +",namespace=" +data.values.NAMESPACE)
#@ args.append("--scale-down-delay-after-add=" + data.values.AUTOSCALER_SCALE_DOWN_DELAY_AFTER_ADD)
#@ args.append("--scale-down-delay-after-delete=" + data.values.AUTOSCALER_SCALE_DOWN_DELAY_AFTER_DELETE)
#@ args.append("--scale-down-delay-after-failure=" + data.values.AUTOSCALER_SCALE_DOWN_DELAY_AFTER_FAILURE)
Expand Down Expand Up @@ -234,5 +234,12 @@ rules:
verbs:
- get
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- '*'
verbs:
- get
- list

#@ end

0 comments on commit 893310a

Please sign in to comment.