forked from mobilecoinfoundation/mobilecoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03-node3.yaml
286 lines (278 loc) · 9.38 KB
/
03-node3.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
apiVersion: v1
kind: ConfigMap
metadata:
name: supervisor-ledger-dist-node3
namespace: NETWORKNAME
data:
ledger_dist.conf: |
[program:ledger-distribution]
command=/usr/bin/ledger-distribution
--dest s3://mobilecoin.chain/node3.NETWORKNAME.mobilecoin.com
--ledger-path /ledger
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
autorestart=true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: supervisor-admin-http-gw-node3
namespace: NETWORKNAME
data:
admin_http_gw.conf: |
[program:mc-admin-http-gateway]
command=/usr/bin/mc-admin-http-gateway
--listen-host 0.0.0.0
--listen-port 8000
--admin-uri insecure-mca://127.0.0.1:8001/
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
autorestart=true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: supervisor-consensus-node3
namespace: NETWORKNAME
data:
consensus-service-node.conf: |
[program:consensus-service]
command=/usr/bin/consensus-service
--client-responder-id node3.NETWORKNAME.mobilecoin.com:443
--peer-responder-id peer3.NETWORKNAME.mobilecoin.com:443
--peer-listen-uri=mcp://0.0.0.0:8443/?tls-chain=/certs/tls.crt&tls-key=/certs/tls.key
--client-listen-uri=mc://0.0.0.0:3223/?tls-chain=/certs/tls.crt&tls-key=/certs/tls.key
--admin-listen-uri=insecure-mca://127.0.0.1:8001/
--network /config/network.toml
--ledger-path /ledger
--ias-spid %(ENV_PROD_IAS_SPID)s
--ias-api-key %(ENV_PROD_IAS_API_KEY)s
--msg-signer-key %(ENV_NODE3_SIGNER_KEY)s
--sealed-block-signing-key %(ENV_SEALED_BLOCK_SIGNING_KEY)s
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
autorestart=true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-consensus-node3
namespace: NETWORKNAME
data:
network.toml: |
broadcast_peers = [
"mcp://peer1.NETWORKNAME.mobilecoin.com:443/?consensus-msg-key=MCowBQYDK2VwAyEAg1iGuFv37uEFrn71kn31TE38TC-ma_Fb4wX239H0c8M=",
"mcp://peer2.NETWORKNAME.mobilecoin.com:443/?consensus-msg-key=MCowBQYDK2VwAyEA7i8HyecUp-0lcw5c8yP3BNP_R6JRlpXoxjJD-gWcqUE=",
"mcp://peer4.NETWORKNAME.mobilecoin.com:443/?consensus-msg-key=MCowBQYDK2VwAyEAYYmxZMX2B4kkhfPap8NrV4JMp_s6j06oxwlMD0DAiC8=",
"mcp://peer5.NETWORKNAME.mobilecoin.com:443/?consensus-msg-key=MCowBQYDK2VwAyEA0XQ0Hy_nKTlPyxD7LYBEWVoayf_JfUsIaYy7olOZhNM=",
]
tx_source_urls = [
"https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node1.NETWORKNAME.mobilecoin.com/",
"https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node2.NETWORKNAME.mobilecoin.com/",
"https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node4.NETWORKNAME.mobilecoin.com/",
"https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node5.NETWORKNAME.mobilecoin.com/",
]
quorum_set = { threshold = 3, members = [
{ type = "Node", args = "peer1.NETWORKNAME.mobilecoin.com:443" },
{ type = "Node", args = "peer2.NETWORKNAME.mobilecoin.com:443" },
{ type = "Node", args = "peer4.NETWORKNAME.mobilecoin.com:443" },
{ type = "Node", args = "peer5.NETWORKNAME.mobilecoin.com:443" },
] }
---
# node3
apiVersion: apps/v1
kind: Deployment
metadata:
name: node3
namespace: NETWORKNAME
labels:
app: mobilenode-NETWORKNAME
nodename: node3
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: mobilenode-NETWORKNAME
nodename: node3
template:
metadata:
labels:
app: mobilenode-NETWORKNAME
nodename: node3
spec:
# Need better node-selector semantics. This depends on agentpool naming
nodeSelector:
builder-node: "false"
sgx-enabled-node: "true"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- mobilenode-NETWORKNAME
topologyKey: "kubernetes.io/hostname"
imagePullSecrets:
- name: docker-credentials
initContainers:
- name: install-ledger-data
image: mobilecoin/node_hw:DOCKER_TAG
imagePullPolicy: IfNotPresent
command: [ "/bin/bash" ]
args:
- -c
- |
set -x
rm -rf /ledger/*
cp -r /var/lib/mobilecoin/origin_data/data.mdb /ledger
volumeMounts:
- name: ledger-db-dir
mountPath: /ledger
containers:
- name: node
image: mobilecoin/node_hw:DOCKER_TAG
imagePullPolicy: IfNotPresent
# Override entrypoint for this container
command: [ "/usr/bin/supervisord" ]
ports:
- name: cns-client
containerPort: 3223
- name: cns-port
containerPort: 8443
- name: cns-mgmt
containerPort: 8000
livenessProbe:
exec:
command:
- /bin/grpc_health_probe
- -tls
- -tls-ca-cert
- /certs/ca.crt
- -tls-server-name
- node3.NETWORKNAME.mobilecoin.com
- -addr=:8443
failureThreshold: 3
periodSeconds: 30
readinessProbe:
exec:
command:
- /bin/grpc_health_probe
- -tls
- -tls-ca-cert
- /certs/ca.crt
- -tls-server-name
- node3.NETWORKNAME.mobilecoin.com
- -addr=:8443
# This will need to be updated as initial sync and startup times increase.
failureThreshold: 30
periodSeconds: 30
env:
# Contents of /opt/intel/sgxsdk/environment and AESM requirements
- name: "PATH"
value: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/intel/sgxsdk/bin:/opt/intel/sgxsdk/bin/x64"
# Rust env settings
- name: "RUST_BACKTRACE"
value: "1"
- name: "RUST_LOG"
value: "debug,rustls=warn,hyper=warn,tokio_reactor=warn,mio=warn,want=warn,reqwest=warn,rusoto_core=error,rusoto_signature=error,h2=error,rocket=warn,<unknown>=warn"
- name: "SGX_MODE"
value: "HW"
- name: "IAS_MODE"
value: "DEV"
- name: LOCAL_NODE_ID
value: "peer3.NETWORKNAME.mobilecoin.com:443"
- name: MC_LOG_UDP_JSON
value: "127.0.0.1:16666"
- name: MC_LOG_EXTRA_CONTEXT
value: "mc.local_node_id=$(LOCAL_NODE_ID)"
- name: MC_BRANCH
value: "NETWORKNAME"
- name: AWS_PATH
value: "AWS_PATH=s3://mobilecoin.chain/node3.NETWORKNAME.mobilecoin.com"
- name: AWS_REGION
value: "us-west-1"
- name: PROD_IAS_SPID
valueFrom:
secretKeyRef:
name: prod-ias-keys
key: spid
- name: PROD_IAS_API_KEY
valueFrom:
secretKeyRef:
name: prod-ias-keys
key: primary-key
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: aws-creds-env
key: aws-access-key-id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: aws-creds-env
key: aws-secret-access-key
- name: NODE3_SIGNER_KEY
valueFrom:
secretKeyRef:
name: node-signer-keys
key: node3
- name: "SEALED_BLOCK_SIGNING_KEY"
value: "/keys/sealed-block-signing-key"
volumeMounts:
- name: aesm-socket-dir
mountPath: /var/run/aesmd
- name: config-dir
mountPath: /config
- name: ledger-db-dir
mountPath: /ledger
- name: keys-dir
mountPath: /keys
- name: node-cert
mountPath: /certs
readOnly: true
- name: supervisor-conf
mountPath: /etc/supervisor/conf.d
readOnly: true
resources:
limits:
intel.com/sgx: 5000
requests:
intel.com/sgx: 5000
volumes:
- name: ledger-db-dir
emptyDir: {}
- name: config-dir
configMap:
name: config-consensus-node3
- name: keys-dir
emptyDir: {}
- name: aesm-socket-dir
emptyDir: {}
- name: node-cert
secret:
secretName: node3-peer-tls
- name: supervisor-conf
projected:
sources:
- configMap:
name: supervisor-daemon-config
- configMap:
name: supervisor-sgx-config
- configMap:
name: supervisor-consensus-node3
- configMap:
name: supervisor-ledger-dist-node3
- configMap:
name: supervisor-admin-http-gw-node3