oecis-charts/charts/ntfy/templates/statefulset.yaml
2023-08-28 16:56:29 +02:00

89 lines
2.6 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "ntfy.fullname" . }}
labels:
{{- include "ntfy.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "ntfy.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "ntfy.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ntfy.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["serve"]
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if not (empty .Values.ntfy.extraEnv) }}
env:
{{- toYaml .Values.ntfy.extraEnv | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: "/etc/ntfy"
readOnly: true
{{- if .Values.ntfy.cache.enabled }}
- name: cache
mountPath: "/var/cache/ntfy"
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "ntfy.fullname" . }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.ntfy.cache.enabled }}
volumeClaimTemplates:
- metadata:
name: cache
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: {{ .Values.ntfy.cache.size }}
{{- end}}