-
Notifications
You must be signed in to change notification settings - Fork 7
/
worker.yml
38 lines (37 loc) · 1.1 KB
/
worker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ray-worker
labels:
app: ray-worker
spec:
replicas: 3
template:
metadata:
labels:
app: ray-worker
spec:
containers:
- name: ray-worker
image: gcr.io/tutorial-218804/kube-cluster-demo
ports:
- containerPort: 12345
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
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.default.svc.cluster.local\"));sys.stdout.flush()'):6379 --object-manager-port 12345;
mkdir /root/.ssh/;
touch /root/.ssh/authorized_keys;
sleep 3;
echo '<PASTE-PUBKEY-HERE-ONELINE>' >> ~/.ssh/authorized_keys;
service ssh restart;
sleep 3;
service ssh restart;
echo This worker IP $MY_POD_IP
&& while true; do sleep 30; done;"
#no