-
Notifications
You must be signed in to change notification settings - Fork 5
/
validator.yml
137 lines (135 loc) · 4.58 KB
/
validator.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
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
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: validator
spec:
podManagementPolicy: "Parallel" # Dont wait for other validators to terminate/bootup
updateStrategy:
type: OnDelete # Validators wont automatically restart whenever you apply changes (use the ./scripts/restart script)
replicas: <TOTAL_VALIDATORS>
selector:
matchLabels:
name: validator
serviceName: "validator"
template:
metadata:
labels:
name: validator
app: validator # being used by ServiceMonitor; could we target 'name' instead?
dynamic-hostports: '2154' # must be a string. Split multiple ports with '.'
spec:
shareProcessNamespace: true # otherwise you'll end up with mountains of zombie processes
containers:
- name: validator-exporter
image: jamiedubs/validator-exporter-k8s:latest
# imagePullPolicy: Never # if using local image; build in `validator-exporter` repo
imagePullPolicy: Always
ports:
- containerPort: 9825 # dial 9-VAL
volumeMounts:
- name: validator-vol # shared w/ validator
mountPath: /var/data
livenessProbe:
tcpSocket:
port: 9825
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 24 # kill the node after **2 mins** of unresponsiveness; default=3
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: validator
image: quay.io/team-helium/validator:latest-validator-amd64
imagePullPolicy: Always
resources:
requests:
cpu: 2
memory: "2Gi"
livenessProbe:
tcpSocket:
port: 2154
initialDelaySeconds: 0 # using startupProbe instead; default=0
# timeoutSeconds: 1 # seconds after which probe times out; default=1
periodSeconds: 5 # check port every 5s; default=10
failureThreshold: 24 # kill the node after **2 mins** of unresponsiveness; default=3
startupProbe:
exec:
command:
- cat
- /tmp/miner-started
initialDelaySeconds: 2 # give validator container a smidge to start up. default=0
periodSeconds: 5 # give validator **2 minutes** to start up before we kill and try again
failureThreshold: 12 # try for 1 minute before giving up
command: [ "/bin/ash", "-c" ]
args:
- "/opt/miner/usr/validator-setup.sh"
env:
- name: NAT_INTERNAL_PORT
value: "2154"
- name: NAT_INTERNAL_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: VALIDATOR_VERSION
value: "<VALIDATOR_VERSION>"
ports:
- containerPort: 2154
- containerPort: 4467
- containerPort: 30000
- containerPort: 30001
- containerPort: 30002
- containerPort: 30003
- containerPort: 30004
- containerPort: 30005
- containerPort: 30006
- containerPort: 30007
- containerPort: 30008
- containerPort: 30009
- containerPort: 30010
- containerPort: 30011
- containerPort: 30012
- containerPort: 30013
volumeMounts:
- name: validator-vol
mountPath: /var/data
- name: podinfo
mountPath: /etc/podinfo
- name: config
mountPath: /opt/miner/usr/validator-setup.sh
subPath: validator-setup.sh
volumes:
- name: podinfo
downwardAPI:
items:
- path: "annotations"
fieldRef:
fieldPath: metadata.annotations
- name: config
configMap:
name: validator
defaultMode: 0744
volumeClaimTemplates:
- metadata:
name: validator-vol
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: do-block-storage