diff --git a/rflood/Chart.yaml b/rflood/Chart.yaml new file mode 100644 index 0000000..d1f9e5d --- /dev/null +++ b/rflood/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: rflood +description: rTorrent + Flood (hotio/rflood) Helm chart +type: application +version: 0.1.1 +appVersion: "release-0.16.8" +annotations: + version-source: ghcr-tags:hotio/rflood:^release-[0-9]+\.[0-9]+\.[0-9]+$ diff --git a/rflood/templates/deployment.yaml b/rflood/templates/deployment.yaml new file mode 100644 index 0000000..5d9e5ec --- /dev/null +++ b/rflood/templates/deployment.yaml @@ -0,0 +1,58 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: torrent + annotations: + version-source: {{ index .Chart.Annotations "version-source" }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + ports: + - containerPort: {{ .Values.webuiPort }} + name: webui + - containerPort: {{ .Values.rpcPort }} + name: rpc + - containerPort: {{ .Values.torrentPort }} + name: torrent-tcp + protocol: TCP + - containerPort: {{ .Values.torrentPort }} + name: torrent-udp + protocol: UDP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: config + mountPath: /config + - name: data + mountPath: /data + volumes: + - name: config + persistentVolumeClaim: + claimName: {{ .Release.Name }}-config + - name: data + hostPath: + path: {{ .Values.volumes.data.hostPath }} + type: DirectoryOrCreate diff --git a/rflood/templates/ingress.yaml b/rflood/templates/ingress.yaml new file mode 100644 index 0000000..62b56db --- /dev/null +++ b/rflood/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }} + port: + number: {{ $.Values.webuiPort }} + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/rflood/templates/pvc.yaml b/rflood/templates/pvc.yaml new file mode 100644 index 0000000..e1635de --- /dev/null +++ b/rflood/templates/pvc.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-config + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + accessModes: + {{- toYaml .Values.persistence.config.accessModes | nindent 4 }} + resources: + requests: + storage: {{ .Values.persistence.config.size | quote }} + {{- with .Values.persistence.config.storageClass }} + storageClassName: {{ . | quote }} + {{- end }} diff --git a/rflood/templates/service.yaml b/rflood/templates/service.yaml new file mode 100644 index 0000000..5c1a6ac --- /dev/null +++ b/rflood/templates/service.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - name: webui + port: {{ .Values.webuiPort }} + targetPort: {{ .Values.webuiPort }} + protocol: TCP + - name: rpc + port: {{ .Values.rpcPort }} + targetPort: {{ .Values.rpcPort }} + protocol: TCP + - name: torrent-tcp + port: {{ .Values.torrentPort }} + targetPort: {{ .Values.torrentPort }} + protocol: TCP + - name: torrent-udp + port: {{ .Values.torrentPort }} + targetPort: {{ .Values.torrentPort }} + protocol: UDP diff --git a/rflood/values.yaml b/rflood/values.yaml new file mode 100644 index 0000000..ceb163c --- /dev/null +++ b/rflood/values.yaml @@ -0,0 +1,42 @@ +# Default values for rflood Helm Chart (hotio/rflood) +image: + repository: ghcr.io/hotio/rflood + pullPolicy: IfNotPresent + +webuiPort: 3000 +rpcPort: 5000 +torrentPort: 50000 + +env: + PUID: "1001" + PGID: "1001" + UMASK: "002" + TZ: "Europe/Kyiv" + FLOOD_AUTH: "false" + +resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "2" + memory: "2Gi" + +persistence: + config: + size: 2Gi + storageClass: "" + accessModes: + - ReadWriteOnce + +volumes: + data: + hostPath: "" + +ingresses: {} + # https: + # host: rflood.example.com + # annotations: {} + # tls: + # - hosts: + # - rflood.example.com diff --git a/scripts/update-charts.sh b/scripts/update-charts.sh index 396d127..bbf4bd1 100755 --- a/scripts/update-charts.sh +++ b/scripts/update-charts.sh @@ -37,7 +37,7 @@ fetch_latest() { local token token=$(curl -s "https://ghcr.io/token?scope=repository:${repo}:pull" | jq -r '.token // empty') if [ -n "$token" ]; then - version=$(curl -s -H "Authorization: Bearer $token" "https://ghcr.io/v2/${repo}/tags/list" | jq -r '.tags[]' | grep -E "$pattern" | sort -V -r | head -1) + version=$(curl -s -H "Authorization: Bearer $token" "https://ghcr.io/v2/${repo}/tags/list?n=10000" | jq -r '.tags[]' | grep -E "$pattern" | sort -V -r | head -1) fi ;; *)