211 lines
8.4 KiB
YAML
211 lines
8.4 KiB
YAML
{{ $labels := (dict
|
|
"app.kubernetes.io/name" .Chart.Name
|
|
"app.kubernetes.io/instance" .Release.Name
|
|
"app.kubernetes.io/part-of" .Release.Namespace
|
|
) }}
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Release.Name }}
|
|
name: {{ .Release.Namespace }}
|
|
spec:
|
|
replicas: 1
|
|
revisionHistoryLimit: 4
|
|
selector:
|
|
matchLabels:
|
|
{{ $labels | toYaml | nindent 12 }}
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{ $labels | toYaml | nindent 16 }}
|
|
spec:
|
|
volumes:
|
|
{{ $.Values.volumes | toYaml | nindent 25 }}
|
|
containers:
|
|
{{ if $.Values.transmission.enabled }}
|
|
- name: transmission
|
|
env:
|
|
{{ include "envs" $.Values.transmission.env | nindent 25 }}
|
|
image: "{{ $.Values.transmission.image }}"
|
|
imagePullPolicy: Always
|
|
resources:
|
|
{{ $.Values.transmission.resources | toYaml | nindent 25 }}
|
|
volumeMounts:
|
|
{{ $.Values.transmission.volumeMounts | toYaml | nindent 25 }}
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "ping -c 1 www.google.com || exit 1"
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 60
|
|
failureThreshold: 3
|
|
timeoutSeconds: 10
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "ping -c 1 www.google.com || exit 1"
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 60
|
|
failureThreshold: 3
|
|
timeoutSeconds: 10
|
|
{{ end }}
|
|
{{ if $.Values.qbittorrent.enabled }}
|
|
- name: qbittorrent
|
|
env:
|
|
- name: WEBUI_PORT
|
|
value: "{{ $.Values.qbittorrent.ports.webui }}"
|
|
- name: TORRENTING_PORT
|
|
value: "{{ $.Values.qbittorrent.ports.torrenting }}"
|
|
{{ include "envs" $.Values.qbittorrent.env | nindent 24 }}
|
|
image: "{{ $.Values.qbittorrent.image }}"
|
|
imagePullPolicy: Always
|
|
resources:
|
|
{{ $.Values.qbittorrent.resources | toYaml | nindent 25 }}
|
|
volumeMounts:
|
|
{{ $.Values.qbittorrent.volumeMounts | toYaml | nindent 25 }}
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "ping -c 1 www.google.com || exit 1"
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 60
|
|
failureThreshold: 3
|
|
timeoutSeconds: 10
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "ping -c 1 www.google.com || exit 1"
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 60
|
|
failureThreshold: 3
|
|
timeoutSeconds: 10
|
|
|
|
{{ end }}
|
|
initContainers:
|
|
- name: vpn
|
|
env:
|
|
{{ include "envs" $.Values.gluetun.env | nindent 25 }}
|
|
envFrom:
|
|
{{ $.Values.gluetun.envFrom | toYaml | nindent 25 }}
|
|
image: {{ $.Values.gluetun.image }}
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
{{ if $.Values.transmission.enabled }}
|
|
- containerPort: 9091
|
|
protocol: TCP
|
|
name: t-webui-tcp
|
|
- containerPort: 9091
|
|
protocol: UDP
|
|
name: t-webui-udp
|
|
- containerPort: 51413
|
|
protocol: TCP
|
|
name: t-torrent-tcp
|
|
- containerPort: 51413
|
|
protocol: UDP
|
|
name: t-torrent-udp
|
|
{{ end }}
|
|
{{ if $.Values.qbittorrent.enabled }}
|
|
- containerPort: {{ $.Values.qbittorrent.ports.webui }}
|
|
protocol: TCP
|
|
name: q-webui-tcp
|
|
- containerPort: {{ $.Values.qbittorrent.ports.webui }}
|
|
protocol: UDP
|
|
name: q-webui-udp
|
|
- containerPort: {{ $.Values.qbittorrent.ports.torrenting }}
|
|
protocol: TCP
|
|
name: q-torrent-tcp
|
|
- containerPort: {{ $.Values.qbittorrent.ports.torrenting }}
|
|
protocol: UDP
|
|
name: q-torrent-udp
|
|
{{ end }}
|
|
resources:
|
|
{{ $.Values.gluetun.resources | toYaml | nindent 25 }}
|
|
restartPolicy: Always
|
|
securityContext:
|
|
capabilities:
|
|
add:
|
|
- NET_ADMIN
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "ping -c 1 www.google.com || exit 1"
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 60
|
|
failureThreshold: 3
|
|
timeoutSeconds: 10
|
|
- name: ping
|
|
image: {{ $.Values.busybox.image }}
|
|
imagePullPolicy: IfNotPresent
|
|
resources:
|
|
{{ $.Values.busybox.resources | toYaml | nindent 25 }}
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
while ! ping -c 1 8.8.8.8; do
|
|
echo "Ping failed, retrying in 5"
|
|
sleep 5
|
|
done
|
|
echo "ping succesfull, exiting"
|
|
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: torrents
|
|
annotations:
|
|
{{ (.serviceAnnotations | default dict) | toYaml | nindent 4 }}
|
|
spec:
|
|
selector:
|
|
{{ $labels | toYaml | nindent 8 }}
|
|
type: {{ $.Values.serviceType | default "ClusterIP" | quote }}
|
|
ports:
|
|
{{ if $.Values.transmission.enabled }}
|
|
- targetPort: 9091
|
|
port: 9091
|
|
protocol: TCP
|
|
name: t-webui-tcp
|
|
- targetPort: 9091
|
|
port: 9091
|
|
protocol: UDP
|
|
name: t-webui-udp
|
|
- targetPort: 51413
|
|
port: 51413
|
|
protocol: TCP
|
|
name: t-torrent-tcp
|
|
- targetPort: 51413
|
|
port: 51413
|
|
protocol: UDP
|
|
name: t-torrent-udp
|
|
{{ end }}
|
|
{{ if $.Values.qbittorrent.enabled }}
|
|
- targetPort: {{ $.Values.qbittorrent.ports.webui }}
|
|
port: {{ $.Values.qbittorrent.ports.webui }}
|
|
protocol: TCP
|
|
name: q-webui-tcp
|
|
- targetPort: {{ $.Values.qbittorrent.ports.webui }}
|
|
port: {{ $.Values.qbittorrent.ports.webui }}
|
|
protocol: UDP
|
|
name: q-webui-udp
|
|
- targetPort: {{ $.Values.qbittorrent.ports.torrenting }}
|
|
port: {{ $.Values.qbittorrent.ports.torrenting }}
|
|
protocol: TCP
|
|
name: q-torrent-tcp
|
|
- targetPort: {{ $.Values.qbittorrent.ports.torrenting }}
|
|
port: {{ $.Values.qbittorrent.ports.torrenting }}
|
|
protocol: UDP
|
|
name: q-torrent-udp
|
|
{{ end }} |