{{- if not .Values.useDeploy -}} apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "uptime-kuma.fullname" . }} labels: {{- include "uptime-kuma.labels" . | nindent 4 }} spec: serviceName: {{ include "uptime-kuma.fullname" . }} {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "uptime-kuma.selectorLabels" . | nindent 6 }} {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 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 | indent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} enableServiceLinks: false serviceAccountName: {{ include "uptime-kuma.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 }} ports: - name: http containerPort: 3001 protocol: TCP {{ if .Values.volume.enabled -}} volumeMounts: - mountPath: /app/data name: storage {{ end }} livenessProbe: exec: command: - node - extra/healthcheck.js readinessProbe: httpGet: path: / port: 3001 scheme: HTTP 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 }} {{ if .Values.volume.enabled -}} volumeClaimTemplates: - metadata: name: storage spec: accessModes: - {{ .Values.volume.accessMode }} resources: requests: storage: {{ .Values.volume.size }} storageClassName: {{ .Values.volume.storageClassName | default "standard" }} volumeMode: Filesystem {{- end -}} {{- end -}}