2019-01-30 17:50:37 -08:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
2019-01-14 05:56:47 +08:00
|
|
|
metadata:
|
2019-01-30 17:50:37 -08:00
|
|
|
name: ray-worker
|
2019-01-14 05:56:47 +08:00
|
|
|
spec:
|
|
|
|
replicas: 3
|
|
|
|
selector:
|
2019-01-30 17:50:37 -08:00
|
|
|
matchLabels:
|
|
|
|
component: ray-worker
|
2019-03-11 15:57:04 -04:00
|
|
|
type: ray
|
2019-01-14 05:56:47 +08:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
component: ray-worker
|
2019-03-11 15:57:04 -04:00
|
|
|
type: ray
|
2019-01-14 05:56:47 +08:00
|
|
|
spec:
|
2019-03-11 15:57:04 -04:00
|
|
|
affinity:
|
|
|
|
podAntiAffinity:
|
|
|
|
requiredDuringSchedulingIgnoreDuringExecution:
|
|
|
|
- labelSelector:
|
|
|
|
matchLabels:
|
|
|
|
type: ray
|
|
|
|
topologyKey: kubernetes.io/hostname
|
2019-01-14 05:56:47 +08:00
|
|
|
containers:
|
|
|
|
- name: ray-worker
|
|
|
|
image: rayproject/examples
|
|
|
|
command: ["/bin/bash", "-c", "--"]
|
2019-01-30 18:00:20 -08:00
|
|
|
args: ["ray start --node-ip-address=$MY_POD_IP --redis-address=$(python -c 'import socket;import sys; sys.stdout.write(socket.gethostbyname(\"ray-head\"));sys.stdout.flush()'):6379 --object-manager-port=12345 --node-manager-port=12346 --block"]
|
2019-01-14 05:56:47 +08:00
|
|
|
ports:
|
|
|
|
- containerPort: 12345
|
|
|
|
- containerPort: 12346
|
|
|
|
env:
|
|
|
|
- name: MY_POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
resources:
|
|
|
|
requests:
|
2019-01-30 17:50:37 -08:00
|
|
|
cpu: 2
|