From e7ee503cbef5ed352e9f47254ecc994b6bb3c0a6 Mon Sep 17 00:00:00 2001 From: Jeff Billimek Date: Fri, 12 Jul 2019 21:29:31 -0400 Subject: [PATCH] Rtorrent flood refactor (#46) * refactoring rtorrent-flood chart --- rtorrent-flood/Chart.yaml | 12 ++--- rtorrent-flood/templates/deployment.yaml | 57 ++++++++++++++++++------ rtorrent-flood/values.yaml | 23 +++++++--- 3 files changed, 67 insertions(+), 25 deletions(-) diff --git a/rtorrent-flood/Chart.yaml b/rtorrent-flood/Chart.yaml index a7f6bc3e..a6b1afdc 100644 --- a/rtorrent-flood/Chart.yaml +++ b/rtorrent-flood/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: 0.9.7-0.13.7 -description: flood-rtorrent +appVersion: 1.0.0 +description: rtorrent and flood co-located in the same deployment name: rtorrent-flood -version: 2.0.9 +version: 3.0.0 keywords: - rtorrent - flood @@ -10,8 +10,10 @@ keywords: home: https://github.com/billimek/billimek-charts/tree/master/rtorrent-flood icon: https://github.com/jfurrow/flood/blob/master/flood.png?raw=true sources: - - https://hub.docker.com/r/wonderfall/rtorrent-flood - - https://github.com/Wonderfall/docker-rtorrent-flood + - https://hub.docker.com/r/looselyrigorous/rtorrent + - https://github.com/looselyrigorous/docker-rtorrent + - https://github.com/Flood-UI/flood + - https://cloud.docker.com/repository/docker/billimek/flood maintainers: - name: billimek email: jeff@billimek.com diff --git a/rtorrent-flood/templates/deployment.yaml b/rtorrent-flood/templates/deployment.yaml index a13668d6..f51804b4 100644 --- a/rtorrent-flood/templates/deployment.yaml +++ b/rtorrent-flood/templates/deployment.yaml @@ -22,16 +22,47 @@ spec: app.kubernetes.io/instance: {{ .Release.Name }} spec: containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + - name: {{ .Chart.Name }}-rtorrent + image: "{{ .Values.rtorrent.image.repository }}:{{ .Values.rtorrent.image.tag }}" + imagePullPolicy: {{ .Values.rtorrent.image.pullPolicy }} + ports: + - name: bt + containerPort: 49161 + protocol: TCP + readinessProbe: + tcpSocket: + port: bt + livenessProbe: + tcpSocket: + port: bt + env: + - name: TZ + value: "{{ .Values.timezone }}" + - name: PUID + value: "{{ .Values.uid }}" + - name: PGID + value: "{{ .Values.gid }}" + volumeMounts: + - mountPath: /config + name: config + - mountPath: /data + name: data + {{- if .Values.persistence.data.subPath }} + subPath: {{ .Values.persistence.data.subPath }} + {{ end }} + - mountPath: /session + name: data + subPath: .session + - mountPath: /tmp + name: socket + resources: + - name: {{ .Chart.Name }}-flood + image: "{{ .Values.flood.image.repository }}:{{ .Values.flood.image.tag }}" + imagePullPolicy: {{ .Values.flood.image.pullPolicy }} ports: - name: http containerPort: 3000 protocol: TCP - - name: bt - containerPort: 49184 - protocol: TCP livenessProbe: httpGet: port: http @@ -50,22 +81,20 @@ spec: value: "{{ .Values.timezone }}" - name: FLOOD_SECRET value: "{{ .Values.floodSecret }}" - - name: UID - value: "{{ .Values.uid }}" - - name: GID - value: "{{ .Values.gid }}" + - name: RTORRENT_SOCK + value: "true" volumeMounts: - - mountPath: /flood-db - name: flood-db - mountPath: /data name: data {{- if .Values.persistence.data.subPath }} subPath: {{ .Values.persistence.data.subPath }} {{ end }} + - mountPath: /tmp + name: socket resources: {{ toYaml .Values.resources | indent 12 }} volumes: - - name: flood-db + - name: config {{- if .Values.persistence.config.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "rtorrent-flood.fullname" . }}-config{{- end }} @@ -79,6 +108,8 @@ spec: {{- else }} emptyDir: {} {{ end }} + - name: socket + emptyDir: {} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/rtorrent-flood/values.yaml b/rtorrent-flood/values.yaml index c73eb371..403c0253 100644 --- a/rtorrent-flood/values.yaml +++ b/rtorrent-flood/values.yaml @@ -1,12 +1,7 @@ -# Default values for deluge. +# Default values for rtorrent-flood. # This is a YAML-formatted file. # Declare variables to be passed into your templates. -image: - repository: wonderfall/rtorrent-flood - tag: new - pullPolicy: IfNotPresent - # upgrade strategy type (e.g. Recreate or RollingUpdate) strategyType: Recreate @@ -18,6 +13,20 @@ floodSecret: "supersecret" uid: 1001 gid: 1001 +rtorrent: + enabled: true + image: + repository: looselyrigorous/rtorrent + tag: latest + pullPolicy: Always + +flood: + enabled: true + image: + repository: billimek/flood + tag: latest + pullPolicy: Always + guiService: type: ClusterIP port: 3000 @@ -41,7 +50,7 @@ guiService: btService: type: NodePort - port: 49184 + port: 49161 ## Specify the nodePort value for the LoadBalancer and NodePort service types. ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport ##