Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 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 | |
kwasiel | d74d38f | 2020-07-23 10:09:57 +0000 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 18 | kind: Deployment |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 20 | spec: |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 23 | template: |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 25 | spec: |
| 26 | initContainers: |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 27 | - image: {{ include "repositoryGenerator.image.busybox" . }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 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 |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 36 | image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.global.configmapReload.image.repository }}:{{ .Values.global.configmapReload.image.tag }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 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 |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 47 | image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 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 }} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 60 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 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 }} |
farida azmy | 7251355 | 2021-10-12 18:55:21 +0200 | [diff] [blame] | 94 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Kiran Kamineni | 0e87f09 | 2018-09-17 15:17:18 -0700 | [diff] [blame] | 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 | imagePullSecrets: |
| 107 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 108 | restartPolicy: Always |