apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "checkmk.fullname" . }} labels: {{- include "checkmk.labels" . | nindent 4 }} annotations: checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} spec: replicas: {{ .Values.replicaCount }} revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: matchLabels: {{- include "checkmk.selectorLabels" . | nindent 6 }} strategy: type: Recreate template: metadata: labels: {{- include "checkmk.selectorLabels" . | nindent 8 }} annotations: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: 5000 protocol: TCP - name: agent-receiver containerPort: 8000 protocol: TCP {{- if .Values.probes.startup.enabled }} startupProbe: httpGet: path: {{ include "checkmk.probePath" . }} port: http initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }} periodSeconds: {{ .Values.probes.startup.periodSeconds }} timeoutSeconds: {{ .Values.probes.startup.timeoutSeconds }} failureThreshold: {{ .Values.probes.startup.failureThreshold }} successThreshold: {{ .Values.probes.startup.successThreshold }} {{- end }} {{- if .Values.probes.liveness.enabled }} livenessProbe: httpGet: path: {{ include "checkmk.probePath" . }} port: http periodSeconds: {{ .Values.probes.liveness.periodSeconds }} timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }} failureThreshold: {{ .Values.probes.liveness.failureThreshold }} successThreshold: {{ .Values.probes.liveness.successThreshold }} {{- end }} {{- if .Values.probes.readiness.enabled }} readinessProbe: httpGet: path: {{ include "checkmk.probePath" . }} port: http periodSeconds: {{ .Values.probes.readiness.periodSeconds }} timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} failureThreshold: {{ .Values.probes.readiness.failureThreshold }} successThreshold: {{ .Values.probes.readiness.successThreshold }} {{- end }} env: - name: CMK_PASSWORD valueFrom: secretKeyRef: name: {{ include "checkmk.secretName" . }} key: {{ .Values.config.adminPassword.passwordKey }} - name: CMK_SITE_ID value: {{ .Values.config.siteId | quote }} - name: TZ value: {{ .Values.config.timezone | quote }} {{- if .Values.config.livestatusTcp }} - name: CMK_LIVESTATUS_TCP value: "on" {{- end }} {{- if .Values.config.mailRelayHost }} - name: MAIL_RELAY_HOST value: {{ .Values.config.mailRelayHost | quote }} {{- end }} {{- with .Values.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: - name: sites mountPath: /omd/sites # tmpfs for site temp dir — improves performance by using host RAM # equivalent to Docker's --tmpfs /opt/omd/sites//tmp:uid=1000,gid=1000 - name: tmp mountPath: {{ include "checkmk.tmpPath" . }} {{- with .Values.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumes: {{- if .Values.persistence.enabled }} - name: sites persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{ else }}{{ include "checkmk.fullname" . }}-sites{{ end }} {{- else }} - name: sites emptyDir: {} {{- end }} - name: tmp emptyDir: medium: Memory {{- with .Values.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}