Skip to content

Commit 94c001e

Browse files
authored
Add TopologySpreadConstraints to server pod (#27)
1 parent 68cc819 commit 94c001e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/client/utils.go

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ func ensureServerPod(ctx context.Context, cs kubernetes.Interface, svrImg, names
4848
ImagePullPolicy: corev1.PullAlways,
4949
},
5050
},
51+
TopologySpreadConstraints: []corev1.TopologySpreadConstraint{
52+
{
53+
MaxSkew: 1,
54+
TopologyKey: "kubernetes.io/hostname",
55+
WhenUnsatisfiable: "ScheduleAnyway",
56+
LabelSelector: &metav1.LabelSelector{
57+
MatchLabels: map[string]string{
58+
"app": constants.ServerName,
59+
},
60+
},
61+
},
62+
},
5163
},
5264
}, metav1.CreateOptions{})
5365
if err != nil {

0 commit comments

Comments
 (0)