agones.dev/agones@v1.53.0/install/helm/agones/templates/service-monitor.yaml (about)

     1  {{- if and (.Values.agones.metrics.prometheusEnabled) (.Values.agones.metrics.serviceMonitor.enabled) }}
     2  # Copyright 2018 Google LLC All Rights Reserved.
     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  apiVersion: monitoring.coreos.com/v1
    16  kind: ServiceMonitor
    17  metadata:
    18    name: agones-controller-monitor
    19    namespace: {{ .Release.Namespace }}
    20    labels:
    21      app: {{ template "agones.name" . }}
    22      chart: {{ template "agones.chart" . }}
    23      release: {{ .Release.Name }}
    24      heritage: {{ .Release.Service }}
    25  spec:
    26    selector:
    27      matchExpressions:
    28        - key: agones.dev/role
    29          operator: In
    30          values:
    31            - controller
    32            - extensions
    33    endpoints:
    34      - port: metrics
    35        path: /metrics
    36        interval: {{ .Values.agones.metrics.serviceMonitor.interval }}
    37        relabelings:
    38          - action: labelmap
    39            regex: __meta_kubernetes_pod_label_(.+)
    40          - sourceLabels: [__meta_kubernetes_namespace]
    41            action: replace
    42            targetLabel: kubernetes_namespace
    43          - sourceLabels: [__meta_kubernetes_pod_name]
    44            action: replace
    45            targetLabel: kubernetes_pod_name
    46  {{- end }}