2024-12-01 08:56:34 -03:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
2024-12-17 10:35:56 -03:00
|
|
|
name: deluge-nodes-{{ .Release.Name }}
|
|
|
|
namespace: {{ .Release.Namespace }}
|
2024-12-01 08:56:34 -03:00
|
|
|
|
|
|
|
spec:
|
2024-12-17 10:35:56 -03:00
|
|
|
replicas: {{ .Values.experiment.networkSize }}
|
|
|
|
serviceName: deluge-nodes-{{ .Release.Name }}-service
|
2024-12-06 18:27:47 -03:00
|
|
|
podManagementPolicy: Parallel
|
2024-12-01 08:56:34 -03:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
2024-12-17 10:35:56 -03:00
|
|
|
app: deluge-nodes-{{ .Release.Name }}
|
2024-12-01 08:56:34 -03:00
|
|
|
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2024-12-17 10:35:56 -03:00
|
|
|
app: deluge-nodes-{{ .Release.Name }}
|
2024-12-01 08:56:34 -03:00
|
|
|
|
|
|
|
spec:
|
|
|
|
containers:
|
2024-12-17 10:35:56 -03:00
|
|
|
- name: deluge-{{ .Release.Name }}
|
2024-12-01 08:56:34 -03:00
|
|
|
image: codexstorage/deluge
|
2024-12-09 16:30:21 -03:00
|
|
|
imagePullPolicy: Always
|
2024-12-01 08:56:34 -03:00
|
|
|
ports:
|
|
|
|
- containerPort: 6890
|
|
|
|
env:
|
|
|
|
- name: CLIENT_POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: DELUGE_RPC_PORT
|
|
|
|
value: "6890"
|
|
|
|
- name: DELUGE_LISTEN_PORTS
|
|
|
|
value: "6891,6892"
|
2024-12-06 18:40:30 -03:00
|
|
|
- name: DELUGE_LOG_LEVEL
|
|
|
|
value: "info"
|
2024-12-01 08:56:34 -03:00
|
|
|
command: [ "/bin/bash", "--login", "-c" ]
|
|
|
|
args:
|
|
|
|
- |
|
2024-12-11 15:43:52 -03:00
|
|
|
export DELUGE_NODE_ID=${CLIENT_POD_NAME}
|
2024-12-06 15:42:56 -03:00
|
|
|
# Sadly we can't mount a subpath, so need add the correct prefix
|
|
|
|
# into all of the config directories.
|
2024-12-01 08:56:34 -03:00
|
|
|
export DELUGE_CONFIG_DIR=/var/lib/deluge/${CLIENT_POD_NAME}
|
2024-12-06 15:42:56 -03:00
|
|
|
export DELUGE_DOWNLOAD_DIR=${DELUGE_CONFIG_DIR}/downloads
|
|
|
|
export DELUGE_TORRENTFILE_DIR=${DELUGE_CONFIG_DIR}/downloads
|
|
|
|
export DELUGE_PLUGINS_DIR=${DELUGE_CONFIG_DIR}/plugins
|
2024-12-01 08:56:34 -03:00
|
|
|
|
|
|
|
# Makes sure there's no previous garbage in there.
|
|
|
|
rm -rf ${DELUGE_CONFIG_DIR}
|
|
|
|
mkdir -p ${DELUGE_CONFIG_DIR}
|
|
|
|
|
|
|
|
${DELUGE_APP}/docker/bin/start.sh
|
|
|
|
volumeMounts:
|
2024-12-17 10:35:56 -03:00
|
|
|
- name: deluge-{{ .Release.Name }}-volume
|
2024-12-01 08:56:34 -03:00
|
|
|
mountPath: /var/lib/deluge
|
|
|
|
|
|
|
|
volumes:
|
2024-12-17 10:35:56 -03:00
|
|
|
- name: deluge-{{ .Release.Name }}-volume
|
2024-12-01 08:56:34 -03:00
|
|
|
persistentVolumeClaim:
|
2024-12-17 10:35:56 -03:00
|
|
|
claimName: {{ include "deluge.pvc" . }}
|