charts/nzbget/templates/deployment.yaml
2020-07-26 21:10:27 +08:00

86 lines
2.4 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "nzbget.fullname" . }}
labels:
{{- include "nzbget.labels" . | nindent 4 }}
annotations:
spec:
serviceName: {{ .Chart.Name }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "nzbget.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "nzbget.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "nzbget.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: nzbg
containerPort: 6789
protocol: TCP
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: nzbg
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: nzbg
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: nzbget-config
mountPath: /config
- name: media
mountPath: /media
- name: local-download
mountPath: /downloads
volumes:
- name: media
persistentVolumeClaim:
claimName: {{ .Values.mediaPvc }}
- name: local-download
emptyDir: {}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: nzbget-config
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.config.storageClassName | quote }}
resources:
requests:
storage: {{ .Values.config.storageSize }}