{{- if .Values.checker.enabled }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "uptimesebi.fullname" . }}-checker labels: {{- include "uptimesebi.labels" . | nindent 4 }} app.kubernetes.io/component: checker spec: replicas: {{ .Values.checker.replicas }} selector: matchLabels: {{- include "uptimesebi.selector" (list . "checker") | nindent 6 }} template: metadata: labels: {{- include "uptimesebi.selector" (list . "checker") | nindent 8 }} annotations: checksum/secret: {{ include "uptimesebi.secretData" . | sha256sum }} {{- with .Values.checker.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} spec: automountServiceAccountToken: false {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- if .Values.checker.pingSysctl }} sysctls: # A safe sysctl: unprivileged ICMP sockets for ping monitors. - name: net.ipv4.ping_group_range value: "0 2147483647" {{- end }} # Checks may take a while; the checker hands its queue back on SIGTERM. terminationGracePeriodSeconds: 40 containers: - name: checker image: {{ include "uptimesebi.image" (list . "-checker") }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: UPTIME_API_URL value: {{ .Values.checker.apiURL | default (include "uptimesebi.apiURL" .) | quote }} {{- if not (or .Values.checker.token .Values.checker.existingSecret) }} {{- fail "checker.enabled needs checker.token or checker.existingSecret (see values.yaml)" }} {{- end }} {{- include "uptimesebi.secretEnv" (list (include "uptimesebi.secretName" .) "UPTIME_AGENT_TOKEN" .Values.checker.existingSecret .Values.checker.existingSecretKey "checker-token") | nindent 12 }} - name: UPTIME_CHECKER_CONCURRENCY value: {{ .Values.checker.concurrency | quote }} - name: UPTIME_LOG_LEVEL value: {{ .Values.logLevel | quote }} {{- with .Values.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} ports: - name: health containerPort: 8081 livenessProbe: httpGet: {path: /healthz, port: health} periodSeconds: 10 readinessProbe: httpGet: {path: /readyz, port: health} periodSeconds: 10 securityContext: {{- toYaml .Values.securityContext | nindent 12 }} resources: {{- toYaml .Values.checker.resources | nindent 12 }} volumeMounts: - name: tmp mountPath: /tmp volumes: {{- include "uptimesebi.tmpVolume" . | nindent 8 }} {{- with .Values.checker.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.checker.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.checker.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- end }}