From 41f3746caaa4aad620e37a22a981341c4c586ea4 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Wed, 13 Aug 2025 08:17:31 -0500 Subject: [PATCH] try to fix monero mining --- infrastructure/core/pc-scavenger.yaml | 8 ++++ .../flux-system/kustomization-crypto.yaml | 3 +- .../flux-system/kustomization-monerod.yaml | 3 +- services/crypto/xmr-miner/deployment.yaml | 46 ++++++++++--------- services/crypto/xmr-miner/priority-class.yaml | 8 ---- 5 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 infrastructure/core/pc-scavenger.yaml delete mode 100644 services/crypto/xmr-miner/priority-class.yaml diff --git a/infrastructure/core/pc-scavenger.yaml b/infrastructure/core/pc-scavenger.yaml new file mode 100644 index 0000000..bda4e7c --- /dev/null +++ b/infrastructure/core/pc-scavenger.yaml @@ -0,0 +1,8 @@ +# infrastructure/core/pc-scavenger.yaml +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: + name: scavenger +value: -10 +globalDefault: false +description: "For pods and processes only meant to consume unutilized resources" diff --git a/infrastructure/flux-system/kustomization-crypto.yaml b/infrastructure/flux-system/kustomization-crypto.yaml index 77fd928..095ddd1 100644 --- a/infrastructure/flux-system/kustomization-crypto.yaml +++ b/infrastructure/flux-system/kustomization-crypto.yaml @@ -13,4 +13,5 @@ spec: kind: GitRepository name: flux-system namespace: flux-system - wait: true \ No newline at end of file + wait: true + \ No newline at end of file diff --git a/infrastructure/flux-system/kustomization-monerod.yaml b/infrastructure/flux-system/kustomization-monerod.yaml index d70c665..980134c 100644 --- a/infrastructure/flux-system/kustomization-monerod.yaml +++ b/infrastructure/flux-system/kustomization-monerod.yaml @@ -16,4 +16,5 @@ spec: dependsOn: - name: crypto wait: true - timeout: 5m \ No newline at end of file + timeout: 5m + \ No newline at end of file diff --git a/services/crypto/xmr-miner/deployment.yaml b/services/crypto/xmr-miner/deployment.yaml index 82ad9d6..f3f39cf 100644 --- a/services/crypto/xmr-miner/deployment.yaml +++ b/services/crypto/xmr-miner/deployment.yaml @@ -3,36 +3,40 @@ kind: Deployment metadata: name: p2pool namespace: crypto + labels: { app: p2pool } spec: replicas: 1 - selector: { matchLabels: { app: p2pool } } + selector: + matchLabels: { app: p2pool } template: metadata: labels: { app: p2pool } spec: - priorityClassName: scavenger nodeSelector: kubernetes.io/arch: arm64 - volumes: - - name: payout - secret: - secretName: xmr-payout + priorityClassName: scavenger containers: - name: p2pool - image: ghcr.io/schernykh/p2pool:latest - imagePullPolicy: IfNotPresent - command: ["/bin/sh","-c"] + image: ghcr.io/sethforprivacy/p2pool:latest + command: ["p2pool"] args: - - | - set -eu - ADDR="$(cat /run/xmr/address)" - exec nice -n 19 ionice -c3 p2pool \ - --wallet "$ADDR" \ - --host monerod.crypto.svc.cluster.local \ - --rpc-port 18081 \ - --zmq-port 18083 \ - --stratum 0.0.0.0:3333 + - "--wallet=$(XMR_ADDR)" + - "--host=monerod.crypto.svc.cluster.local" + - "--rpc-port=18081" + - "--zmq-port=18083" + - "--stratum=0.0.0.0:3333" + # - "--light-mode" + # - "--no-randomx" + # - "--no-cache" + env: + - name: XMR_ADDR + valueFrom: + secretKeyRef: + name: xmr-payout + key: address ports: - - { containerPort: 3333, name: stratum, protocol: TCP } - volumeMounts: - - { name: payout, mountPath: /run/xmr, readOnly: true } + - { name: stratum, containerPort: 3333, protocol: TCP } + readinessProbe: + tcpSocket: { port: 3333 } + initialDelaySeconds: 10 + periodSeconds: 10 diff --git a/services/crypto/xmr-miner/priority-class.yaml b/services/crypto/xmr-miner/priority-class.yaml deleted file mode 100644 index 4682f19..0000000 --- a/services/crypto/xmr-miner/priority-class.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# services/crypto/xmr-miner/priority-class.yaml -apiVersion: scheduling.k8s.io/v1 -kind: PriorityClass -metadata: - name: scavenger -value: -10 -globalDefault: false -description: "Preemptible background miners." \ No newline at end of file