From 66c2fd4da21dd2905bad7ef473213b0e427b3301 Mon Sep 17 00:00:00 2001 From: Benjamin Arntzen Date: Wed, 6 Mar 2024 13:55:57 +0000 Subject: [PATCH] Updates for bootstrap-midstrap separation from node service --- accelerated_deployment/bootstrap.yaml | 9 +++++---- accelerated_deployment/docker/getenr.sh | 4 ++-- accelerated_deployment/midstrap.yaml | 15 ++++++++------- accelerated_deployment/nodes.yaml | 4 ++-- accelerated_deployment/publisher.yaml | 2 +- accelerated_deployment/service-bootstrap.yaml | 9 +++++++++ accelerated_deployment/service.yaml | 9 +++++++++ 7 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 accelerated_deployment/service-bootstrap.yaml create mode 100644 accelerated_deployment/service.yaml diff --git a/accelerated_deployment/bootstrap.yaml b/accelerated_deployment/bootstrap.yaml index 08bb4d2..abb6ea9 100644 --- a/accelerated_deployment/bootstrap.yaml +++ b/accelerated_deployment/bootstrap.yaml @@ -6,14 +6,14 @@ metadata: spec: replicas: 3 podManagementPolicy: "Parallel" - serviceName: zerotesting-service + serviceName: zerotesting-bootstrap selector: matchLabels: - app: zerotenkay + app: zerotenkay-bootstrap template: metadata: labels: - app: zerotenkay + app: zerotenkay-bootstrap spec: tolerations: - key: "zerotesting" @@ -30,7 +30,7 @@ spec: - key: app operator: In values: - - zerotenkay + - zerotenkay-bootstrap topologyKey: "kubernetes.io/hostname" nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -43,6 +43,7 @@ spec: dnsConfig: searches: - zerotesting-service.zerotesting.svc.cluster.local + - zerotesting-bootstrap.zerotesting.svc.cluster.local containers: - name: waku image: harbor2.riff.cc/localmirror/wakuorg/nwaku:wakunode_dst diff --git a/accelerated_deployment/docker/getenr.sh b/accelerated_deployment/docker/getenr.sh index 76a0bce..f8109cd 100755 --- a/accelerated_deployment/docker/getenr.sh +++ b/accelerated_deployment/docker/getenr.sh @@ -3,8 +3,8 @@ # Number of ENRs to process, default to 3 if not specified num_enrs=${1:-3} -# Find the IPv4 IPs of "zerotesting-service.zerotesting" using nslookup -readarray -t pod_ips < <(nslookup zerotesting-service.zerotesting | awk '/^Address: / { print $2 }' | head -n "$num_enrs") +# Find the IPv4 IPs of "zerotesting-bootstrap.zerotesting" using nslookup +readarray -t pod_ips < <(nslookup zerotesting-bootstrap.zerotesting | awk '/^Address: / { print $2 }' | head -n "$num_enrs") # Shuffle the IPs before processing them to help randomise which nodes we connect to and peer with # Disabled for now diff --git a/accelerated_deployment/midstrap.yaml b/accelerated_deployment/midstrap.yaml index 1c1a6cc..cb00d81 100644 --- a/accelerated_deployment/midstrap.yaml +++ b/accelerated_deployment/midstrap.yaml @@ -6,14 +6,14 @@ metadata: spec: replicas: 30 podManagementPolicy: "Parallel" - serviceName: zerotesting-service + serviceName: zerotesting-bootstrap selector: matchLabels: - app: zerotenkay + app: zerotenkay-bootstrap template: metadata: labels: - app: zerotenkay + app: zerotenkay-bootstrap spec: tolerations: - key: "zerotesting" @@ -30,7 +30,7 @@ spec: - key: app operator: In values: - - zerotenkay + - zerotenkay-bootstrap topologyKey: "kubernetes.io/hostname" nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -43,6 +43,7 @@ spec: dnsConfig: searches: - zerotesting-service.zerotesting.svc.cluster.local + - zerotesting-bootstrap.zerotesting.svc.cluster.local volumes: - name: enr-data emptyDir: {} @@ -68,9 +69,9 @@ spec: - /bin/sh - -c - > - wget -O - --retry-connrefused http://127.0.0.1:8008/metrics | + wget -O - --retry-connrefused http://127.0.0.1:8008/metrics | awk '!/^#/ && /^libp2p_gossipsub_healthy_peers_topics /{ - print "Found gossipsub:", $0; + print "Found gossipsub:", $0; if ($2 == 1.0) { exit 0; # success, healthy state } else { @@ -100,4 +101,4 @@ spec: - | . /etc/enr/enr.env echo $ENR1 $ENR2 $ENR3 - /usr/bin/wakunode --relay=true --rpc-admin=true --max-connections=1000 --rpc-address=0.0.0.0 --rest=true --rest-admin=true --rest-private=true --rest-address=0.0.0.0 --discv5-discovery=true --discv5-enr-auto-update=True --log-level=INFO --rpc-address=0.0.0.0 --metrics-server=True --metrics-server-address=0.0.0.0 --discv5-bootstrap-node=$ENR1 --discv5-bootstrap-node=$ENR2 --discv5-bootstrap-node=$ENR3 --nat=extip:${IP} --pubsub-topic="/waku/2/kubetopic" + /usr/bin/wakunode --relay=true --rpc-admin=true --max-connections=1500 --rpc-address=0.0.0.0 --rest=true --rest-admin=true --rest-private=true --rest-address=0.0.0.0 --discv5-discovery=true --discv5-enr-auto-update=True --log-level=INFO --rpc-address=0.0.0.0 --metrics-server=True --metrics-server-address=0.0.0.0 --discv5-bootstrap-node=$ENR1 --discv5-bootstrap-node=$ENR2 --discv5-bootstrap-node=$ENR3 --nat=extip:${IP} --pubsub-topic="/waku/2/kubetopic" diff --git a/accelerated_deployment/nodes.yaml b/accelerated_deployment/nodes.yaml index 7f67330..442a7e8 100644 --- a/accelerated_deployment/nodes.yaml +++ b/accelerated_deployment/nodes.yaml @@ -72,9 +72,9 @@ spec: - /bin/sh - -c - > - wget -O - --retry-connrefused http://127.0.0.1:8008/metrics | + wget -O - --retry-connrefused http://127.0.0.1:8008/metrics | awk '!/^#/ && /^libp2p_gossipsub_healthy_peers_topics /{ - print "Found gossipsub:", $0; + print "Found gossipsub:", $0; if ($2 == 1.0) { exit 0; # success, healthy state } else { diff --git a/accelerated_deployment/publisher.yaml b/accelerated_deployment/publisher.yaml index c490cc0..40bd1a0 100644 --- a/accelerated_deployment/publisher.yaml +++ b/accelerated_deployment/publisher.yaml @@ -24,4 +24,4 @@ spec: command: - sh - -c - - python /app/traffic.py --msg-size-kbytes=1 --delay-seconds=5 --debug + - python /app/traffic.py --msg-size-kbytes=1 --delay-seconds=20 --debug diff --git a/accelerated_deployment/service-bootstrap.yaml b/accelerated_deployment/service-bootstrap.yaml new file mode 100644 index 0000000..5e924a0 --- /dev/null +++ b/accelerated_deployment/service-bootstrap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Service +metadata: + name: zerotesting-bootstrap + namespace: zerotesting +spec: + clusterIP: None + selector: + app: zerotenkay-bootstrap diff --git a/accelerated_deployment/service.yaml b/accelerated_deployment/service.yaml new file mode 100644 index 0000000..3a7d21d --- /dev/null +++ b/accelerated_deployment/service.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Service +metadata: + name: zerotesting-service + namespace: zerotesting +spec: + clusterIP: None + selector: + app: zerotenkay