-
Notifications
You must be signed in to change notification settings - Fork 20
/
30-deployment.yml
100 lines (99 loc) · 2.95 KB
/
30-deployment.yml
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: eth-geth-tx
namespace: data
labels:
app: eth-geth-tx
spec:
replicas: 2
selector:
matchLabels:
app: eth-geth-tx
template:
metadata:
labels:
app: eth-geth-tx
spec:
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: eth-geth
initContainers:
- name: init-genesis
image: ethereum/client-go:v1.9.13
imagePullPolicy: IfNotPresent
args:
- "init"
- "/var/geth/genesis.json"
volumeMounts:
- name: data
mountPath: /root/.ethereum
- name: config
mountPath: /var/geth
- name: get-bootnodes
image: ethereum/client-go:v1.9.13
imagePullPolicy: IfNotPresent
command: ["/bin/sh"]
args:
- "-c"
- |-
apk add --no-cache curl;
COUNT=0;
echo "calling $BOOTNODE_REGISTRAR_SVC"
while [ $COUNT -le 100 ]
do
curl -m 5 -s $BOOTNODE_REGISTRAR_SVC | xargs echo -n >> /geth/bootnodes;
if [ -s /geth/bootnodes ]
then
cat /geth/bootnodes;
exit 0;
fi;
echo "Attempt $COUNT. No bootnodes found...";
sleep 2 || break;
COUNT=$((COUNT+1));
done;
echo "ERROR: Unable to find bootnodes.";
exit 0;
env:
- name: BOOTNODE_REGISTRAR_SVC
value: eth-bootnode-registrar
volumeMounts:
- name: data
mountPath: /geth
containers:
- name: geth-tx
image: ethereum/client-go:v1.9.13
imagePullPolicy: IfNotPresent
command: ["/bin/sh"]
args:
- "-c"
- "geth --nousb --bootnodes=`cat /root/.ethereum/bootnodes` --rpc --rpcaddr='0.0.0.0' --rpcapi=eth,net,web3 --rpcvhosts='*' --rpccorsdomain='*' --ws --networkid=${NETWORK_ID} --ethstats=${HOSTNAME}:${ETHSTATS_SECRET}@${ETHSTATS_SVC} --verbosity=2"
env:
- name: ETHSTATS_SVC
value: eth-ethstats:8080
- name: ETHSTATS_SECRET
valueFrom:
secretKeyRef:
name: eth-ethstats
key: WS_SECRET
- name: NETWORK_ID
valueFrom:
configMapKeyRef:
name: eth-geth
key: networkid
ports:
- name: rpc
containerPort: 8545
- name: ws
containerPort: 8546
- name: discovery-udp
containerPort: 30303
protocol: UDP
- name: discovery-tcp
containerPort: 30303
volumeMounts:
- name: data
mountPath: /root/.ethereum