Skip to content

Commit aa1db7d

Browse files
author
Mengqi Yu
authored
make pod evaluator work with cluster autoscaler (#3191)
1 parent b635332 commit aa1db7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

porch/func/internal/podevaluator.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ func (pm *podManager) retrieveOrCreatePod(ctx context.Context, image string, ttl
488488
Namespace: pm.namespace,
489489
Annotations: map[string]string{
490490
reclaimAfterAnnotation: fmt.Sprintf("%v", time.Now().Add(ttl).Unix()),
491+
// Add the following annotation to make it work well with the cluster autoscaler.
492+
// https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node
493+
"cluster-autoscaler.kubernetes.io/safe-to-evict": "true",
491494
},
492495
// The function runner can use the label to retrieve the pod. Label is function name + part of its digest.
493496
// If a function has more than one tags pointing to the same digest, we can reuse the same pod.

0 commit comments

Comments
 (0)