diff --git a/kubernetes/head.yaml b/kubernetes/head.yaml index f347ec0e8..fdbe117c9 100644 --- a/kubernetes/head.yaml +++ b/kubernetes/head.yaml @@ -31,11 +31,20 @@ spec: selector: matchLabels: component: ray-head + type: ray template: metadata: labels: component: ray-head + type: ray spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoreDuringExecution: + - labelSelector: + matchLabels: + type: ray + topologyKey: kubernetes.io/hostname containers: - name: ray-head image: rayproject/examples diff --git a/kubernetes/submit.yaml b/kubernetes/submit.yaml index e0ed3446b..78470591c 100644 --- a/kubernetes/submit.yaml +++ b/kubernetes/submit.yaml @@ -31,11 +31,20 @@ spec: selector: matchLabels: component: ray-head + type: ray template: metadata: labels: component: ray-head + type: ray spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoreDuringExecution: + - labelSelector: + matchLabels: + type: ray + topologyKey: kubernetes.io/hostname containers: - name: ray-head image: rayproject/examples @@ -68,11 +77,20 @@ spec: selector: matchLabels: component: ray-worker + type: ray template: metadata: labels: component: ray-worker + type: ray spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoreDuringExecution: + - labelSelector: + matchLabels: + type: ray + topologyKey: kubernetes.io/hostname containers: - name: ray-worker image: rayproject/examples diff --git a/kubernetes/worker.yaml b/kubernetes/worker.yaml index 09035a9e3..12a21aed4 100644 --- a/kubernetes/worker.yaml +++ b/kubernetes/worker.yaml @@ -7,11 +7,20 @@ spec: selector: matchLabels: component: ray-worker + type: ray template: metadata: labels: component: ray-worker + type: ray spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoreDuringExecution: + - labelSelector: + matchLabels: + type: ray + topologyKey: kubernetes.io/hostname containers: - name: ray-worker image: rayproject/examples