Skip to content

Commit

Permalink
Merge pull request #3351 from towca/jtuznik/upcoming-annotation
Browse files Browse the repository at this point in the history
Add an annotation identifying upcoming nodes
  • Loading branch information
k8s-ci-robot authored Jul 24, 2020
2 parents 48fbe6a + 3958c66 commit 774390e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const (
unschedulablePodWithGpuTimeBuffer = 30 * time.Second
// How long should Cluster Autoscaler wait for nodes to become ready after start.
nodesNotReadyAfterStartTimeout = 10 * time.Minute

// NodeUpcomingAnnotation is an annotation CA adds to nodes which are upcoming.
NodeUpcomingAnnotation = "cluster-autoscaler.k8s.io/upcoming-node"
)

// StaticAutoscaler is an autoscaler which has all the core functionality of a CA but without the reconfiguration feature
Expand Down Expand Up @@ -795,6 +798,12 @@ func getUpcomingNodeInfos(registry *clusterstate.ClusterStateRegistry, nodeInfos
klog.Warningf("Couldn't find template for node group %s", nodeGroup)
continue
}

if nodeTemplate.Node().Annotations == nil {
nodeTemplate.Node().Annotations = make(map[string]string)
}
nodeTemplate.Node().Annotations[NodeUpcomingAnnotation] = "true"

for i := 0; i < numberOfNodes; i++ {
// Ensure new nodes have different names because nodeName
// will be used as a map key. Also deep copy pods (daemonsets &
Expand Down

0 comments on commit 774390e

Please sign in to comment.