Class: Kube::Cluster::Standard::VictoriaMetrics::VMNodeScrape

Inherits:
Object
  • Object
show all
Defined in:
lib/kube/cluster/standard/victoria_metrics/vm_node_scrape.rb

Overview

Scrapes node-level endpoints (e.g. the kubelet) over HTTPS using the in-cluster service-account token.

Instance Method Summary collapse

Constructor Details

#initialize(name:, job:, path: nil, interval: "30s", &block) ⇒ VMNodeScrape

Returns a new instance of VMNodeScrape.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/kube/cluster/standard/victoria_metrics/vm_node_scrape.rb', line 13

def initialize(name:, job:, path: nil, interval: "30s", &block)
  super() {
    .name        = name
    spec.scheme          = "https"
    spec.tlsConfig       = { insecureSkipVerify: true }
    spec.bearerTokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token"
    spec.honorLabels     = true
    spec.interval        = interval
    spec.path            = path if path
    spec.relabelConfigs  = [{ targetLabel: "job", replacement: job }]
    instance_exec(&block) if block
  }
end