@@ -65,7 +65,7 @@ http://{{ include "aztec-network.fullname" . }}-pxe.{{ .Release.Namespace }}:{{
65
65
{ {- end -} }
66
66
67
67
{ {- define " aztec-network.bootNodeUrl" -} }
68
- http://{ { include " aztec-network.fullname" . } }-boot-node-0. { { include " aztec-network.fullname " . } }-boot-node .{ { .Release.Namespace } }.svc.cluster.local:{ { .Values.bootNode.service.nodePort } }
68
+ http://{ { include " aztec-network.fullname" . } }-boot-node.{ { .Release.Namespace } }.svc.cluster.local:{ { .Values.bootNode.service.nodePort } }
69
69
{ {- end -} }
70
70
71
71
{ {- define " aztec-network.validatorUrl" -} }
@@ -94,34 +94,6 @@ http://{{ include "aztec-network.fullname" . }}-metrics.{{ .Release.Namespace }}
94
94
{ {- end -} }
95
95
{ {- end -} }
96
96
97
- { {/*
98
- P2P Setup Container
99
- */} }
100
- { {- define " aztec-network.p2pSetupContainer" -} }
101
- - name: setup-p2p-addresses
102
- image: bitnami/kubectl
103
- command:
104
- - /bin/sh
105
- - -c
106
- - |
107
- cp /scripts/setup-p2p-addresses.sh /tmp/setup-p2p-addresses.sh && \
108
- chmod +x /tmp/setup-p2p-addresses.sh && \
109
- /tmp/setup-p2p-addresses.sh
110
- env:
111
- - name: NETWORK_PUBLIC
112
- value: "{ { .Values.network.public } }"
113
- - name: NAMESPACE
114
- value: { { .Release.Namespace } }
115
- - name: P2P_TCP_PORT
116
- value: "{ { .Values.validator.service.p2pTcpPort } }"
117
- - name: P2P_UDP_PORT
118
- value: "{ { .Values.validator.service.p2pUdpPort } }"
119
- volumeMounts:
120
- - name: scripts
121
- mountPath: /scripts
122
- - name: p2p-addresses
123
- mountPath: /shared/p2p
124
- { {- end -} }
125
97
126
98
{ {/*
127
99
Service Address Setup Container
@@ -133,9 +105,7 @@ Service Address Setup Container
133
105
- /bin/bash
134
106
- -c
135
107
- |
136
- cp /scripts/setup-service-addresses.sh /tmp/setup-service-addresses.sh && \
137
- chmod +x /tmp/setup-service-addresses.sh && \
138
- /tmp/setup-service-addresses.sh
108
+ /scripts/setup-service-addresses.sh
139
109
env:
140
110
- name: NETWORK_PUBLIC
141
111
value: "{ { .Values.network.public } }"
@@ -189,9 +159,7 @@ Sets up the OpenTelemetry resource attributes for a service
189
159
- /bin/bash
190
160
- -c
191
161
- |
192
- cp /scripts/setup-otel-resource.sh /tmp/setup-otel-resource.sh && \
193
- chmod +x /tmp/setup-otel-resource.sh && \
194
- /tmp/setup-otel-resource.sh
162
+ /scripts/setup-otel-resource.sh
195
163
env:
196
164
- name: POD_IP
197
165
valueFrom:
@@ -263,3 +231,142 @@ while true; do
263
231
sleep 5
264
232
done
265
233
{ {- end -} }
234
+
235
+ { {/*
236
+ Combined wait-for-services and configure-env container for full nodes
237
+ */} }
238
+ { {- define " aztec-network.combinedWaitAndConfigureContainer" -} }
239
+ - name: wait-and-configure
240
+ { {- include " aztec-network.image" . | nindent 2 } }
241
+ command:
242
+ - /bin/bash
243
+ - -c
244
+ - |
245
+ # If we already have a registry address, and the bootstrap nodes are set, then we don't need to wait for the services
246
+ if [ -n "{ { .Values.aztec.contracts.registryAddress } }" ] && [ -n "{ { .Values.aztec.bootstrapENRs } }" ]; then
247
+ echo "Registry address and bootstrap nodes already set, skipping wait for services"
248
+ echo "{ { include " aztec-network.pxeUrl" . } }" > /shared/pxe/pxe_url
249
+ else
250
+ source /shared/config/service-addresses
251
+ cat /shared/config/service-addresses
252
+ { {- include " aztec-network.waitForEthereum" . | nindent 8 } }
253
+
254
+ if [ "{ { .Values.validator.dynamicBootNode } }" = "true" ]; then
255
+ echo "{ { include " aztec-network.pxeUrl" . } }" > /shared/pxe/pxe_url
256
+ else
257
+ until curl --silent --head --fail "${ BOOT_NODE_HOST} /status" > /dev/null; do
258
+ echo "Waiting for boot node..."
259
+ sleep 5
260
+ done
261
+ echo "Boot node is ready!"
262
+ echo "${ BOOT_NODE_HOST} " > /shared/pxe/pxe_url
263
+ fi
264
+ fi
265
+
266
+ # Configure environment
267
+ source /shared/config/service-addresses
268
+ /scripts/configure-full-node-env.sh "$(cat /shared/pxe/pxe_url)"
269
+ volumeMounts:
270
+ - name: pxe-url
271
+ mountPath: /shared/pxe
272
+ - name: scripts
273
+ mountPath: /scripts
274
+ - name: config
275
+ mountPath: /shared/config
276
+ - name: contracts-env
277
+ mountPath: /shared/contracts
278
+ env:
279
+ - name: P2P_ENABLED
280
+ value: "{ { .Values.fullNode.p2p.enabled } }"
281
+ - name: BOOTSTRAP_NODES
282
+ value: "{ { .Values.aztec.bootstrapENRs } }"
283
+ - name: REGISTRY_CONTRACT_ADDRESS
284
+ value: "{ { .Values.aztec.contracts.registryAddress } }"
285
+ - name: SLASH_FACTORY_CONTRACT_ADDRESS
286
+ value: "{ { .Values.aztec.contracts.slashFactoryAddress } }"
287
+ { {- end -} }
288
+
289
+ { {/*
290
+ Combined P2P, Service Address, and OpenTelemetry Setup Container
291
+ */} }
292
+ { {- define " aztec-network.combinedAllSetupContainer" -} }
293
+ { {- $serviceName := base $.Template.Name | trimSuffix " .yaml" -} }
294
+ - name: setup-all
295
+ { {- include " aztec-network.image" . | nindent 2 } }
296
+ command:
297
+ - /bin/bash
298
+ - -c
299
+ - |
300
+ # Setup P2P addresses
301
+ /scripts/setup-p2p-addresses.sh
302
+
303
+ # Setup service addresses
304
+ /scripts/setup-service-addresses.sh
305
+
306
+ # Setup OpenTelemetry resource
307
+ /scripts/setup-otel-resource.sh
308
+ env:
309
+ - name: NETWORK_PUBLIC
310
+ value: "{ { .Values.network.public } }"
311
+ - name: NAMESPACE
312
+ value: { { .Release.Namespace } }
313
+ - name: P2P_TCP_PORT
314
+ value: "{ { .Values.validator.service.p2pTcpPort } }"
315
+ - name: P2P_UDP_PORT
316
+ value: "{ { .Values.validator.service.p2pUdpPort } }"
317
+ - name: TELEMETRY
318
+ value: "{ { .Values.telemetry.enabled } }"
319
+ - name: OTEL_COLLECTOR_ENDPOINT
320
+ value: "{ { .Values.telemetry.otelCollectorEndpoint } }"
321
+ - name: EXTERNAL_ETHEREUM_HOSTS
322
+ value: "{ { .Values.ethereum.execution.externalHosts } }"
323
+ - name: ETHEREUM_PORT
324
+ value: "{ { .Values.ethereum.execution.service.port } }"
325
+ - name: EXTERNAL_ETHEREUM_CONSENSUS_HOST
326
+ value: "{ { .Values.ethereum.beacon.externalHost } }"
327
+ - name: EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY
328
+ value: "{ { .Values.ethereum.beacon.apiKey } }"
329
+ - name: EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER
330
+ value: "{ { .Values.ethereum.beacon.apiKeyHeader } }"
331
+ - name: ETHEREUM_CONSENSUS_PORT
332
+ value: "{ { .Values.ethereum.beacon.service.port } }"
333
+ - name: EXTERNAL_BOOT_NODE_HOST
334
+ value: "{ { .Values.bootNode.externalHost } }"
335
+ - name: BOOT_NODE_PORT
336
+ value: "{ { .Values.bootNode.service.nodePort } }"
337
+ - name: EXTERNAL_PROVER_NODE_HOST
338
+ value: "{ { .Values.proverNode.externalHost } }"
339
+ - name: PROVER_NODE_PORT
340
+ value: "{ { .Values.proverNode.service.nodePort } }"
341
+ - name: PROVER_BROKER_PORT
342
+ value: "{ { .Values.proverBroker.service.nodePort } }"
343
+ - name: USE_GCLOUD_LOGGING
344
+ value: "{ { .Values.telemetry.useGcloudLogging } }"
345
+ - name: SERVICE_NAME
346
+ value: { { include " aztec-network.fullname" . } }
347
+ - name: POD_IP
348
+ valueFrom:
349
+ fieldRef:
350
+ fieldPath: status.podIP
351
+ - name: K8S_POD_UID
352
+ valueFrom:
353
+ fieldRef:
354
+ fieldPath: metadata.uid
355
+ - name: K8S_POD_NAME
356
+ valueFrom:
357
+ fieldRef:
358
+ fieldPath: metadata.name
359
+ - name: K8S_NAMESPACE_NAME
360
+ valueFrom:
361
+ fieldRef:
362
+ fieldPath: metadata.namespace
363
+ - name: OTEL_SERVICE_NAME
364
+ value: "{ { $serviceName } }"
365
+ - name: OTEL_RESOURCE_ATTRIBUTES
366
+ value: 'service.namespace={ { .Release.Namespace } },environment={ { .Values.environment | default " production" } }'
367
+ volumeMounts:
368
+ - name: scripts
369
+ mountPath: /scripts
370
+ - name: config
371
+ mountPath: /shared/config
372
+ { {- end -} }
0 commit comments