blob: 1de9a8b058bc4323d7bde12081f5c0b8877b06a6 [file] [log] [blame]
Kiran Kamineni0e87f092018-09-17 15:17:18 -07001{{/*
2# Copyright 2018 Intel Corporation, Inc
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15*/}}
16
kwasield74d38f2020-07-23 10:09:57 +000017apiVersion: apps/v1
Kiran Kamineni0e87f092018-09-17 15:17:18 -070018kind: Deployment
Andreas Geissler718fb742023-03-09 09:44:02 +010019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070020spec:
Andreas Geissler718fb742023-03-09 09:44:02 +010021 selector: {{- include "common.selectors" . | nindent 4 }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070022 replicas: {{ .Values.replicaCount }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070023 template:
Andreas Geissler718fb742023-03-09 09:44:02 +010024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070025 spec:
26 initContainers:
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010027 - image: {{ include "repositoryGenerator.image.busybox" . }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070028 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
29 name: {{ include "common.name" . }}-chown-init
30 command: ["chown", "-R", "65534:65534", "{{ .Values.persistence.containerMountPath }}"]
31 volumeMounts:
32 - name: {{ include "common.fullname" . }}-storage
33 mountPath: {{ .Values.persistence.containerMountPath }}
34 containers:
35 - name: {{ include "common.name" . }}-configmap-reload
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010036 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.global.configmapReload.image.repository }}:{{ .Values.global.configmapReload.image.tag }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070037 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 args:
39 - --volume-dir=/etc/config
40 - --webhook-url=http://localhost:9090/-/reload
41 volumeMounts:
42 - name: {{ include "common.fullname" . }}-config
43 mountPath: /etc/config
44 readOnly: true
45
46 - name: {{ include "common.name" . }}-server
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010047 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070048 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49 args:
50 - --config.file=/etc/config/prometheus.yml
51 - --storage.tsdb.path={{ .Values.persistence.containerMountPath }}
52 - --web.console.libraries=/etc/prometheus/console_libraries
53 - --web.console.templates=/etc/prometheus/consoles
54 - --web.enable-lifecycle
55 {{- if .Values.server.enableAdminApi }}
56 - --web.enable-admin-api
57 {{- end }}
58 resources:
59{{ toYaml .Values.resources | indent 10 }}
Andreas Geissler718fb742023-03-09 09:44:02 +010060 ports: {{ include "common.containerPorts" . | nindent 10 }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070061 # disable liveness probe when breakpoints set in debugger
62 # so K8s doesn't restart unresponsive container
63 {{- if .Values.liveness.enabled }}
64 livenessProbe:
65 httpGet:
66 path: /-/healthy
67 port: {{ .Values.service.internalPort }}
68 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.liveness.periodSeconds }}
70 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
71 {{ end -}}
72 {{- if .Values.readiness.enabled }}
73 readinessProbe:
74 httpGet:
75 path: /-/ready
76 port: {{ .Values.service.internalPort }}
77 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
78 periodSeconds: {{ .Values.readiness.periodSeconds }}
79 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
80 {{ end -}}
81 volumeMounts:
82 - name: {{ include "common.fullname" . }}-config
83 mountPath: /etc/config
84 - name: {{ include "common.fullname" . }}-storage
85 mountPath: {{ .Values.persistence.containerMountPath }}
86 {{- if .Values.nodeSelector }}
87 nodeSelector:
88{{ toYaml .Values.nodeSelector | indent 8 }}
89 {{- end -}}
90 {{- if .Values.affinity }}
91 affinity:
92{{ toYaml .Values.affinity | indent 8 }}
93 {{- end }}
farida azmy72513552021-10-12 18:55:21 +020094 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070095 volumes:
96 - name: {{ include "common.fullname" . }}-config
97 configMap:
98 name: {{ include "common.fullname" . }}
99 - name: {{ include "common.fullname" . }}-storage
100 {{- if .Values.persistence.enabled }}
101 persistentVolumeClaim:
102 claimName: {{ include "common.fullname" . }}
103 {{- else }}
104 emptyDir: {}
105 {{- end }}
106 imagePullSecrets:
107 - name: "{{ include "common.namespace" . }}-docker-registry-key"
108 restartPolicy: Always