2019-01-30 00:21:25 +00:00
|
|
|
apiVersion: apps/v1
|
2019-03-10 11:49:42 +00:00
|
|
|
kind: StatefulSet
|
2019-01-30 00:21:25 +00:00
|
|
|
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 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
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 }}
|
|
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: 3000
|
|
|
|
protocol: TCP
|
|
|
|
- name: bt
|
|
|
|
containerPort: 49184
|
|
|
|
protocol: TCP
|
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
port: http
|
|
|
|
scheme: HTTP
|
|
|
|
initialDelaySeconds: 30
|
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
|
|
|
port: http
|
|
|
|
scheme: HTTP
|
|
|
|
initialDelaySeconds: 15
|
|
|
|
tty: true
|
|
|
|
env:
|
|
|
|
- name: TZ
|
|
|
|
value: "{{ .Values.timezone }}"
|
|
|
|
- name: FLOOD_SECRET
|
|
|
|
value: "{{ .Values.floodSecret }}"
|
|
|
|
- name: UID
|
|
|
|
value: "{{ .Values.uid }}"
|
|
|
|
- name: GID
|
|
|
|
value: "{{ .Values.gid }}"
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /flood-db
|
|
|
|
name: flood-db
|
|
|
|
- mountPath: /data
|
|
|
|
name: data
|
|
|
|
{{- if .Values.persistence.data.subPath }}
|
|
|
|
subPath: {{ .Values.persistence.data.subPath }}
|
|
|
|
{{ end }}
|
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.resources | indent 12 }}
|
|
|
|
volumes:
|
|
|
|
- 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 }}
|
2019-03-10 17:18:39 +00:00
|
|
|
{{- if and .Values.persistence.config.enabled .Values.persistence.config.existingClaim }}
|
|
|
|
- name: flood-db
|
|
|
|
{{- if .Values.persistence.config.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ .Values.persistence.config.existingClaim }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{- end }}
|
|
|
|
{{- else if not .Values.persistence.config.enabled }}
|
|
|
|
- name: flood-db
|
|
|
|
emptyDir: {}
|
|
|
|
{{- else if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }}
|
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: flood-db
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }}
|
|
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- {{ .Values.persistence.config.accessMode | quote }}
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: {{ .Values.persistence.config.size | quote }}
|
|
|
|
{{- if .Values.persistence.config.storageClass }}
|
|
|
|
{{- if (eq "-" .Values.persistence.config.storageClass) }}
|
|
|
|
storageClassName: ""
|
|
|
|
{{- else }}
|
|
|
|
storageClassName: "{{ .Values.persistence.config.storageClass }}"
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2019-01-30 00:21:25 +00:00
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{- end }}
|