diff --git a/component/main.jsonnet b/component/main.jsonnet index 09dae60..7e64e21 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -69,7 +69,11 @@ local canary = kube._Object('monitoring.appuio.io/v1beta1', 'SchedulerCanary', ' interval: sliConfig.podStartInterval, maxPodCompletionTimeout: sliConfig.overallPodTimeout, podTemplate: { - metadata: {}, + metadata: { + annotations: { + 'cluster-autoscaler.kubernetes.io/safe-to-evict': 'true', + }, + }, spec: { affinity: { nodeAffinity: params.canary_node_affinity, @@ -129,7 +133,11 @@ local storageCanaries = std.flattenArrays(std.filterMap( maxPodCompletionTimeout: p.maxPodCompletionTimeout, forbidParallelRuns: true, podTemplate: { - metadata: {}, + metadata: { + annotations: { + 'cluster-autoscaler.kubernetes.io/safe-to-evict': 'true', + }, + }, spec: { affinity: { nodeAffinity: params.canary_node_affinity, diff --git a/tests/golden/defaults/openshift4-slos/openshift4-slos/30_canary.yaml b/tests/golden/defaults/openshift4-slos/openshift4-slos/30_canary.yaml index aff5a46..bea8bd0 100644 --- a/tests/golden/defaults/openshift4-slos/openshift4-slos/30_canary.yaml +++ b/tests/golden/defaults/openshift4-slos/openshift4-slos/30_canary.yaml @@ -10,7 +10,9 @@ spec: interval: 1m maxPodCompletionTimeout: 3m podTemplate: - metadata: {} + metadata: + annotations: + cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' spec: affinity: nodeAffinity: diff --git a/tests/golden/defaults/openshift4-slos/openshift4-slos/32_storageCanary.yaml b/tests/golden/defaults/openshift4-slos/openshift4-slos/32_storageCanary.yaml index ed6be70..4f1f3cb 100644 --- a/tests/golden/defaults/openshift4-slos/openshift4-slos/32_storageCanary.yaml +++ b/tests/golden/defaults/openshift4-slos/openshift4-slos/32_storageCanary.yaml @@ -26,7 +26,9 @@ spec: interval: 1m maxPodCompletionTimeout: 3m podTemplate: - metadata: {} + metadata: + annotations: + cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' spec: affinity: nodeAffinity: @@ -93,7 +95,9 @@ spec: interval: 1m maxPodCompletionTimeout: 3m podTemplate: - metadata: {} + metadata: + annotations: + cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' spec: affinity: nodeAffinity: @@ -160,7 +164,9 @@ spec: interval: 1m maxPodCompletionTimeout: 3m podTemplate: - metadata: {} + metadata: + annotations: + cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' spec: affinity: nodeAffinity: