-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8s-mining-update.yaml
More file actions
152 lines (152 loc) · 3.35 KB
/
Copy pathk8s-mining-update.yaml
File metadata and controls
152 lines (152 loc) · 3.35 KB
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: ConfigMap
metadata:
name: metamorph-mining-config
namespace: metamorph-bsv
data:
BITCOIN_LIVE_MODE: "true"
BITCOIN_NETWORK: "testnet"
BITCOIN_MAX_WORKERS: "8"
BITCOIN_MIN_WORKERS: "2"
BITCOIN_MAX_PEERS: "16"
BITCOIN_MIN_PEERS: "8"
LOG_LEVEL: "info"
ENABLE_METRICS: "true"
METRICS_PORT: "9090"
PORTAL_PORT: "8080"
LEDGER_GRPC_PORT: "50051"
ENGINE_GRPC_PORT: "50052"
---
apiVersion: v1
kind: Secret
metadata:
name: metamorph-mining-secrets
namespace: metamorph-bsv
type: Opaque
stringData:
BITCOIN_MINING_ADDRESS: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
BITCOIN_POOL_URL: ""
BITCOIN_POOL_USERNAME: ""
BITCOIN_POOL_PASSWORD: ""
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: metamorph-mining-node
namespace: metamorph-bsv
labels:
app: metamorph
component: mining-node
spec:
replicas: 2
selector:
matchLabels:
app: metamorph
component: mining-node
template:
metadata:
labels:
app: metamorph
component: mining-node
spec:
containers:
- name: mining-node
image: golang:1.21-alpine
command: ["/bin/sh"]
args:
- -c
- |
apk add --no-cache git build-base
git clone https://github.com/codenlighten/bitcoin-sv-optimized-node.git /app
cd /app
go mod tidy
echo "🚀 Starting Metamorph Bitcoin SV Mining Node..."
go run ./cmd/mining-demo/main.go
envFrom:
- configMapRef:
name: metamorph-mining-config
- secretRef:
name: metamorph-mining-secrets
ports:
- containerPort: 8080
name: portal
- containerPort: 9090
name: metrics
- containerPort: 50051
name: ledger-grpc
- containerPort: 50052
name: engine-grpc
- containerPort: 8333
name: bitcoin-p2p
resources:
requests:
cpu: 1000m
memory: 2Gi
limits:
cpu: 4000m
memory: 8Gi
livenessProbe:
exec:
command:
- /bin/sh
- -c
- "ps aux | grep -v grep | grep mining-demo"
initialDelaySeconds: 120
periodSeconds: 30
readinessProbe:
exec:
command:
- /bin/sh
- -c
- "ps aux | grep -v grep | grep mining-demo"
initialDelaySeconds: 60
periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
name: metamorph-mining-service
namespace: metamorph-bsv
labels:
app: metamorph
component: mining
spec:
ports:
- port: 8080
targetPort: 8080
name: portal
- port: 9090
targetPort: 9090
name: metrics
- port: 50051
targetPort: 50051
name: ledger-grpc
- port: 50052
targetPort: 50052
name: engine-grpc
- port: 8333
targetPort: 8333
name: bitcoin-p2p
selector:
app: metamorph
component: mining-node
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: metamorph-mining-hpa
namespace: metamorph-bsv
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: metamorph-mining-node
minReplicas: 1
maxReplicas: 5
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70