diff --git a/rflood/Chart.yaml b/rflood/Chart.yaml index 87d0310..e5fce27 100644 --- a/rflood/Chart.yaml +++ b/rflood/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: rflood -description: rTorrent + Flood (hotio/rflood) Helm chart +description: rTorrent + Flood (jesec/rtorrent-flood) Helm chart type: application -version: 0.1.9 -appVersion: "release-51028c6" +version: 0.2.0 +appVersion: "4.14.2" annotations: - version-source: ghcr-tags-build:hotio/rflood:^release-[a-f0-9]+-[0-9]+-linux-amd64$ + version-source: dockerhub-tags-pattern:jesec/rtorrent-flood:^[0-9]+\.[0-9]+\.[0-9]+$ diff --git a/rflood/templates/configmap.yaml b/rflood/templates/configmap.yaml new file mode 100644 index 0000000..0bd9bb9 --- /dev/null +++ b/rflood/templates/configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-rtorrent-config + namespace: {{ .Release.Namespace }} +data: + rtorrent.rc: | + method.insert = cfg.basedir, private|const|string, (cat,(system.env,HOME),"/.local/share/rtorrent/") + session.path.set = (cat,(cfg.basedir),".session/") + directory.default.set = /data + network.scgi.open_local = (cat,(cfg.basedir),"rtorrent.sock") + network.port_range.set = {{ .Values.torrentPort }}-{{ .Values.torrentPort }} + network.port_random.set = no + network.max_open_files.set = 600 + network.max_open_sockets.set = 300 diff --git a/rflood/templates/deployment.yaml b/rflood/templates/deployment.yaml index eec0374..0958150 100644 --- a/rflood/templates/deployment.yaml +++ b/rflood/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ .Release.Name }} spec: + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -37,16 +41,16 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.env }} env: {{- range $key, $value := .Values.env }} - name: {{ $key }} value: {{ $value | quote }} {{- end }} + {{- end }} ports: - containerPort: {{ .Values.webuiPort }} name: webui - - containerPort: {{ .Values.rpcPort }} - name: rpc - containerPort: {{ .Values.torrentPort }} name: torrent-tcp protocol: TCP @@ -57,18 +61,16 @@ spec: {{- toYaml .Values.resources | nindent 12 }} {{- if .Values.livenessProbe.enabled }} livenessProbe: - exec: - {{- toYaml .Values.livenessProbe.exec | nindent 14 }} - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- omit .Values.livenessProbe "enabled" | toYaml | nindent 12 }} {{- end }} volumeMounts: - name: config mountPath: /config - name: data mountPath: /data + - name: rtorrent-config + mountPath: /config/.rtorrent.rc + subPath: rtorrent.rc volumes: - name: config persistentVolumeClaim: @@ -77,3 +79,6 @@ spec: hostPath: path: {{ .Values.volumes.data.hostPath }} type: DirectoryOrCreate + - name: rtorrent-config + configMap: + name: {{ .Release.Name }}-rtorrent-config diff --git a/rflood/templates/service.yaml b/rflood/templates/service.yaml index 4b736e7..80fa588 100644 --- a/rflood/templates/service.yaml +++ b/rflood/templates/service.yaml @@ -20,13 +20,6 @@ spec: {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) .Values.service.nodePorts.webui }} nodePort: {{ .Values.service.nodePorts.webui }} {{- end }} - - name: rpc - port: {{ .Values.rpcPort }} - targetPort: {{ .Values.rpcPort }} - protocol: TCP - {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) .Values.service.nodePorts.rpc }} - nodePort: {{ .Values.service.nodePorts.rpc }} - {{- end }} - name: torrent-tcp port: {{ .Values.torrentPort }} targetPort: {{ .Values.torrentPort }} diff --git a/rflood/values.yaml b/rflood/values.yaml index 09afb90..fc253b3 100644 --- a/rflood/values.yaml +++ b/rflood/values.yaml @@ -1,10 +1,9 @@ -# Default values for rflood Helm Chart (hotio/rflood) +# Default values for rflood Helm Chart (jesec/rtorrent-flood) image: - repository: ghcr.io/hotio/rflood + repository: jesec/rtorrent-flood pullPolicy: IfNotPresent -webuiPort: 3000 -rpcPort: 5000 +webuiPort: 3001 torrentPort: 50000 service: @@ -12,16 +11,15 @@ service: externalTrafficPolicy: "" nodePorts: webui: null - rpc: null torrentTcp: null torrentUdp: null -env: - PUID: "1001" - PGID: "1001" - UMASK: "002" - TZ: "Europe/Kyiv" - FLOOD_AUTH: "false" +securityContext: + runAsUser: 1001 + runAsGroup: 1001 + fsGroup: 1001 + +env: {} resources: requests: @@ -33,14 +31,12 @@ resources: livenessProbe: enabled: true - exec: - command: - - /bin/sh - - -c - - "timeout 10 rtxmlrpc system.time_seconds > /dev/null 2>&1" + httpGet: + path: / + port: 3001 initialDelaySeconds: 60 periodSeconds: 30 - timeoutSeconds: 15 + timeoutSeconds: 10 failureThreshold: 3 persistence: