charts/sonarr/templates/statefulset.yaml
2020-09-27 14:50:37 +08:00

75 lines
2.1 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "sonarr.fullname" . }}
labels:
{{- include "sonarr.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
serviceName: {{ include "sonarr.fullname" . }}
selector:
matchLabels:
{{- include "sonarr.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "sonarr.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "sonarr.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: sonarr
containerPort: 8989
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 8989
readinessProbe:
httpGet:
path: /
port: 8989
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: sonarr-config
mountPath: /config
- name: sonarr-media
mountPath: /tv
subPath: tv
- name: sonarr-media
mountPath: /tv-kids
subPath: tv-kids
volumes:
- emptyDir: {}
name: sonarr-local-config
- name: sonarr-media
persistentVolumeClaim:
claimName: {{ .Values.mediaPvc }}
- name: sonarr-config
persistentVolumeClaim:
claimName: {{ .Values.config.configPvc }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}