From 151d316e29165f3a86e15ebdbd79f9263e5a7b43 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Thu, 11 Jul 2024 14:54:19 +0200 Subject: [PATCH] Mark krelay servers as safe to evict by the cluster autoscaler The kubernetes cluster autoscaler doesn't remove pods that are not backed by a controller object (so not created by deployment, replica set, job, stateful set etc), thus without this annotation, krelay is preventing it from removing a node --- cmd/client/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/client/utils.go b/cmd/client/utils.go index 55986b0..3675779 100644 --- a/cmd/client/utils.go +++ b/cmd/client/utils.go @@ -44,6 +44,9 @@ func createServerPod(ctx context.Context, cs kubernetes.Interface, svrImg, names "app.kubernetes.io/name": constants.ServerName, "app": constants.ServerName, }, + Annotations: map[string]string{ + "cluster-autoscaler.kubernetes.io/safe-to-evict": "true", + }, }, Spec: corev1.PodSpec{ AutomountServiceAccountToken: toPtr(false),