helm/prometheus-configmanager/templates/prometheus-configurer.deployment.yaml (65 lines of code) (raw):
{{/*
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/}}
{{- if .Values.prometheusConfigurer.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus-configurer
labels:
app.kubernetes.io/component: prometheus-configurer
spec:
replicas: {{ .Values.prometheusConfigurer.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: prometheus-configurer
template:
metadata:
labels:
app.kubernetes.io/component: prometheus-configurer
spec:
{{- with .Values.prometheusConfigurer.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.prometheusConfigurer.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.prometheusConfigurer.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml . | trimSuffix "\n" | indent 8 }}
{{- end }}
volumes:
- name: "prometheus-config"
{{- with .Values.volumes.prometheusConfig.volumeSpec }}
{{ toYaml .Values.volumes.prometheusConfig.volumeSpec | indent 10 }}
{{- end }}
containers:
- name: "prometheus-configurer"
image: {{ required "prometheusConfigurer.image.repository must be provided" .Values.prometheusConfigurer.image.repository }}:{{ .Values.prometheusConfigurer.image.tag }}
imagePullPolicy: {{ .Values.prometheusConfigurer.image.pullPolicy }}
ports:
- containerPort: 9100
volumeMounts:
- name: "prometheus-config"
mountPath: /etc/configs
args:
- "-port={{ .Values.prometheusConfigurer.prometheusConfigurerPort }}"
- "-rules-dir={{ .Values.prometheusConfigurer.rulesDir }}"
- "-prometheusURL={{ .Values.prometheusConfigurer.prometheusURL }}"
{{- if .Values.prometheusConfigurer.multitenantLabel }}
- "-multitenant-label={{ .Values.prometheusConfigurer.multitenantLabel }}"
{{- end }}
{{- if .Values.prometheusConfigurer.restrictQueries }}
- "-restrict-queries"
{{- end }}
resources:
{{ toYaml .Values.prometheusConfigurer.resources | indent 12 }}
{{- end }}