Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / multicloud / components / multicloud-prometheus / templates / deployment.yaml
1 {{/*
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
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers:
27       - image: {{ include "repositoryGenerator.image.busybox" . }}
28         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
36         image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.global.configmapReload.image.repository }}:{{ .Values.global.configmapReload.image.tag }}
37         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
47         image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
48         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 }}
60         ports: {{ include "common.containerPorts" . | nindent 10  }}
61         # 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 }}
94       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
95       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       {{- include "common.imagePullSecrets" . | nindent 6 }}
107       restartPolicy: Always