### Install and run helm test for uptime-kuma Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/auxiliary.md Example commands to install the chart and run helm test. The test pod succeeds and reports PASSED. ```bash helm install my-uptime-kuma uptime-kuma/uptime-kuma --namespace monitoring --create-namespace helm test my-uptime-kuma --namespace monitoring # Pod my-uptime-kuma-uptime-kuma-test-connection succeeds → "PASSED" ``` -------------------------------- ### Install Uptime-Kuma chart with Helm Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/README.md Installs or upgrades the Uptime-Kuma chart in the 'monitoring' namespace, creating it if necessary. Use this command to deploy the chart. ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install --namespace monitoring --create-namespace ``` -------------------------------- ### Add Uptime-Kuma Helm repository Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/README.md Adds the Uptime-Kuma Helm repository to your Helm configuration. Run this once before installing the chart. ```bash helm repo add uptime-kuma https://helm.irsigler.cloud ``` -------------------------------- ### Configure additionalVolumes and additionalVolumeMounts Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/configuration.md Example from values.yaml comments showing how to mount an additional ConfigMap as a volume and mount it into the container. The volume is optional and mounted read-only at /etc/ssl/certs/additional/additional-ca.pem with subPath additional-ca.pem. ```yaml additionalVolumes: - name: "additional-certificates" configMap: name: "additional-certificates" optional: true defaultMode: 420 additionalVolumeMounts: - name: "additional-certificates" mountPath: "/etc/ssl/certs/additional/additional-ca.pem" readOnly: true subPath: "additional-ca.pem" ``` -------------------------------- ### Enable ServiceMonitor with basic auth and verify resources Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/servicemonitor.md Example values file enabling ServiceMonitor scraping with basic auth (Uptime Kuma's API token as password), followed by the helm upgrade command that applies it and a kubectl command to verify the created ServiceMonitor and Secret resources. ```yaml # values-servicemonitor.yaml serviceMonitor: enabled: true interval: 30s scrapeTimeout: 10s selector: release: kube-prometheus-stack additionalLabels: team: observability basicAuth: username: "metrics" password: "uptime-kuma-api-token" ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f values-servicemonitor.yaml ``` ```bash kubectl get servicemonitor,secret -n monitoring -l app.kubernetes.io/name=uptime-kuma ``` -------------------------------- ### Apply configuration with helm upgrade Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/configuration.md Commands to apply configuration to the Uptime Kuma Helm chart. Use -f for a values file, --set for inline overrides, and the last command installs with all defaults in a new namespace. ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f my-values.yaml ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install \ --set useDeploy=false \ --set volume.size=8Gi \ --set externalDatabase.enabled=true \ --set externalDatabase.hostname=db.internal ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install --namespace monitoring --create-namespace ``` -------------------------------- ### Helm upgrade command with values file Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/service.md Command to upgrade or install the Uptime Kuma chart using the values-service.yaml file. ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f values-service.yaml ``` -------------------------------- ### NodePort service values Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/service.md Example values for a NodePort service. The nodePort is emitted only when set. ```yaml service: type: NodePort port: 3001 nodePort: 30080 ``` -------------------------------- ### LoadBalancer service values with annotations (values-service.yaml) Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/service.md Example values for a LoadBalancer service with a pinned IP and annotations, e.g., for MetalLB. The loadBalancerIP is emitted only when set. ```yaml # values-service.yaml service: type: LoadBalancer port: 3001 loadBalancerIP: 192.168.1.50 annotations: metallb.universe.tf/address-pool: public ``` -------------------------------- ### Persistent storage with custom storage class and helm template command Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/pvc.md Example values file for persistent storage in Deployment mode with a custom storage class, followed by the helm template command to render the PVC template. The command uses --show-only templates/pvc.yaml to display only the PVC document. ```yaml # values-pvc.yaml useDeploy: true volume: enabled: true size: 10Gi accessMode: ReadWriteOnce storageClassName: "fast-ssd" ``` ```bash helm template my-uptime-kuma uptime-kuma/uptime-kuma -f values-pvc.yaml --show-only templates/pvc.yaml ``` -------------------------------- ### Create annotated ServiceAccount with values file and Helm commands Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/service-account.md Example of creating an annotated ServiceAccount for IAM/IRSA-style usage on cloud clusters. The values file sets serviceAccount.create to true, a custom name, and an annotation for the AWS role ARN. The commands upgrade the Helm release with the values file and verify the ServiceAccount exists. ```yaml # values-sa.yaml serviceAccount: create: true name: "uptime-kuma-monitoring" annotations: eks.amazonaws.com/role-arn: "arn:aws:iam::123456789012:role/uptime-kuma" ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f values-sa.yaml kubectl get serviceaccount uptime-kuma-monitoring -n monitoring ``` -------------------------------- ### Use default ServiceAccount with Helm upgrade command Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/service-account.md Example of using the default account explicitly with no values file. The Helm upgrade command installs the chart in the monitoring namespace. The comment notes that the pod spec uses serviceAccountName: default and automountServiceAccountToken renders as an empty/null value (unset). ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install --namespace monitoring # pod spec: serviceAccountName: default; automountServiceAccountToken renders as an empty/null value (unset) ``` -------------------------------- ### Deployment template for readinessProbe, resources, and volumes Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/deployment.md Helm template fragment for the Uptime Kuma deployment. It renders readinessProbe, resources, nodeSelector, affinity, tolerations, and volumes sections based on values. The readinessProbe supports either exec or httpGet, and volumes include a persistentVolumeClaim named with the fullname template unless an existingClaim is provided. ```yaml {{- end }} {{- end }} {{- end }} readinessProbe: {{- if .Values.readinessProbe.enabled }} initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} failureThreshold: {{ .Values.readinessProbe.failureThreshold }} successThreshold: {{ .Values.readinessProbe.successThreshold }} {{- if .Values.readinessProbe.exec.command }} exec: command: {{- toYaml .Values.readinessProbe.exec.command | nindent 16 }} {{- else if .Values.readinessProbe.httpGet.path }} httpGet: path: {{ .Values.readinessProbe.httpGet.path }} port: {{ .Values.readinessProbe.httpGet.port }} scheme: {{ .Values.readinessProbe.httpGet.scheme }} {{- if .Values.readinessProbe.httpGet.httpHeaders }} httpHeaders: {{- toYaml .Values.readinessProbe.httpGet.httpHeaders | nindent 16 }} {{- end }} {{- end }} {{- 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 }} {{ if or .Values.volume.enabled .Values.additionalVolumes -}} volumes: {{- if .Values.volume.enabled }} - name: storage persistentVolumeClaim: {{- if not .Values.volume.existingClaim }} claimName: {{ include "uptime-kuma.fullname" . }}-pvc {{- else }} claimName: {{ .Values.volume.existingClaim }} {{- end }} {{- end -}} {{- with .Values.additionalVolumes }} {{- toYaml . | nindent 6 }} {{- end }} {{- end -}} {{- end -}} ``` -------------------------------- ### Print application URL commands based on service type Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/charts/uptime-kuma/templates/NOTES.txt Helm NOTES.txt template that outputs the correct URL or port-forward command based on the ingress and service configuration. For Ingress it prints the configured hosts/paths; for NodePort, LoadBalancer, and ClusterIP it exports environment variables using kubectl commands and prints the resulting URL. The ClusterIP branch also includes a port-forward command to http://127.0.0.1:3001. ```Go template {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "uptime-kuma.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "uptime-kuma.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "uptime-kuma.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}" }}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "uptime-kuma.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:3001 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3001:$CONTAINER_PORT {{- end }} ``` -------------------------------- ### Reusing a pre-provisioned claim Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/pvc.md Example values file for reusing a pre-provisioned claim. When existingClaim is set, no PVC is rendered and the Deployment references the existing claim directly via claimName. ```yaml useDeploy: true volume: enabled: true existingClaim: "uptime-kuma-data" ``` -------------------------------- ### Deployment template (deployment.yaml) Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/deployment.md Full Helm template for the Kubernetes Deployment workload. Renders only when .Values.useDeploy is true; otherwise it produces zero documents and the StatefulSet template is used instead. Includes conditional blocks for podLabels, strategy, podAnnotations, imagePullSecrets, dnsPolicy, dnsConfig, priorityClassName, podEnv, externalDatabase environment variables, volume mounts, and livenessProbe. ```yaml {{- if .Values.useDeploy -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "uptime-kuma.fullname" . }} namespace: {{ include "uptime-kuma.namespace" . }} labels: {{- include "uptime-kuma.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: {{- include "uptime-kuma.selectorLabels" . | nindent 6 }} {{- if .Values.podLabels }} {{- toYaml .Values.podLabels | nindent 6 }} {{- end }} {{- with .Values.strategy }} strategy: {{- toYaml . | nindent 4 }} {{- 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 }} 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: {{- with .Values.podEnv }} {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.externalDatabase.enabled }} - name: UPTIME_KUMA_DB_TYPE value: "{{ .Values.externalDatabase.type }}" - name: UPTIME_KUMA_DB_HOSTNAME value: "{{ .Values.externalDatabase.hostname }}" - name: UPTIME_KUMA_DB_PORT value: "{{ .Values.externalDatabase.port }}" - name: UPTIME_KUMA_DB_NAME value: "{{ .Values.externalDatabase.database }}" - name: UPTIME_KUMA_DB_USERNAME {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: name: "{{ .Values.externalDatabase.existingSecret }}" key: "{{ .Values.externalDatabase.existingSecretUsernameKey }}" {{- else }} value: "{{ .Values.externalDatabase.username }}" {{- end }} - name: UPTIME_KUMA_DB_PASSWORD {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: name: "{{ .Values.externalDatabase.existingSecret }}" key: "{{ .Values.externalDatabase.existingSecretPasswordKey }}" {{- else }} value: "{{ .Values.externalDatabase.password }}" {{- end }} {{- 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: {{- if .Values.livenessProbe.enabled }} initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} failureThreshold: {{ .Values.livenessProbe.failureThreshold }} successThreshold: {{ .Values.livenessProbe.successThreshold }} {{- if .Values.livenessProbe.exec.command }} exec: command: {{- toYaml .Values.livenessProbe.exec.command | nindent 16 }} ``` -------------------------------- ### Configure HTTPS scrape with TLS config Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/servicemonitor.md Example values configuration for HTTPS scraping with TLS verification. Sets scheme to https and provides a CA certificate from a Kubernetes secret named kuma-ca with key ca.crt, with insecureSkipVerify set to false. ```yaml serviceMonitor: enabled: true scheme: https tlsConfig: insecureSkipVerify: false ca: secret: name: kuma-ca key: ca.crt ``` -------------------------------- ### uptime-kuma.fullname Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/helpers.md Creates a fully qualified app name, truncated to 63 characters. Resolution order: `fullnameOverride` if set, then `.Release.Name` if it contains the chart name, otherwise `-`. ```APIDOC ## uptime-kuma.fullname ### Description Creates a fully qualified app name, truncated to 63 characters. Resolution order: `fullnameOverride` if set, then `.Release.Name` if it contains the chart name, otherwise `-`. ### Parameters - `.` (context) - Required - Root template context (`.Values`, `.Release`, `.Chart`, etc.) ### Returns - **String** - Fully qualified app name ### Usage Used for metadata `name`/`namespace` in resource templates, PVC name suffix, NetworkPolicy client label, ServiceMonitor secret name, and test pod name. ### Example ```gotemplate {{ include "uptime-kuma.fullname" . }} ``` ``` -------------------------------- ### NOTES.txt: Print access URL based on ingress/service type Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/auxiliary.md Helm template for NOTES.txt that prints the application URL based on networking configuration. Branches on ingress.enabled, service.type (NodePort, LoadBalancer, ClusterIP) and uses helpers uptime-kuma.fullname and uptime-kuma.name. For ClusterIP it prints a port-forward command to 3001. ```txt 1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "uptime-kuma.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "uptime-kuma.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "uptime-kuma.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}" }}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "uptime-kuma.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:3001 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3001:$CONTAINER_PORT {{- end }} ``` -------------------------------- ### TLS-terminated ingress with cert-manager annotation and Helm deployment Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/ingress.md Configure a TLS-terminated ingress with cert-manager annotation for two hosts, deploy with Helm, and see the rendered Ingress resource (abridged, K8s ≥ 1.19). The values file sets className to nginx and uses the cert-manager.io/cluster-issuer annotation. The Helm command installs the chart with the values file. The rendered output shows the resulting Ingress with ingressClassName, TLS secret, and backend service on port 3001. ```yaml # values-ingress.yaml ingress: enabled: true className: "nginx" annotations: cert-manager.io/cluster-issuer: letsencrypt-prod hosts: - host: uptime-kuma.example.com paths: - path: / pathType: Prefix tls: - secretName: uptime-kuma-tls hosts: - uptime-kuma.example.com ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f values-ingress.yaml ``` ```yaml kind: Ingress spec: ingressClassName: nginx tls: - hosts: ["uptime-kuma.example.com"] secretName: uptime-kuma-tls rules: - host: "uptime-kuma.example.com" http: paths: - path: / pathType: Prefix backend: service: name: my-uptime-kuma-uptime-kuma port: number: 3001 ``` -------------------------------- ### External MariaDB with existing secret and custom resources Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/deployment.md External MariaDB configuration with credentials from an existing secret and custom resources. The rendered env for the container then contains (in order): any podEnv, then UPTIME_KUMA_DB_TYPE=mariadb, UPTIME_KUMA_DB_HOSTNAME=mariadb.internal, UPTIME_KUMA_DB_PORT=3306, UPTIME_KUMA_DB_NAME=uptime_kuma, and UPTIME_KUMA_DB_USERNAME/UPTIME_KUMA_DB_PASSWORD via secretKeyRef. ```yaml # values-external-db.yaml useDeploy: true externalDatabase: enabled: true type: "mariadb" hostname: "mariadb.internal" port: 3306 database: uptime_kuma existingSecret: "uptime-kuma-db-credentials" existingSecretUsernameKey: "username" existingSecretPasswordKey: "password" resources: limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f values-external-db.yaml ``` -------------------------------- ### Deploy StatefulSet with custom storage and readiness headers Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/statefulset.md Deploy Uptime Kuma as a StatefulSet with persistent storage, custom size and storage class, custom readiness headers, and a RollingUpdate strategy. The YAML values file is passed to the helm upgrade command with -f values-statefulset.yaml. ```yaml # values-statefulset.yaml useDeploy: false volume: enabled: true size: 8Gi accessMode: ReadWriteOnce storageClassName: "fast-ssd" readinessProbe: httpGet: path: / port: 3001 scheme: HTTP httpHeaders: - name: Host value: uptime-kuma.internal strategy: type: RollingUpdate rollingUpdate: partition: 0 ``` ```bash helm upgrade my-uptime-kuma uptime-kuma/uptime-kuma --install -f values-statefulset.yaml ``` -------------------------------- ### StatefulSet template (statefulset.yaml) Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/statefulset.md Full Helm template for the StatefulSet resource. It is rendered only when `.Values.useDeploy` is `false`; when `useDeploy` is `true`, the Deployment template is used instead. The template includes volume mounts for `/app/data` when `.Values.volume.enabled` is true, and conditionally adds external database environment variables when `.Values.externalDatabase.enabled` is true. ```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 {{- with .Values.strategy }} updateStrategy: {{- toYaml . | nindent 4 }} {{- end }} 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 }} {{- if .Values.externalDatabase.enabled }} - name: UPTIME_KUMA_DB_TYPE value: "{{ .Values.externalDatabase.type }}" - name: UPTIME_KUMA_DB_HOSTNAME value: "{{ .Values.externalDatabase.hostname }}" - name: UPTIME_KUMA_DB_PORT value: "{{ .Values.externalDatabase.port }}" - name: UPTIME_KUMA_DB_NAME value: "{{ .Values.externalDatabase.database }}" - name: UPTIME_KUMA_DB_USERNAME {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: name: "{{ .Values.externalDatabase.existingSecret }}" key: "{{ .Values.externalDatabase.existingSecretUsernameKey }}" {{- else }} value: "{{ .Values.externalDatabase.username }}" {{- end }} - name: UPTIME_KUMA_DB_PASSWORD {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: name: "{{ .Values.externalDatabase.existingSecret }}" key: "{{ .Values.externalDatabase.existingSecretPasswordKey }}" {{- else }} value: "{{ .Values.externalDatabase.password }}" {{- end }} {{- 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: {{- if .Values.livenessProbe.enabled }} initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} failureThreshold: {{ .Values.livenessProbe.failureThreshold }} ``` -------------------------------- ### ServiceAccount template (serviceaccount.yaml) Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/service-account.md Full template source for the ServiceAccount. Renders a Kubernetes ServiceAccount (v1) only when .Values.serviceAccount.create is true; otherwise renders nothing. Includes labels from the uptime-kuma.labels helper and optional annotations from .Values.serviceAccount.annotations. ```yaml {{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "uptime-kuma.serviceAccountName" . }} namespace: {{ include "uptime-kuma.namespace" . }} labels: {{- include "uptime-kuma.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} ``` -------------------------------- ### uptime-kuma.labels Source: https://github.com/dirsigler/uptime-kuma-helm/blob/main/_autodocs/api-reference/helpers.md Returns a set of common Kubernetes labels for resources. ```APIDOC ## uptime-kuma.labels ### Description Returns a set of common Kubernetes labels for resources. ### Parameters - `.` (context) - Required - Root template context (`.Values`, `.Release`, `.Chart`, etc.) ### Returns - **Label set** - Includes `helm.sh/chart`, `app.kubernetes.io/name`, `app.kubernetes.io/instance`, `app.kubernetes.io/version` (if appVersion set), and `app.kubernetes.io/managed-by`. ### Usage Used as metadata labels on Deployment, StatefulSet, Service, Ingress, PVC, NetworkPolicy, ServiceAccount, ServiceMonitor, and test pod. ### Example ```gotemplate {{ include "uptime-kuma.labels" . }} ``` ```