Skip to content

Commit

Permalink
Add TopologySpreadConstraints to server pod (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilpianista authored Mar 13, 2024
1 parent 68cc819 commit 94c001e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ func ensureServerPod(ctx context.Context, cs kubernetes.Interface, svrImg, names
ImagePullPolicy: corev1.PullAlways,
},
},
TopologySpreadConstraints: []corev1.TopologySpreadConstraint{
{
MaxSkew: 1,
TopologyKey: "kubernetes.io/hostname",
WhenUnsatisfiable: "ScheduleAnyway",
LabelSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": constants.ServerName,
},
},
},
},
},
}, metav1.CreateOptions{})
if err != nil {
Expand Down

0 comments on commit 94c001e

Please sign in to comment.