mirror of
https://github.com/openappsec/openappsec.git
synced 2025-07-13 14:04:45 +03:00
52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.serviceMonitor.enabled }}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ template "kong.fullname" . }}
|
|
{{- if .Values.serviceMonitor.namespace }}
|
|
namespace: {{ .Values.serviceMonitor.namespace }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "kong.metaLabels" . | nindent 4 }}
|
|
{{- if .Values.serviceMonitor.labels }}
|
|
{{ toYaml .Values.serviceMonitor.labels | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
endpoints:
|
|
- targetPort: status
|
|
scheme: http
|
|
{{- if .Values.serviceMonitor.interval }}
|
|
interval: {{ .Values.serviceMonitor.interval }}
|
|
{{- end }}
|
|
{{- if .Values.serviceMonitor.honorLabels }}
|
|
honorLabels: true
|
|
{{- end }}
|
|
{{- if .Values.serviceMonitor.metricRelabelings }}
|
|
metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 6 }}
|
|
{{- end }}
|
|
{{- if and .Values.ingressController.enabled (semverCompare ">= 2.0.0" (include "kong.effectiveVersion" .Values.ingressController.image)) }}
|
|
- targetPort: cmetrics
|
|
scheme: http
|
|
{{- if .Values.serviceMonitor.interval }}
|
|
interval: {{ .Values.serviceMonitor.interval }}
|
|
{{- end }}
|
|
{{- if .Values.serviceMonitor.honorLabels }}
|
|
honorLabels: true
|
|
{{- end }}
|
|
{{- if .Values.serviceMonitor.metricRelabelings }}
|
|
metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 6 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
jobLabel: {{ .Release.Name }}
|
|
namespaceSelector:
|
|
matchNames:
|
|
- {{ template "kong.namespace" . }}
|
|
selector:
|
|
matchLabels:
|
|
enable-metrics: "true"
|
|
{{- include "kong.metaLabels" . | nindent 6 }}
|
|
{{- if .Values.serviceMonitor.targetLabels }}
|
|
targetLabels: {{ toYaml .Values.serviceMonitor.targetLabels | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|