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

47 lines
1.5 KiB
YAML

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: monero-xmrig
namespace: crypto
labels: { app: monero-xmrig }
spec:
selector:
matchLabels: { app: monero-xmrig }
updateStrategy: { type: RollingUpdate }
template:
metadata:
labels: { app: monero-xmrig }
spec:
priorityClassName: scavenger
nodeSelector:
node-role.kubernetes.io/worker: "true"
volumes:
- name: payout
secret:
secretName: monero-payout
containers:
- name: xmrig
image: ghcr.io/tari-project/xmrig:latest
imagePullPolicy: IfNotPresent
env:
- 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 } }
command: ["/bin/sh","-lc"]
args:
- |
set -eu
THR="${XMRIG_THREADS:-1}"
EXTRA="${XMRIG_EXTRA_ARGS:-}"
# p2pool ignores wallet user; use 'x' or fixed difficulty with x+<diff>
exec nice -n 19 ionice -c3 xmrig \
-o p2pool.crypto.svc.cluster.local:3333 \
-u x \
-k \
--donate-level N \
--cpu-priority 1 \
--threads "${THR}" ${EXTRA}
volumeMounts:
- { name: payout, mountPath: /run/xmr, readOnly: true }