Skip to content

Commit

Permalink
built from CA v1.29.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lrouquette committed Sep 27, 2024
1 parent 043b0c1 commit 378511d
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 1 deletion.
102 changes: 102 additions & 0 deletions ADOBE_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# About

We maintain a set of patches on top of upstream K8s autoscaler. They need to be
semantically versioned as well so we understand, for example, that we're
upgrading a fix version of autoscaler vs. a fix version of our patches.

The scheme is quite simple. The product is first, followed by the upstream
version, followed by our version:

```
Product is cluster-autoscaler or vertical-pod-autoscaler or addon-resizer
K stands for K8s upstream version
A stands for Adobe's changes
{Product}-{K major}.{K minor}.{K fix}-{A major}.{A minor}.{A fix}-adobe
```

# Log

## cluster-autoscaler-1.29.4-1.6.0-adobe
- built from CA v1.29.4

## cluster-autoscaler-1.28.6-1.6.0-adobe
- built from CA v1.28.6

## cluster-autoscaler-1.27.7-1.6.0-adobe
- built from CA v1.27.7

## cluster-autoscaler-1.27.5-1.6.0-adobe
- built from CA v1.27.5

## cluster-autoscaler-1.26.4-1.6.0-adobe
- built from CA v1.26.4
- backport https://github.com/kubernetes/autoscaler/pull/5550

## cluster-autoscaler-1.25.2-1.6.0-adobe
- backport https://github.com/kubernetes/autoscaler/pull/5550

## cluster-autoscaler-1.25.2-1.5.0-adobe
- built from CA v1.25.2

## cluster-autoscaler-1.24.2-1.6.0-adobe
- backport https://github.com/kubernetes/autoscaler/pull/5550

## cluster-autoscaler-1.24.2-1.5.0-adobe
- built from CA v1.24.2

## cluster-autoscaler-1.24.1-1.5.0-adobe
- built from CA v1.24.1

## cluster-autoscaler-1.23.1-1.5.0-adobe
- skip deletion of unregistered nodes if there are more than 50% of discovered nodes

## cluster-autoscaler-1.23.1-1.4.0-adobe
- built from CA v1.23.1
- backport https://github.com/kubernetes/autoscaler/pull/4970
- remove code from 1.0.0-adobe and 1.2.0-adobe

## cluster-autoscaler-1.22.3-1.3.0-adobe
- built from CA v1.22.3
- backport https://github.com/kubernetes/autoscaler/pull/4970

## cluster-autoscaler-1.22.2-1.2.1-adobe
- built from CA v1.22.2

## cluster-autoscaler-1.21.2-1.2.1-adobe
- built from CA v1.21.2

## cluster-autoscaler-1.20.1-1.2.1-adobe
- also use `topology.kubernetes.io/zone` when evaluating topology spread constraints

## cluster-autoscaler-1.20.1-1.2.0-adobe
- improve scale out time when using topology spread constraints

## cluster-autoscaler-1.20.1-1.1.0-adobe
- upgraded ca

## cluster-autoscaler-1.20.0-1.1.0-adobe
- fix uneven scaling with topology contraints
- backport https://github.com/kubernetes/autoscaler/pull/3883

## cluster-autoscaler-1.20.0-1.0.0-adobe
- on scale-down, evict DaemonSet pods after all the other pods

# Procedure

```bash
# Assuming cluster-autoscaler-1.21-adobe is the latest "Adobe" release, built
# "on top" of of 1.21.0, and we want to upgrade to 1.21.2
git checkout cluster-autoscaler-1.21-adobe
# Reset to the upstream version we originally built on
git reset cluster-autoscaler-1.21.0
# Stash "Adobe" changes
git stash
# Get the latest stuff from upstream
git fetch upstream
# Update the branch to upstream 1.21.2
git merge -s recursive -X theirs cluster-autoscaler-1.21.2
# Apply "Adobe" changes, on top of 1.21.2
git stash pop
# Resolve conflicts if needed, then git add/git commit all the files (including this one)
```
8 changes: 8 additions & 0 deletions cluster-autoscaler/clusterstate/clusterstate_adobe.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package clusterstate

// ClearUnregisteredNodes clears the unregistered node cache
func (csr *ClusterStateRegistry) ClearUnregisteredNodes() {
csr.Lock()
defer csr.Unlock()
csr.unregisteredNodes = make(map[string]UnregisteredNode)
}
11 changes: 10 additions & 1 deletion cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,14 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
// Check if there are any nodes that failed to register in Kubernetes
// master.
unregisteredNodes := a.clusterStateRegistry.GetUnregisteredNodes()
if len(unregisteredNodes) > 0 {
if float64(len(unregisteredNodes)) > float64(len(allNodes))*50.0/100.0 {
klog.Warningf("%d unregistered nodes present - skipping deletion (only %d nodes discovered)", len(unregisteredNodes), len(allNodes))
// clear the state so that the UnregisteredSince timestamp is reset
a.clusterStateRegistry.ClearUnregisteredNodes()
for _, n := range unregisteredNodes {
klog.V(0).Infof("--> %v", n.Node.GetObjectMeta().GetName())
}
} else if len(unregisteredNodes) > 0 {
klog.V(1).Infof("%d unregistered nodes present", len(unregisteredNodes))
removedAny, err := a.removeOldUnregisteredNodes(unregisteredNodes, autoscalingContext,
a.clusterStateRegistry, currentTime, autoscalingContext.LogRecorder)
Expand All @@ -422,6 +429,8 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
if removedAny {
klog.V(0).Infof("Some unregistered nodes were removed")
}
} else {
klog.V(0).Infof("noop")
}

if !a.clusterStateRegistry.IsClusterHealthy() {
Expand Down

0 comments on commit 378511d

Please sign in to comment.