10ksim/deployment/nodes.yaml

84 lines
2.6 KiB
YAML
Raw Normal View History

2024-03-04 11:23:14 +00:00
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nodes
namespace: zerotesting
spec:
2024-03-05 20:33:43 +00:00
replicas: 3000
2024-03-04 11:23:14 +00:00
podManagementPolicy: "Parallel"
serviceName: zerotesting-service
selector:
matchLabels:
app: zerotenkay
template:
metadata:
labels:
app: zerotenkay
spec:
dnsConfig:
searches:
- zerotesting-service.zerotesting.svc.cluster.local
volumes:
- name: enr-data
emptyDir: {}
initContainers:
- name: grabenr
2024-05-24 11:59:15 +00:00
image: zorlin/getenr:v0.3.0
imagePullPolicy: IfNotPresent
2024-03-04 11:23:14 +00:00
volumeMounts:
- name: enr-data
mountPath: /etc/enr
command:
- /app/getenr.sh
args:
2024-03-04 13:51:13 +00:00
- "3"
2024-03-04 11:23:14 +00:00
containers:
- name: waku
2024-05-24 11:59:15 +00:00
image: zorlin/nwaku-jq:v0.26.0
imagePullPolicy: IfNotPresent
2024-03-04 11:23:14 +00:00
ports:
- containerPort: 8545
- containerPort: 8008
volumeMounts:
- name: enr-data
mountPath: /etc/enr
readinessProbe:
exec:
command:
- /bin/sh
- -c
2024-03-05 20:33:43 +00:00
- >
2024-05-24 11:59:15 +00:00
curl -s http://127.0.0.1:8008/metrics |
2024-03-05 20:33:43 +00:00
awk '!/^#/ && /^libp2p_gossipsub_healthy_peers_topics /{
print "Found gossipsub:", $0;
2024-03-05 20:33:43 +00:00
if ($2 == 1.0) {
exit 0; # success, healthy state
} else {
exit 1; # failure, unhealthy state
}
}'
2024-03-04 11:23:14 +00:00
successThreshold: 5
initialDelaySeconds: 5
periodSeconds: 1
2024-03-04 11:23:14 +00:00
failureThreshold: 2
timeoutSeconds: 5
resources:
requests:
memory: "64Mi"
2024-05-24 11:59:15 +00:00
cpu: "150m"
2024-03-04 11:23:14 +00:00
limits:
2024-05-24 11:59:15 +00:00
memory: "600Mi"
cpu: "400m"
2024-03-04 11:23:14 +00:00
env:
- name: IP
valueFrom:
fieldRef:
fieldPath: status.podIP
command:
- sh
- -c
- |
. /etc/enr/enr.env
2024-05-24 11:59:15 +00:00
echo ENRs are $ENR1 $ENR2 $ENR3
nice -n 19 /usr/bin/wakunode --relay-peer-exchange=true --peer-exchange=true --relay=true --max-connections=800 --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 --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"