forked from caicloud/tensorflow-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s_tf.yaml
169 lines (168 loc) · 3.16 KB
/
k8s_tf.yaml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
apiVersion: v1
kind: ReplicationController
metadata:
name: tf-worker1
spec:
replicas: 1
template:
metadata:
labels:
tf-worker: "0"
spec:
containers:
- name: tf-worker1
image: index.caicloud.io/tf_grpc_test_server
args:
- --cluster_spec=worker|tf-worker1:2222;tf-worker3:2222;tf-worker5:2222,ps|tf-ps2:2222;tf-ps4:2222
- --job_name=worker
- --task_id=0
ports:
- containerPort: 2222
---
apiVersion: v1
kind: Service
metadata:
name: tf-worker1
labels:
tf-worker: "0"
spec:
type: LoadBalancer
ports:
- port: 2222
selector:
tf-worker: "0"
---
apiVersion: v1
kind: ReplicationController
metadata:
name: tf-worker3
spec:
replicas: 1
template:
metadata:
labels:
tf-worker: "1"
spec:
containers:
- name: tf-worker3
image: index.caicloud.io/caicloud/tf_grpc_test_server
args:
- --cluster_spec=worker|tf-worker1:2222;tf-worker3:2222;tf-worker5:2222,ps|tf-ps2:2222;tf-ps4:2222
- --job_name=worker
- --task_id=1
ports:
- containerPort: 2222
---
apiVersion: v1
kind: Service
metadata:
type: LoadBalancer
name: tf-worker3
labels:
tf-worker: "1"
spec:
ports:
- port: 2222
selector:
tf-worker: "1"
---
apiVersion: v1
kind: ReplicationController
metadata:
name: tf-worker5
spec:
replicas: 1
template:
metadata:
labels:
tf-worker: "2"
spec:
containers:
- name: tf-worker5
image: index.caicloud.io/caicloud/tf_grpc_test_server
args:
- --cluster_spec=worker|tf-worker1:2222;tf-worker3:2222;tf-worker5:2222,ps|tf-ps2:2222;tf-ps4:2222
- --job_name=worker
- --task_id=2
ports:
- containerPort: 2222
---
apiVersion: v1
kind: Service
metadata:
type: LoadBalancer
name: tf-worker5
labels:
tf-worker: "2"
spec:
ports:
- port: 2222
selector:
tf-worker: "2"
---
apiVersion: v1
kind: ReplicationController
metadata:
name: tf-ps2
spec:
replicas: 1
template:
metadata:
labels:
tf-ps: "0"
spec:
containers:
- name: tf-ps2
image: index.caicloud.io/caicloud/tf_grpc_test_server
args:
- --cluster_spec=worker|tf-worker1:2222;tf-worker3:2222;tf-worker5:2222,ps|tf-ps2:2222;tf-ps4:2222
- --job_name=ps
- --task_id=0
ports:
- containerPort: 2222
---
apiVersion: v1
kind: Service
metadata:
name: tf-ps2
labels:
tf-ps: "0"
spec:
ports:
- port: 2222
selector:
tf-ps: "0"
---
apiVersion: v1
kind: ReplicationController
metadata:
name: tf-ps4
spec:
replicas: 1
template:
metadata:
labels:
tf-ps: "1"
spec:
containers:
- name: tf-ps4
image: index.caicloud.io/caicloud/tf_grpc_test_server
args:
- --cluster_spec=worker|tf-worker1:2222;tf-worker3:2222;tf-worker5:2222,ps|tf-ps2:2222;tf-ps4:2222
- --job_name=ps
- --task_id=1
ports:
- containerPort: 2222
---
apiVersion: v1
kind: Service
metadata:
name: tf-ps4
labels:
tf-ps: "1"
spec:
ports:
- port: 2222
selector:
tf-ps: "1"
---