From 356c3cb6a81ef7ec124cdda591123b98c7bc7063 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 22 Feb 2022 11:47:14 -0300 Subject: [PATCH] [installer] Ensure ws-proxy is scheduled in different nodes --- .../installer/pkg/components/ws-proxy/deployment.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install/installer/pkg/components/ws-proxy/deployment.go b/install/installer/pkg/components/ws-proxy/deployment.go index 466de5a93b5b90..83b8b87384ae7b 100644 --- a/install/installer/pkg/components/ws-proxy/deployment.go +++ b/install/installer/pkg/components/ws-proxy/deployment.go @@ -83,8 +83,16 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) { }, }, Spec: corev1.PodSpec{ - PriorityClassName: common.SystemNodeCritical, - Affinity: common.Affinity(cluster.AffinityLabelWorkspaceServices), + PriorityClassName: common.SystemNodeCritical, + Affinity: common.Affinity(cluster.AffinityLabelWorkspaceServices), + TopologySpreadConstraints: []corev1.TopologySpreadConstraint{ + corev1.TopologySpreadConstraint{ + LabelSelector: &metav1.LabelSelector{MatchLabels: labels}, + MaxSkew: 1, + TopologyKey: "kubernetes.io/hostname", + WhenUnsatisfiable: corev1.DoNotSchedule, + }, + }, EnableServiceLinks: pointer.Bool(false), ServiceAccountName: Component, SecurityContext: &corev1.PodSecurityContext{