Skip to content

Commit 4dc1085

Browse files
committed
built from CA v1.30.4
1 parent 44eaccd commit 4dc1085

File tree

3 files changed

+129
-1
lines changed

3 files changed

+129
-1
lines changed

ADOBE_CHANGELOG.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# About
2+
3+
We maintain a set of patches on top of upstream K8s autoscaler. They need to be
4+
semantically versioned as well so we understand, for example, that we're
5+
upgrading a fix version of autoscaler vs. a fix version of our patches.
6+
7+
The scheme is quite simple. The product is first, followed by the upstream
8+
version, followed by our version:
9+
10+
```
11+
Product is cluster-autoscaler or vertical-pod-autoscaler or addon-resizer
12+
K stands for K8s upstream version
13+
A stands for Adobe's changes
14+
15+
{Product}-{K major}.{K minor}.{K fix}-{A major}.{A minor}.{A fix}-adobe
16+
```
17+
18+
# Log
19+
20+
## cluster-autoscaler-1.30.4-1.8.0-adobe
21+
- built from CA v1.30.4
22+
23+
## cluster-autoscaler-1.29.4-1.8.0-adobe
24+
- backport https://github.com/jackfrancis/autoscaler/commit/7bcdfe872f3fffaebe0650e0a022b860cdcebf66
25+
26+
## cluster-autoscaler-1.29.4-1.7.0-adobe
27+
_not released_
28+
29+
## cluster-autoscaler-1.29.4-1.6.0-adobe
30+
- built from CA v1.29.4
31+
32+
## cluster-autoscaler-1.28.6-1.6.0-adobe
33+
- built from CA v1.28.6
34+
35+
## cluster-autoscaler-1.27.7-1.6.0-adobe
36+
- built from CA v1.27.7
37+
38+
## cluster-autoscaler-1.27.5-1.6.0-adobe
39+
- built from CA v1.27.5
40+
41+
## cluster-autoscaler-1.26.4-1.6.0-adobe
42+
- built from CA v1.26.4
43+
- backport https://github.com/kubernetes/autoscaler/pull/5550
44+
45+
## cluster-autoscaler-1.25.2-1.6.0-adobe
46+
- backport https://github.com/kubernetes/autoscaler/pull/5550
47+
48+
## cluster-autoscaler-1.25.2-1.5.0-adobe
49+
- built from CA v1.25.2
50+
51+
## cluster-autoscaler-1.24.2-1.6.0-adobe
52+
- backport https://github.com/kubernetes/autoscaler/pull/5550
53+
54+
## cluster-autoscaler-1.24.2-1.5.0-adobe
55+
- built from CA v1.24.2
56+
57+
## cluster-autoscaler-1.24.1-1.5.0-adobe
58+
- built from CA v1.24.1
59+
60+
## cluster-autoscaler-1.23.1-1.5.0-adobe
61+
- skip deletion of unregistered nodes if there are more than 50% of discovered nodes
62+
63+
## cluster-autoscaler-1.23.1-1.4.0-adobe
64+
- built from CA v1.23.1
65+
- backport https://github.com/kubernetes/autoscaler/pull/4970
66+
- remove code from 1.0.0-adobe and 1.2.0-adobe
67+
68+
## cluster-autoscaler-1.22.3-1.3.0-adobe
69+
- built from CA v1.22.3
70+
- backport https://github.com/kubernetes/autoscaler/pull/4970
71+
72+
## cluster-autoscaler-1.22.2-1.2.1-adobe
73+
- built from CA v1.22.2
74+
75+
## cluster-autoscaler-1.21.2-1.2.1-adobe
76+
- built from CA v1.21.2
77+
78+
## cluster-autoscaler-1.20.1-1.2.1-adobe
79+
- also use `topology.kubernetes.io/zone` when evaluating topology spread constraints
80+
81+
## cluster-autoscaler-1.20.1-1.2.0-adobe
82+
- improve scale out time when using topology spread constraints
83+
84+
## cluster-autoscaler-1.20.1-1.1.0-adobe
85+
- upgraded ca
86+
87+
## cluster-autoscaler-1.20.0-1.1.0-adobe
88+
- fix uneven scaling with topology contraints
89+
- backport https://github.com/kubernetes/autoscaler/pull/3883
90+
91+
## cluster-autoscaler-1.20.0-1.0.0-adobe
92+
- on scale-down, evict DaemonSet pods after all the other pods
93+
94+
# Procedure
95+
96+
```bash
97+
# Assuming cluster-autoscaler-1.21-adobe is the latest "Adobe" release, built
98+
# "on top" of of 1.21.0, and we want to upgrade to 1.21.2
99+
git checkout cluster-autoscaler-1.21-adobe
100+
# Reset to the upstream version we originally built on
101+
git reset cluster-autoscaler-1.21.0
102+
# Stash "Adobe" changes
103+
git stash
104+
# Get the latest stuff from upstream
105+
git fetch upstream
106+
# Update the branch to upstream 1.21.2
107+
git merge -s recursive -X theirs cluster-autoscaler-1.21.2
108+
# Apply "Adobe" changes, on top of 1.21.2
109+
git stash pop
110+
# Resolve conflicts if needed, then git add/git commit all the files (including this one)
111+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package clusterstate
2+
3+
// ClearUnregisteredNodes clears the unregistered node cache
4+
func (csr *ClusterStateRegistry) ClearUnregisteredNodes() {
5+
csr.Lock()
6+
defer csr.Unlock()
7+
csr.unregisteredNodes = make(map[string]UnregisteredNode)
8+
}

cluster-autoscaler/core/static_autoscaler.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,14 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
428428
// Check if there are any nodes that failed to register in Kubernetes
429429
// master.
430430
unregisteredNodes := a.clusterStateRegistry.GetUnregisteredNodes()
431-
if len(unregisteredNodes) > 0 {
431+
if float64(len(unregisteredNodes)) > float64(len(allNodes))*50.0/100.0 {
432+
klog.Warningf("%d unregistered nodes present - skipping deletion (only %d nodes discovered)", len(unregisteredNodes), len(allNodes))
433+
// clear the state so that the UnregisteredSince timestamp is reset
434+
a.clusterStateRegistry.ClearUnregisteredNodes()
435+
for _, n := range unregisteredNodes {
436+
klog.V(0).Infof("--> %v", n.Node.GetObjectMeta().GetName())
437+
}
438+
} else if len(unregisteredNodes) > 0 {
432439
klog.V(1).Infof("%d unregistered nodes present", len(unregisteredNodes))
433440
removedAny, err := a.removeOldUnregisteredNodes(unregisteredNodes, autoscalingContext,
434441
a.clusterStateRegistry, currentTime, autoscalingContext.LogRecorder)
@@ -439,6 +446,8 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
439446
if removedAny {
440447
klog.V(0).Infof("Some unregistered nodes were removed")
441448
}
449+
} else {
450+
klog.V(0).Infof("noop")
442451
}
443452

444453
if !a.clusterStateRegistry.IsClusterHealthy() {

0 commit comments

Comments
 (0)