-
Notifications
You must be signed in to change notification settings - Fork 3
/
minernode-statefulset.yaml
152 lines (146 loc) · 4.09 KB
/
minernode-statefulset.yaml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
apiVersion: v1
kind: Service
metadata:
name: geth-minernode-svc
spec:
selector:
role: minernode
type: NodePort
ports:
- name: minernode-gossip
protocol: TCP
port: 30303
targetPort: 30303
nodePort: 30303
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: minernode
spec:
serviceName: 'minernode'
replicas: 2
template:
metadata:
labels:
role: minernode
environment: production
spec:
terminationGracePeriodSeconds: 10
containers:
- name: node
image: xinfinorg/quorum:istanbul-tools-k8s
imagePullPolicy: IfNotPresent
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
args:
- "geth"
- "--datadir"
- "/qdata/dd"
- "--networkid"
- "2017"
- "--port"
- "30303"
- "--bootnodes"
- "enode://209eec26c79aa31e6397b6e12ed30b37df39392efaf698d509cd1be0ff73edf84cbb22bb5f304c16f63fb501edd6e28d232b93d959a0f6b06db00b764874c9ed@10.244.2.155:30301"
- "--rpc"
- "--rpccorsdomain"
- "*"
- "--rpcaddr"
- "0.0.0.0"
- "--rpcapi"
- "admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,istanbul"
- "--rpcport"
- "8545"
- "--etherbase"
- "0x3d2a20faee28bcda3a047079b0bb4a1a0dfed863"
- "--verbosity"
- "6"
- "--nat"
- "none"
- "--mine"
- "--minerthreads"
- "1"
- "--syncmode"
- "full"
- "--istanbul.blockperiod"
- "10"
- "--nodekey"
- "/nodekey/$(POD_NAME)"
- "2>&1 >>/qdata/geth.log"
ports:
- containerPort: 30303
protocol: TCP
name: geth-tcp
- containerPort: 30303
protocol: UDP
name: geth-udp
- containerPort: 8545
- containerPort: 8501
volumeMounts:
- mountPath: /qdata
name: geth-persistent-volume
- mountPath: /nodekey
name: nodekey
initContainers:
- name: init-genesis
image: xinfinorg/quorum:istanbul-tools-k8s
imagePullPolicy: IfNotPresent
command: ["/bin/bash"]
args:
- "-c"
- cp /var/geth/genesis.json /qdata/genesis.json --remove-destination;
geth --datadir /qdata/dd init /qdata/genesis.json;
volumeMounts:
- name: geth-persistent-volume
mountPath: /qdata
- name: genesis
mountPath: /var/geth
- name: import-account
image: xinfinorg/quorum:istanbul-tools-k8s
imagePullPolicy: IfNotPresent
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
args:
- "geth"
- "account"
- "import"
- "/nodekey/$(POD_NAME)"
- "--datadir"
- "/qdata"
- "--keystore"
- "/qdata/dd/keystore"
- "--password"
- "/nodekey/$(POD_NAME)-password"
volumeMounts:
- mountPath: /qdata
name: geth-persistent-volume
- mountPath: /nodekey
name: nodekey
volumes:
- name: genesis
configMap:
name: genesis-geth-config
- name: nodekey
secret:
secretName: minernode-secret
volumeClaimTemplates:
- metadata:
name: geth-persistent-volume
spec:
storageClassName: manual
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
selector:
matchLabels:
type: local