uptime-kuma/templates/statefulset.yaml

116 lines
3.6 KiB
YAML
Raw Normal View History

2024-06-10 02:34:13 +00:00
{{- 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" . }}
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:
{{- 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 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.podEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 3001
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: 3001
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 -}}