k8s.io/perf-tests/clusterloader2@v0.0.0-20240304094227-64bdb12da87e/pkg/prometheus/manifests/master-ip/master-serviceMonitor.yaml (about)

     1  {{$PROMETHEUS_SCRAPE_ETCD := DefaultParam .PROMETHEUS_SCRAPE_ETCD false}}
     2  {{$PROMETHEUS_SCRAPE_MASTER_KUBELETS := DefaultParam .PROMETHEUS_SCRAPE_MASTER_KUBELETS false}}
     3  {{$PROMETHEUS_SCRAPE_NODE_EXPORTER := DefaultParam .PROMETHEUS_SCRAPE_NODE_EXPORTER false}}
     4  
     5  # If kube-apiserver is overloaded, we might get slower responses.
     6  {{$PROMETHEUS_SLOW_APISERVER := DefaultParam .CL2_PROMETHEUS_SLOW_APISERVER false}}
     7  
     8  apiVersion: monitoring.coreos.com/v1
     9  kind: ServiceMonitor
    10  metadata:
    11    labels:
    12      k8s-app: master
    13    name: master
    14    namespace: monitoring
    15  spec:
    16    endpoints:
    17    {{if $PROMETHEUS_SCRAPE_ETCD}}
    18    - interval: 5s
    19      port: etcd-2379
    20    - interval: 5s
    21      port: etcd-2382
    22    {{end}}
    23    {{if $PROMETHEUS_SCRAPE_NODE_EXPORTER}}
    24    # TODO(mborsz): Debug why node-exporter is that slow and change interval back to 5s.
    25    - interval: 30s
    26      port: node-exporter
    27      scrapeTimeout: 20s
    28    {{end}}
    29    - port: apiserver
    30      scheme: https
    31      tlsConfig:
    32        insecureSkipVerify: true
    33    {{if $PROMETHEUS_SLOW_APISERVER}}
    34      interval: 30s
    35      scrapeTimeout: 30s
    36    {{else}}
    37      interval: 5s
    38    {{end}}
    39    {{if $PROMETHEUS_SCRAPE_MASTER_KUBELETS}}
    40    - interval: 5s
    41      port: kubelet
    42      scheme: https
    43      tlsConfig:
    44        insecureSkipVerify: true
    45      bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    46    - interval: 5s
    47      port: kubelet
    48      path: /metrics/cadvisor
    49      scheme: https
    50      tlsConfig:
    51        insecureSkipVerify: true
    52      bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
    53    {{end}}
    54    - interval: 5s
    55      port: kube-scheduler
    56      scheme: https
    57      tlsConfig:
    58        insecureSkipVerify: true
    59    - interval: 5s
    60      port: kube-controller-manager
    61      scheme: https
    62      tlsConfig:
    63        insecureSkipVerify: true
    64    selector:
    65      k8s-app: master