-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode-worker.yaml
185 lines (183 loc) · 4.99 KB
/
node-worker.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
global:
fullnameOverride: index-provider
# podAnnotations:
# index-provider-staging-tag: dev-latest
securityContext:
fsGroup: 0
fsGroupChangePolicy: Always
runAsGroup: 0
runAsUser: 0
serviceAccount:
create: true
name: node
statefulset:
- containers:
- command:
- /app/upshot-node
- '--role=head'
- '--peer-db=$(APP_HOME)/peer-database'
- '--function-db=$(APP_HOME)/function-database'
- '--workspace=/tmp/node'
- '--private-key=$(APP_HOME)/keys/priv.bin'
- '--log-level=debug'
- '--port=9010'
- '--rest-api=:6000'
env:
- name: APP_HOME
value: /data
image:
repository: >-
696230526504.dkr.ecr.us-east-1.amazonaws.com/index-provider-staging
tag: c088be034e6c4530b969c6b9637595ab5f44f544
livenessProbe:
tcpSocket:
port: 6000
name: head
ports:
- name: api
port: 6000
protocol: TCP
type: ClusterIP
- name: p2p
port: 9010
protocol: TCP
type: ClusterIP
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 256m
memory: 512Mi
startupProbe:
failureThreshold: 6
periodSeconds: 10
tcpSocket:
port: 6000
workingDir: /data
initContainers:
- command:
- /bin/sh
- '-c'
- |
KEYS_PATH="${APP_HOME}/keys"
if [ -d "$KEYS_PATH" ]; then
echo "Keys exist"
else
echo "Generating New Node Identity"
mkdir -p ${APP_HOME}/keys
cd $KEYS_PATH
/app/upshot-keys
fi
env:
- name: APP_HOME
value: /data
image: >-
696230526504.dkr.ecr.us-east-1.amazonaws.com/index-provider-staging:c088be034e6c4530b969c6b9637595ab5f44f544
name: init-keys
securityContext:
runAsUser: 1001
volumeMounts:
- mountPath: /data
name: heads-data
workingDir: /data
name: heads
persistence:
size: 1Gi
storageClassName: gp2
volumeMountPath: /data
replicas: 1
- containers:
- command:
- /app/upshot-node
- '--role=worker'
- '--peer-db=$(APP_HOME)/peer-database'
- '--function-db=$(APP_HOME)/function-database'
- '--runtime-path=/app/runtime'
- '--runtime-cli=bls-runtime'
- '--workspace=/tmp/node'
- '--private-key=$(APP_HOME)/keys/priv.bin'
- '--log-level=debug'
- '--port=9010'
- >-
--boot-nodes="/dns4/heads-0.heads/tcp/9010/p2p/12D3KooW9y4DMebnd4KfUfaAkE78PkAo6sEuyYi6cLSLdtu1tc5a"
env:
- name: APP_HOME
value: /data
- name: UPSHOT_API_TOKEN
valueFrom:
secretKeyRef:
key: UPSHOT_API_TOKEN
name: upshot-api-token
image:
repository: >-
696230526504.dkr.ecr.us-east-1.amazonaws.com/index-provider-staging
tag: c088be034e6c4530b969c6b9637595ab5f44f544
livenessProbe:
tcpSocket:
port: 9010
name: worker
ports:
- name: p2p
port: 9010
protocol: TCP
type: ClusterIP
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 256m
memory: 512Mi
startupProbe:
failureThreshold: 6
periodSeconds: 10
tcpSocket:
port: 9010
workingDir: /data
initContainers:
- command:
- /bin/sh
- '-c'
- |
KEYS_PATH="${APP_HOME}/keys"
if [ -d "$KEYS_PATH" ]; then
echo "Keys exist"
else
echo "Generating New Node Identity"
mkdir -p ${APP_HOME}/keys
cd $KEYS_PATH
/app/upshot-keys
fi
env:
- name: APP_HOME
value: /data
image: >-
696230526504.dkr.ecr.us-east-1.amazonaws.com/index-provider-staging:c088be034e6c4530b969c6b9637595ab5f44f544
name: init-keys
securityContext:
runAsUser: 1001
volumeMounts:
- mountPath: /data
name: workers-data
workingDir: /data
- command:
- /bin/sh
- '-c'
- |
set -ex
apk add netcat-openbsd
while ! nc -z heads-0.heads 9010 </dev/null; do
echo "Waiting bootstrap node is up."
sleep 10;
done
image: 'alpine:latest'
name: wait-bootstrup-node
securityContext:
runAsUser: 0
name: workers
persistence:
size: 1Gi
storageClassName: gp2
volumeMountPath: /data
replicas: 1