|
| 1 | +{{/* |
| 2 | + Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + or more contributor license agreements. See the NOTICE file |
| 4 | + distributed with this work for additional information |
| 5 | + regarding copyright ownership. The ASF licenses this file |
| 6 | + to you under the Apache License, Version 2.0 (the |
| 7 | + "License"); you may not use this file except in compliance |
| 8 | + with the License. You may obtain a copy of the License at |
| 9 | + |
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + |
| 12 | + Unless required by applicable law or agreed to in writing, |
| 13 | + software distributed under the License is distributed on an |
| 14 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + KIND, either express or implied. See the License for the |
| 16 | + specific language governing permissions and limitations |
| 17 | + under the License. |
| 18 | +*/}} |
| 19 | + |
| 20 | +###################################### |
| 21 | +## Airflow Statsd ServiceMonitor |
| 22 | +###################################### |
| 23 | +{{- if and .Values.statsd.enabled .Values.statsd.serviceMonitor.enabled }} |
| 24 | +apiVersion: monitoring.coreos.com/v1 |
| 25 | +kind: ServiceMonitor |
| 26 | +metadata: |
| 27 | + name: {{ include "airflow.fullname" . }}-statsd |
| 28 | + namespace: {{ default .Release.Namespace .Values.statsd.serviceMonitor.namespace | quote }} |
| 29 | + labels: |
| 30 | + tier: airflow |
| 31 | + component: statsd-service-monitor |
| 32 | + release: {{ .Release.Name }} |
| 33 | + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 34 | + heritage: {{ .Release.Service }} |
| 35 | + app.kubernetes.io/component: metrics |
| 36 | + {{- with .Values.statsd.serviceMonitor.labels }} |
| 37 | + {{- toYaml . | nindent 4 }} |
| 38 | + {{- end }} |
| 39 | +spec: |
| 40 | + endpoints: |
| 41 | + - path: /metrics |
| 42 | + honorLabels: {{ .Values.statsd.serviceMonitor.honorLabels }} |
| 43 | + port: statsd-scrape |
| 44 | + {{- if .Values.statsd.serviceMonitor.interval }} |
| 45 | + interval: {{ .Values.statsd.serviceMonitor.interval }} |
| 46 | + {{- end }} |
| 47 | + {{- if .Values.statsd.serviceMonitor.scrapeTimeout }} |
| 48 | + scrapeTimeout: {{ .Values.statsd.serviceMonitor.scrapeTimeout }} |
| 49 | + {{- end }} |
| 50 | + selector: |
| 51 | + matchLabels: |
| 52 | + tier: airflow |
| 53 | + component: statsd |
| 54 | + namespaceSelector: |
| 55 | + matchNames: |
| 56 | + - {{ .Release.Namespace }} |
| 57 | +{{- end }} |
0 commit comments