2025-04-21 16:53:37 +01:00

124 lines
4.1 KiB
YAML

{{- if not .Values.useDeploy -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "uptime-kuma.fullname" . }}
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
spec:
serviceName: {{ include "uptime-kuma.fullname" . }}
replicas: 1
selector:
matchLabels:
{{- include "uptime-kuma.selectorLabels" . | nindent 6 }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 6 }}
{{- end }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "uptime-kuma.selectorLabels" . | nindent 8 }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
spec:
automountServiceAccountToken: {{ include "uptime-kuma.automountServiceAccountToken" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
serviceAccountName: {{ include "uptime-kuma.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }}
{{- end }}
{{- if .Values.dnsConfig }}
dnsConfig:
{{- toYaml .Values.dnsConfig | nindent 8 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: "UPTIME_KUMA_PORT"
value: {{ include "uptime-kuma.port" . | quote }}
{{- with .Values.podEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ include "uptime-kuma.port" . }}
protocol: TCP
{{ if or .Values.volume.enabled .Values.additionalVolumeMounts -}}
volumeMounts:
{{- if .Values.volume.enabled }}
- mountPath: /app/data
name: storage
{{- end -}}
{{ with .Values.additionalVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
exec:
command:
- extra/healthcheck
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds}}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds}}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /
port: {{ include "uptime-kuma.port" . }}
scheme: HTTP
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds}}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.additionalVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.volume.enabled -}}
volumeClaimTemplates:
- metadata:
name: storage
spec:
accessModes:
- {{ .Values.volume.accessMode }}
resources:
requests:
storage: {{ .Values.volume.size }}
{{- with .Values.volume.storageClassName }}
storageClassName: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}