titan-iac/services/crypto/xmr-miner/xmrig-daemonset.yaml

65 lines
2.1 KiB
YAML
Raw Normal View History

# services/crypto/xmr-miner/xmrig-daemonset.yaml
2025-08-13 01:00:20 -05:00
apiVersion: apps/v1
kind: DaemonSet
metadata:
2025-08-14 00:34:13 -05:00
name: monero-xmrig
2025-08-13 01:00:20 -05:00
namespace: crypto
labels:
app: monero-xmrig
atlas.bstein.dev/workload-profile: scavenger
2025-08-13 01:00:20 -05:00
spec:
selector:
2025-08-14 00:34:13 -05:00
matchLabels: { app: monero-xmrig }
2025-08-13 01:32:55 -05:00
updateStrategy: { type: RollingUpdate }
2025-08-13 01:00:20 -05:00
template:
metadata:
labels:
app: monero-xmrig
atlas.bstein.dev/workload-profile: scavenger
2025-08-13 01:00:20 -05:00
spec:
2025-08-13 01:32:55 -05:00
priorityClassName: scavenger
2025-08-13 01:00:20 -05:00
nodeSelector:
2025-08-13 18:11:03 -05:00
node-role.kubernetes.io/worker: "true"
2025-09-02 10:43:44 -05:00
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: hardware
operator: In
values: ["rpi4","rpi5"]
2025-08-13 01:00:20 -05:00
containers:
- name: xmrig
image: ghcr.io/tari-project/xmrig@sha256:d590a41613fea974f155280920095ea10c3710f55ecf16fc38fd3a1c18718129
2025-08-13 01:32:55 -05:00
imagePullPolicy: IfNotPresent
2025-08-13 01:00:20 -05:00
env:
2025-08-13 01:32:55 -05:00
- name: XMRIG_THREADS
valueFrom: { configMapKeyRef: { name: xmr-miner-sources, key: XMRIG_THREADS, optional: true } }
- name: XMRIG_EXTRA_ARGS
valueFrom: { configMapKeyRef: { name: xmr-miner-sources, key: XMRIG_EXTRA_ARGS, optional: true } }
2025-08-13 01:00:20 -05:00
command: ["/bin/sh","-lc"]
args:
- |
set -eu
THR="${XMRIG_THREADS:-1}"
EXTRA="${XMRIG_EXTRA_ARGS:-}"
IO_PREFIX=""
if command -v ionice >/dev/null 2>&1; then
IO_PREFIX="ionice -c3"
fi
2025-08-13 01:32:55 -05:00
# p2pool ignores wallet user; use 'x' or fixed difficulty with x+<diff>
exec nice -n 19 ${IO_PREFIX} xmrig \
2025-08-13 01:00:20 -05:00
-o p2pool.crypto.svc.cluster.local:3333 \
2025-08-13 01:32:55 -05:00
-u x \
2025-08-13 01:00:20 -05:00
-k \
2025-08-14 20:37:30 -05:00
--donate-level N \
2025-08-13 01:00:20 -05:00
--cpu-priority 1 \
--threads "${THR}" ${EXTRA}
resources:
requests:
cpu: "0"
memory: 32Mi
limits:
cpu: 250m
memory: 256Mi