apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "rtorrent-flood.fullname" . }} labels: app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }} helm.sh/chart: {{ include "rtorrent-flood.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- if .Values.podAnnotations }} annotations: {{- range $key, $value := .Values.podAnnotations }} {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} spec: replicas: 1 strategy: type: {{ .Values.strategyType }} selector: matchLabels: app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: containers: - 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 tty: true livenessProbe: tcpSocket: port: bt readinessProbe: tcpSocket: port: bt periodSeconds: 10 successThreshold: 1 failureThreshold: 3 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 {{- if .Values.persistence.data.subPath }} subPath: {{ .Values.persistence.data.subPath }}/.session {{- else }} subPath: .session {{ end }} - mountPath: /socket name: socket resources: {{ toYaml .Values.rtorrent.resources | indent 12 }} - 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 livenessProbe: httpGet: port: http initialDelaySeconds: 60 failureThreshold: 5 timeoutSeconds: 15 readinessProbe: httpGet: port: http initialDelaySeconds: 60 failureThreshold: 5 timeoutSeconds: 20 # tty: true env: - name: TZ value: "{{ .Values.timezone }}" - name: FLOOD_SECRET value: "{{ .Values.floodSecret }}" - name: RTORRENT_SOCK value: "true" volumeMounts: - mountPath: /data name: data {{- if .Values.persistence.data.subPath }} subPath: {{ .Values.persistence.data.subPath }} {{ end }} - mountPath: /tmp name: socket resources: {{ toYaml .Values.flood.resources | indent 12 }} volumes: - 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 }} {{- else }} emptyDir: {} {{ end }} - name: data {{- if .Values.persistence.data.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.data.existingClaim }}{{ .Values.persistence.data.existingClaim }}{{- else }}{{ template "rtorrent-flood.fullname" . }}-data{{- end }} {{- else }} emptyDir: {} {{ end }} - name: socket emptyDir: {} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }}