Class: Kube::Cluster::Standard::VictoriaMetrics::VMRule

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

Overview

A VMRule CR: a set of rule Groups evaluated by VictoriaMetrics.

VMRule.new(name: "node", groups: [
Group.new("node.rules") { ... },
])

Instance Method Summary collapse

Constructor Details

#initialize(name:, groups:, &block) ⇒ VMRule

Returns a new instance of VMRule.



76
77
78
79
80
81
82
# File 'lib/kube/cluster/standard/victoria_metrics/vm_rule.rb', line 76

def initialize(name:, groups:, &block)
  super() {
    .name = name
    spec.groups   = groups.map(&:to_h)
    instance_exec(&block) if block
  }
end