81 lines
2.6 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: bootstrap
namespace: zerotesting
spec:
replicas: 3
podManagementPolicy: "Parallel"
serviceName: zerotesting-bootstrap
selector:
matchLabels:
app: zerotenkay-bootstrap
template:
metadata:
labels:
app: zerotenkay-bootstrap
spec:
tolerations:
- key: "zerotesting"
operator: "Equal"
value: "fragment"
effect: "NoSchedule"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- zerotenkay-bootstrap
topologyKey: "kubernetes.io/hostname"
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "zerotesting"
operator: "In"
values:
- "fragment"
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
readinessProbe:
exec:
command:
- /bin/sh
- -c
- wget -O - http://127.0.0.1:8008/metrics | awk '!/^#/ && /^libp2p_peers /{print "Found peers:", $0; if ($2 < 4000.0) {print "Metric below 4000, success"; exit 0} else {print "Metric not below 4000, failure"; exit 1}}'
successThreshold: 3
initialDelaySeconds: 1
periodSeconds: 3
failureThreshold: 1
timeoutSeconds: 5
resources:
requests:
memory: "64Mi"
cpu: "10m"
limits:
memory: "256Mi"
cpu: "200m"
ports:
- containerPort: 8545
- containerPort: 8008
env:
- name: IP
valueFrom:
fieldRef:
fieldPath: status.podIP
command:
- sh
- -c
- /usr/bin/wakunode --relay=true --rpc-admin=true --keep-alive=true --max-connections=12500 --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 --nat=extip:$IP --pubsub-topic="/waku/2/kubetopic"