titan-iac/services/crypto/monerod/deployment.yaml

91 lines
2.8 KiB
YAML

# services/crypto/monerod
apiVersion: apps/v1
kind: Deployment
metadata:
name: monerod
namespace: crypto
labels: { app: monerod }
spec:
replicas: 1
strategy: { type: Recreate }
selector: { matchLabels: { app: monerod } }
template:
metadata:
labels: { app: monerod }
spec:
securityContext:
fsGroup: 1000
fsGroupChangePolicy: OnRootMismatch
nodeSelector:
node-role.kubernetes.io/worker: "true"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: hardware
operator: In
values: ["rpi4","rpi5"]
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 50
preference:
matchExpressions:
- key: hardware
operator: In
values: ["rpi4"]
containers:
- name: monerod
image: registry.bstein.dev/crypto/monerod:0.18.4.1
command: ["/opt/monero/monerod"]
args:
- --data-dir=/data
- --non-interactive
- --prune-blockchain
- --rpc-bind-ip=0.0.0.0
- --rpc-bind-port=18081
- --confirm-external-bind
- --p2p-bind-ip=0.0.0.0
- --p2p-bind-port=18080
- --zmq-pub=tcp://0.0.0.0:18083
- --out-peers=32
- --in-peers=64
- --add-priority-node=p2pmd.xmrvsbeast.com:18080
- --add-priority-node=nodes.hashvault.pro:18080
- --disable-dns-checkpoints
- --enable-dns-blocklist
ports:
- { name: rpc, containerPort: 18081 }
- { name: p2p, containerPort: 18080 }
- { name: zmq, containerPort: 18083 }
# securityContext:
# allowPrivilegeEscalation: false
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# capabilities: { drop: ["ALL"] }
readinessProbe:
httpGet: { path: /get_info, port: 18081 }
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 6
livenessProbe:
httpGet: { path: /get_info, port: 18081 }
initialDelaySeconds: 300
periodSeconds: 20
timeoutSeconds: 3
failureThreshold: 6
terminationGracePeriodSeconds: 120
lifecycle:
preStop:
exec:
command: ["sh","-lc","kill -TERM 1; for i in $(seq 1 110); do kill -0 1 2>/dev/null || exit 0; sleep 1; done; exit 0"]
volumeMounts:
- { name: data, mountPath: /data }
- { name: tmp, mountPath: /tmp }
volumes:
- name: data
persistentVolumeClaim: { claimName: monerod-chain }
- name: tmp
emptyDir: {}