Skip to content

Commit 245bca3

Browse files
committed
chore(kubernetes): drop the force-delete flag that blocks partial cleanup
`--force-delete-unregistered-nodes` reads as an override that lets the autoscaler remove a long-unregistered machine below its node group's min size. On the clusterapi provider it grants nothing of the sort: force deletion is not implemented there, the call falls back to the ordinary delete path, and that path refuses to take a group below its min size. The flag never bought the safety valve its name suggests. What it does buy is a behaviour nobody asked for. With the flag set the autoscaler skips trimming the delete batch down to the group's headroom above min size, and the ordinary delete path then refuses a batch larger than that headroom outright instead of removing what it can. A group of three machines above a min size of one loses two long-unregistered machines with the flag unset, and none with it set. Removing it restores the documented default and takes away a signal that advertised a protection the provider does not offer. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 59cc7d7 commit 245bca3

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

‎packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ spec:
5555
- --ignore-mirror-pods-utilization=true
5656
- --scale-down-unneeded-time=30s
5757
- --scan-interval=25s
58-
- --force-delete-unregistered-nodes=true
5958
- --kubeconfig=/etc/kubernetes/kubeconfig/super-admin.svc
6059
- --clusterapi-cloud-config-authoritative
6160
- --node-group-auto-discovery=clusterapi:namespace={{ .Release.Namespace }},clusterName={{ .Release.Name }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
suite: cluster-autoscaler arguments
2+
3+
# `--force-delete-unregistered-nodes` reads as a safety override that lets the
4+
# autoscaler remove a long-unregistered machine below the group's min size. On
5+
# the clusterapi provider it grants nothing of the sort: the provider does not
6+
# implement force deletion, the call falls back to the ordinary delete path,
7+
# and that path refuses to take a group below its min size. What the flag does
8+
# do is skip the step that trims the delete batch down to the group's headroom,
9+
# so a batch larger than the headroom is refused whole instead of trimmed and
10+
# partly executed. The flag is therefore absent by intent rather than by
11+
# oversight, which is what this asserts.
12+
#
13+
# The positive assertion is not decoration: an absence assertion against a path
14+
# that does not resolve passes for the wrong reason, so the args list is proven
15+
# live first.
16+
17+
templates:
18+
- templates/cluster-autoscaler/deployment.yaml
19+
20+
values:
21+
- values/common.yaml
22+
23+
release:
24+
name: test-k8s
25+
namespace: tenant-test
26+
27+
tests:
28+
- it: runs against the clusterapi provider without the force-delete override
29+
documentSelector:
30+
path: kind
31+
value: Deployment
32+
asserts:
33+
- contains:
34+
path: spec.template.spec.containers[0].args
35+
content: --cloud-provider=clusterapi
36+
- notContains:
37+
path: spec.template.spec.containers[0].args
38+
content: --force-delete-unregistered-nodes=true

0 commit comments

Comments
 (0)