blob: c60237d6a78f79247f6e73f80ac2e4db617249df [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
Kiran Kamineni60f72472018-12-18 13:30:38 -080017{{- if .Values.global.prometheus.enabled -}}
18
Kiran Kamineni0e87f092018-09-17 15:17:18 -070019apiVersion: extensions/v1beta1
20kind: Deployment
21metadata:
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
24 labels:
25 app: {{ include "common.name" . }}
26 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010027 release: {{ include "common.release" . }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070028 heritage: {{ .Release.Service }}
29spec:
30 replicas: {{ .Values.replicaCount }}
31 selector:
32 matchLabels:
33 app: {{ include "common.name" . }}
34 template:
35 metadata:
36 labels:
37 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010038 release: {{ include "common.release" . }}
Kiran Kamineni0e87f092018-09-17 15:17:18 -070039 name: {{ include "common.name" . }}
40 spec:
41 initContainers:
42 - image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
43 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44 name: {{ include "common.name" . }}-chown-init
45 command: ["chown", "-R", "65534:65534", "{{ .Values.persistence.containerMountPath }}"]
46 volumeMounts:
47 - name: {{ include "common.fullname" . }}-storage
48 mountPath: {{ .Values.persistence.containerMountPath }}
49 containers:
50 - name: {{ include "common.name" . }}-configmap-reload
51 image: "{{ .Values.global.configmapReload.image.repository }}:{{ .Values.global.configmapReload.image.tag }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 args:
54 - --volume-dir=/etc/config
55 - --webhook-url=http://localhost:9090/-/reload
56 volumeMounts:
57 - name: {{ include "common.fullname" . }}-config
58 mountPath: /etc/config
59 readOnly: true
60
61 - name: {{ include "common.name" . }}-server
62 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
63 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 args:
65 - --config.file=/etc/config/prometheus.yml
66 - --storage.tsdb.path={{ .Values.persistence.containerMountPath }}
67 - --web.console.libraries=/etc/prometheus/console_libraries
68 - --web.console.templates=/etc/prometheus/consoles
69 - --web.enable-lifecycle
70 {{- if .Values.server.enableAdminApi }}
71 - --web.enable-admin-api
72 {{- end }}
73 resources:
74{{ toYaml .Values.resources | indent 10 }}
75 ports:
76 - containerPort: {{ .Values.service.internalPort }}
77 # disable liveness probe when breakpoints set in debugger
78 # so K8s doesn't restart unresponsive container
79 {{- if .Values.liveness.enabled }}
80 livenessProbe:
81 httpGet:
82 path: /-/healthy
83 port: {{ .Values.service.internalPort }}
84 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
85 periodSeconds: {{ .Values.liveness.periodSeconds }}
86 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
87 {{ end -}}
88 {{- if .Values.readiness.enabled }}
89 readinessProbe:
90 httpGet:
91 path: /-/ready
92 port: {{ .Values.service.internalPort }}
93 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
96 {{ end -}}
97 volumeMounts:
98 - name: {{ include "common.fullname" . }}-config
99 mountPath: /etc/config
100 - name: {{ include "common.fullname" . }}-storage
101 mountPath: {{ .Values.persistence.containerMountPath }}
102 {{- if .Values.nodeSelector }}
103 nodeSelector:
104{{ toYaml .Values.nodeSelector | indent 8 }}
105 {{- end -}}
106 {{- if .Values.affinity }}
107 affinity:
108{{ toYaml .Values.affinity | indent 8 }}
109 {{- end }}
110 volumes:
111 - name: {{ include "common.fullname" . }}-config
112 configMap:
113 name: {{ include "common.fullname" . }}
114 - name: {{ include "common.fullname" . }}-storage
115 {{- if .Values.persistence.enabled }}
116 persistentVolumeClaim:
117 claimName: {{ include "common.fullname" . }}
118 {{- else }}
119 emptyDir: {}
120 {{- end }}
121 imagePullSecrets:
122 - name: "{{ include "common.namespace" . }}-docker-registry-key"
123 restartPolicy: Always
Kiran Kamineni60f72472018-12-18 13:30:38 -0800124
125{{- end -}}