Monitoring/helm/ntfy/templates/deployment.yaml
2025-04-21 19:51:09 +01:00

88 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
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"]
volumeMounts:
- mountPath: /var/cache/ntfy
name: {{ template "ntfy.name" . }}
{{- if .Values.config.enabled }}
- mountPath: /etc/ntfy/server.yml
name: {{ template "ntfy.name" . }}-conf
subPath: server.yml
readOnly: true
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
- name: metrics
containerPort: 9090
protocol: TCP
livenessProbe:
httpGet:
path: /v1/health
port: 80
readinessProbe:
httpGet:
path: /v1/health
port: 80
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
{{- if .Values.config.enabled }}
- name: {{ template "ntfy.name" . }}-conf
configMap:
name: {{ template "ntfy.name" . }}
{{- end }}
- name: {{ template "ntfy.name" . }}
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "ntfy.fullname" . }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}