charts/nzbhydra/templates/statefulset.yaml
2020-07-27 22:58:12 +08:00

78 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "nzbhydra.fullname" . }}
labels:
{{- include "nzbhydra.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
serviceName: {{ include "nzbhydra.fullname" . }}
selector:
matchLabels:
{{- include "nzbhydra.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "nzbhydra.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "nzbhydra.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: hydra
containerPort: 5076
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 5076
initialDelaySeconds: 300
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 5076
initialDelaySeconds: 300
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: hydra-config
mountPath: /config
- name: hydra-tmp
mountPath: /tmp
volumes:
- name: hydra-tmp
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: hydra-config
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.config.storageClassName | quote }}
resources:
requests:
storage: {{ .Values.config.storageSize }}