mirror of
https://github.com/vale981/ray
synced 2025-03-06 18:41:40 -05:00
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ray-worker
|
|
spec:
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
component: ray-worker
|
|
type: ray
|
|
template:
|
|
metadata:
|
|
labels:
|
|
component: ray-worker
|
|
type: ray
|
|
spec:
|
|
affinity:
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchLabels:
|
|
type: ray
|
|
topologyKey: kubernetes.io/hostname
|
|
containers:
|
|
- name: ray-worker
|
|
image: rayproject/examples
|
|
command: ["/bin/bash", "-c", "--"]
|
|
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"]
|
|
ports:
|
|
- containerPort: 12345
|
|
- containerPort: 12346
|
|
env:
|
|
- name: MY_POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
resources:
|
|
requests:
|
|
cpu: 2
|