diff --git a/connectivity/check/deployment.go b/connectivity/check/deployment.go index fd20297e5f..6f8f69ba0f 100644 --- a/connectivity/check/deployment.go +++ b/connectivity/check/deployment.go @@ -261,6 +261,20 @@ func (ct *ConnectivityTest) deploy(ctx context.Context) error { Image: defaults.ConnectivityCheckAlpineCurlImage, Command: []string{"/bin/ash", "-c", "sleep 10000000"}, Labels: map[string]string{"other": "client"}, + Affinity: &corev1.Affinity{ + PodAffinity: &corev1.PodAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{ + { + LabelSelector: &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{ + {Key: "name", Operator: metav1.LabelSelectorOpIn, Values: []string{ClientDeploymentName}}, + }, + }, + TopologyKey: "kubernetes.io/hostname", + }, + }, + }, + }, }) _, err = ct.clients.src.CreateDeployment(ctx, ct.params.TestNamespace, clientDeployment, metav1.CreateOptions{}) if err != nil {