2023-10-05 12:43:28 +02:00
|
|
|
---
|
|
|
|
weight: 7
|
|
|
|
title: VMNodeScrape
|
|
|
|
menu:
|
|
|
|
docs:
|
2024-08-16 16:32:25 +02:00
|
|
|
identifier: operator-cr-vmnodescrape
|
|
|
|
parent: operator-cr
|
2023-10-05 12:43:28 +02:00
|
|
|
weight: 7
|
2023-11-22 12:59:07 +01:00
|
|
|
aliases:
|
2024-08-16 16:32:25 +02:00
|
|
|
- /operator/resources/vmnodescrape/
|
|
|
|
- /operator/resources/vmnodescrape/index.html
|
2023-10-05 12:43:28 +02:00
|
|
|
---
|
2023-10-02 14:50:08 +02:00
|
|
|
The `VMNodeScrape` CRD provides discovery mechanism for scraping metrics kubernetes nodes,
|
|
|
|
it is useful for node exporters monitoring.
|
|
|
|
|
2024-08-16 16:32:25 +02:00
|
|
|
`VMNodeScrape` object generates part of [VMAgent](https://docs.victoriametrics.com/vmagent) configuration.
|
2023-10-02 14:50:08 +02:00
|
|
|
It has various options for scraping configuration of target (with basic auth,tls access, by specific port name etc.).
|
|
|
|
|
|
|
|
By specifying configuration at CRD, operator generates config
|
2024-08-16 16:32:25 +02:00
|
|
|
for [VMAgent](https://docs.victoriametrics.com/vmagent) and syncs it. It's useful for cadvisor scraping,
|
2023-10-02 14:50:08 +02:00
|
|
|
node-exporter or other node-based exporters. `VMAgent` `nodeScrapeSelector` must match `VMNodeScrape` labels.
|
|
|
|
|
2024-08-16 16:32:25 +02:00
|
|
|
More information about selectors you can find in [this doc](https://docs.victoriametrics.com/operator/resources/vmagent#scraping).
|
2023-10-02 14:50:08 +02:00
|
|
|
|
|
|
|
## Specification
|
|
|
|
|
|
|
|
You can see the full actual specification of the `VMNodeScrape` resource in
|
2024-08-16 16:32:25 +02:00
|
|
|
the **[API docs -> VMNodeScrape](https://docs.victoriametrics.com/operator/api#vmnodescrape)**.
|
2023-10-02 14:50:08 +02:00
|
|
|
|
|
|
|
Also, you can check out the [examples](#examples) section.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
### Cadvisor scraping
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
apiVersion: operator.victoriametrics.com/v1beta1
|
|
|
|
kind: VMNodeScrape
|
|
|
|
metadata:
|
|
|
|
name: cadvisor-metrics
|
|
|
|
spec:
|
|
|
|
scheme: "https"
|
|
|
|
tlsConfig:
|
|
|
|
insecureSkipVerify: true
|
|
|
|
caFile: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
|
|
|
|
bearerTokenFile: "/var/run/secrets/kubernetes.io/serviceaccount/token"
|
|
|
|
relabelConfigs:
|
|
|
|
- action: labelmap
|
|
|
|
regex: __meta_kubernetes_node_label_(.+)
|
|
|
|
- targetLabel: __address__
|
|
|
|
replacement: kubernetes.default.svc:443
|
|
|
|
- sourceLabels: [__meta_kubernetes_node_name]
|
|
|
|
regex: (.+)
|
|
|
|
targetLabel: __metrics_path__
|
|
|
|
replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
|
|
|
|
```
|