kube_cluster 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/kube/cluster/standard/victoria_metrics/vl_cluster.rb +36 -0
- data/lib/kube/cluster/standard/victoria_metrics/vlogs.rb +36 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_alertmanager.rb +37 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_alertmanager_config.rb +35 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_anomaly.rb +36 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_anomaly_config.rb +35 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_auth.rb +36 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_cluster.rb +37 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_distributed.rb +35 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_pod_scrape.rb +38 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_probe.rb +37 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_scrape_config.rb +36 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_static_scrape.rb +38 -0
- data/lib/kube/cluster/standard/victoria_metrics/vm_user.rb +38 -0
- data/lib/kube/cluster/standard/victoria_metrics/vt_cluster.rb +36 -0
- data/lib/kube/cluster/standard/victoria_metrics/vt_single.rb +35 -0
- data/lib/kube/cluster/version.rb +1 -1
- data/lib/kube/cluster.rb +16 -0
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e6e0a31873f5a706d272e0ff37b06a8f3565b0e8d8629b92915f24c572825d1
|
|
4
|
+
data.tar.gz: '08b20a4bb972d5b52eddd66577c79462a59611c8f84e692d092720c09bced0da'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 676e83947ff878d10e2ff3e46e9dd880120e856f480e5ed9b26d27046f7d901d07d5d044d0a3358fa99c927768f4c0c54e8af1e13fa5ef96b5806caeefa476d2
|
|
7
|
+
data.tar.gz: e8ade4344a74dd80bfaf8abec1bb43c5b0531b1130ab0c8584c4a0edb08e0a8d339dead8c35012cf517847d19cf066516717af9937890b70df744611f0809d5a
|
data/Gemfile.lock
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# HA/clustered VictoriaLogs: vlstorage + vlselect + vlinsert components
|
|
11
|
+
# (the horizontally-scalable alternative to VLSingle). Retention lives on
|
|
12
|
+
# the vlstorage component, so configure the components in the block.
|
|
13
|
+
class VLCluster < Kube::Cluster["VLCluster"]
|
|
14
|
+
def initialize(name:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VLCluster" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VLCluster
|
|
31
|
+
.new(name: "vlcluster")
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Legacy VictoriaLogs kind (operator.victoriametrics.com/v1beta1). New
|
|
11
|
+
# deployments should prefer VLSingle (v1); this wrapper exists for
|
|
12
|
+
# completeness / migrating existing objects. Spec is configured in block.
|
|
13
|
+
class VLogs < Kube::Cluster["VLogs"]
|
|
14
|
+
def initialize(name:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VLogs" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VLogs
|
|
31
|
+
.new(name: "vlogs")
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Managed Alertmanager instance. Notification routing/receivers can be
|
|
11
|
+
# supplied inline via spec.configRawYaml or selected from
|
|
12
|
+
# VMAlertmanagerConfig objects; configure that in the block.
|
|
13
|
+
class VMAlertmanager < Kube::Cluster["VMAlertmanager"]
|
|
14
|
+
def initialize(name:, replica_count: 1, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
spec.replicaCount = replica_count
|
|
18
|
+
instance_exec(&block) if block
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
__END__
|
|
28
|
+
|
|
29
|
+
describe "VictoriaMetrics::VMAlertmanager" do
|
|
30
|
+
it "initializes without error" do
|
|
31
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMAlertmanager
|
|
32
|
+
.new(name: "vmalertmanager")
|
|
33
|
+
.to_yaml
|
|
34
|
+
.is_a?(String)
|
|
35
|
+
.should == true
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Alertmanager routing tree and receivers, selected by a VMAlertmanager.
|
|
11
|
+
# Define spec.route and spec.receivers in the block.
|
|
12
|
+
class VMAlertmanagerConfig < Kube::Cluster["VMAlertmanagerConfig"]
|
|
13
|
+
def initialize(name:, &block)
|
|
14
|
+
super() {
|
|
15
|
+
metadata.name = name
|
|
16
|
+
instance_exec(&block) if block
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
__END__
|
|
26
|
+
|
|
27
|
+
describe "VictoriaMetrics::VMAlertmanagerConfig" do
|
|
28
|
+
it "initializes without error" do
|
|
29
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMAlertmanagerConfig
|
|
30
|
+
.new(name: "vmalertmanagerconfig")
|
|
31
|
+
.to_yaml
|
|
32
|
+
.is_a?(String)
|
|
33
|
+
.should == true
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# VictoriaMetrics Anomaly Detection service (vmanomaly). Reads metrics,
|
|
11
|
+
# fits models, and writes anomaly scores back. Provide the model/reader/
|
|
12
|
+
# writer configuration via spec.configRawYaml in the block.
|
|
13
|
+
class VMAnomaly < Kube::Cluster["VMAnomaly"]
|
|
14
|
+
def initialize(name:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VMAnomaly" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMAnomaly
|
|
31
|
+
.new(name: "vmanomaly")
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Reusable configuration object referenced by a VMAnomaly instance.
|
|
11
|
+
# Define the models/schedulers in the block.
|
|
12
|
+
class VMAnomalyConfig < Kube::Cluster["VMAnomalyConfig"]
|
|
13
|
+
def initialize(name:, &block)
|
|
14
|
+
super() {
|
|
15
|
+
metadata.name = name
|
|
16
|
+
instance_exec(&block) if block
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
__END__
|
|
26
|
+
|
|
27
|
+
describe "VictoriaMetrics::VMAnomalyConfig" do
|
|
28
|
+
it "initializes without error" do
|
|
29
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMAnomalyConfig
|
|
30
|
+
.new(name: "vmanomalyconfig") { spec.schedulers = {} }
|
|
31
|
+
.to_yaml
|
|
32
|
+
.is_a?(String)
|
|
33
|
+
.should == true
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Auth proxy / router that sits in front of VictoriaMetrics components and
|
|
11
|
+
# dispatches requests according to the VMUser objects it selects. Configure
|
|
12
|
+
# user selection and unauthorized-access rules in the block.
|
|
13
|
+
class VMAuth < Kube::Cluster["VMAuth"]
|
|
14
|
+
def initialize(name:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VMAuth" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMAuth
|
|
31
|
+
.new(name: "vmauth")
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# HA/clustered VictoriaMetrics: vmstorage + vmselect + vminsert
|
|
11
|
+
# components (the horizontally-scalable alternative to VMSingle).
|
|
12
|
+
# Configure the three components in the block.
|
|
13
|
+
class VMCluster < Kube::Cluster["VMCluster"]
|
|
14
|
+
def initialize(name:, retention_period: "30d", &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
spec.retentionPeriod = retention_period
|
|
18
|
+
instance_exec(&block) if block
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
__END__
|
|
28
|
+
|
|
29
|
+
describe "VictoriaMetrics::VMCluster" do
|
|
30
|
+
it "initializes without error" do
|
|
31
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMCluster
|
|
32
|
+
.new(name: "vmcluster")
|
|
33
|
+
.to_yaml
|
|
34
|
+
.is_a?(String)
|
|
35
|
+
.should == true
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Multi-zone/distributed VictoriaMetrics topology. The full shape (zones,
|
|
11
|
+
# common settings) is configured in the block.
|
|
12
|
+
class VMDistributed < Kube::Cluster["VMDistributed"]
|
|
13
|
+
def initialize(name:, &block)
|
|
14
|
+
super() {
|
|
15
|
+
metadata.name = name
|
|
16
|
+
instance_exec(&block) if block
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
__END__
|
|
26
|
+
|
|
27
|
+
describe "VictoriaMetrics::VMDistributed" do
|
|
28
|
+
it "initializes without error" do
|
|
29
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMDistributed
|
|
30
|
+
.new(name: "vmdistributed") { spec.retain = true }
|
|
31
|
+
.to_yaml
|
|
32
|
+
.is_a?(String)
|
|
33
|
+
.should == true
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Declares how to scrape the pods selected by the app.kubernetes.io/name
|
|
11
|
+
# label (the pod-selector analogue of VMServiceScrape), relabelling the
|
|
12
|
+
# metrics onto a job.
|
|
13
|
+
class VMPodScrape < Kube::Cluster["VMPodScrape"]
|
|
14
|
+
def initialize(name:, job:, match_name:, port:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
spec.selector = { matchLabels: { "app.kubernetes.io/name" => match_name } }
|
|
18
|
+
spec.podMetricsEndpoints = [{ port: port, relabelConfigs: [{ targetLabel: "job", replacement: job }] }]
|
|
19
|
+
instance_exec(&block) if block
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
__END__
|
|
29
|
+
|
|
30
|
+
describe "VictoriaMetrics::VMPodScrape" do
|
|
31
|
+
it "initializes without error" do
|
|
32
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMPodScrape
|
|
33
|
+
.new(name: "opencost", job: "opencost", match_name: "opencost", port: "http")
|
|
34
|
+
.to_yaml
|
|
35
|
+
.is_a?(String)
|
|
36
|
+
.should == true
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Blackbox/probe scraping: points a prober (e.g. blackbox_exporter) at a
|
|
11
|
+
# set of targets. Pass the prober URL here and the targets/module in the
|
|
12
|
+
# block via spec.targets and spec.module.
|
|
13
|
+
class VMProbe < Kube::Cluster["VMProbe"]
|
|
14
|
+
def initialize(name:, prober_url:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
spec.vmProberSpec = { url: prober_url }
|
|
18
|
+
instance_exec(&block) if block
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
__END__
|
|
28
|
+
|
|
29
|
+
describe "VictoriaMetrics::VMProbe" do
|
|
30
|
+
it "initializes without error" do
|
|
31
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMProbe
|
|
32
|
+
.new(name: "blackbox", prober_url: "http://blackbox-exporter.metrics.svc:9115")
|
|
33
|
+
.to_yaml
|
|
34
|
+
.is_a?(String)
|
|
35
|
+
.should == true
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Generic scrape configuration supporting the full range of service-
|
|
11
|
+
# discovery mechanisms (static, kubernetes, http, ec2, consul, …). Declare
|
|
12
|
+
# the discovery configs and relabelling in the block.
|
|
13
|
+
class VMScrapeConfig < Kube::Cluster["VMScrapeConfig"]
|
|
14
|
+
def initialize(name:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VMScrapeConfig" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMScrapeConfig
|
|
31
|
+
.new(name: "vmscrapeconfig")
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Scrapes a fixed set of static targets (host:port) under a named job —
|
|
11
|
+
# for endpoints that have no Service/Pod to select. Extra per-endpoint
|
|
12
|
+
# settings (path, scheme, labels) can be added in the block.
|
|
13
|
+
class VMStaticScrape < Kube::Cluster["VMStaticScrape"]
|
|
14
|
+
def initialize(name:, job:, targets:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
spec.jobName = job
|
|
18
|
+
spec.targetEndpoints = [{ targets: Array(targets) }]
|
|
19
|
+
instance_exec(&block) if block
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
__END__
|
|
29
|
+
|
|
30
|
+
describe "VictoriaMetrics::VMStaticScrape" do
|
|
31
|
+
it "initializes without error" do
|
|
32
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMStaticScrape
|
|
33
|
+
.new(name: "external", job: "external", targets: ["10.0.0.1:9100"])
|
|
34
|
+
.to_yaml
|
|
35
|
+
.is_a?(String)
|
|
36
|
+
.should == true
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# A user/route definition consumed by VMAuth: maps credentials to a set of
|
|
11
|
+
# upstream target refs. Pass the routing in the block via spec.targetRefs.
|
|
12
|
+
class VMUser < Kube::Cluster["VMUser"]
|
|
13
|
+
def initialize(name:, username: nil, &block)
|
|
14
|
+
super() {
|
|
15
|
+
metadata.name = name
|
|
16
|
+
spec.username = username if username
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VMUser" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VMUser
|
|
31
|
+
.new(name: "vmuser", username: "reader") {
|
|
32
|
+
spec.targetRefs = [{ crd: { kind: "VMSingle", name: "vmsingle", namespace: "metrics" }, paths: ["/"] }]
|
|
33
|
+
}
|
|
34
|
+
.to_yaml
|
|
35
|
+
.is_a?(String)
|
|
36
|
+
.should == true
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# HA/clustered VictoriaTraces: storage + select + insert components
|
|
11
|
+
# (the horizontally-scalable alternative to VTSingle). Retention lives on
|
|
12
|
+
# the storage component, so configure the components in the block.
|
|
13
|
+
class VTCluster < Kube::Cluster["VTCluster"]
|
|
14
|
+
def initialize(name:, &block)
|
|
15
|
+
super() {
|
|
16
|
+
metadata.name = name
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
__END__
|
|
27
|
+
|
|
28
|
+
describe "VictoriaMetrics::VTCluster" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::VictoriaMetrics::VTCluster
|
|
31
|
+
.new(name: "vtcluster")
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
5
|
+
|
|
6
|
+
module Kube
|
|
7
|
+
module Cluster
|
|
8
|
+
module Standard
|
|
9
|
+
module VictoriaMetrics
|
|
10
|
+
# Single-node VictoriaTraces store.
|
|
11
|
+
class VTSingle < Kube::Cluster["VTSingle"]
|
|
12
|
+
def initialize(name:, retention_period: "30d", &block)
|
|
13
|
+
super() {
|
|
14
|
+
metadata.name = name
|
|
15
|
+
spec.retentionPeriod = retention_period
|
|
16
|
+
instance_exec(&block) if block
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
__END__
|
|
26
|
+
|
|
27
|
+
describe "VictoriaMetrics::VTSingle" do
|
|
28
|
+
it "initializes without error" do
|
|
29
|
+
Kube::Cluster::Standard::VictoriaMetrics::VTSingle
|
|
30
|
+
.new(name: "vtsingle")
|
|
31
|
+
.to_yaml
|
|
32
|
+
.is_a?(String)
|
|
33
|
+
.should == true
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/kube/cluster/version.rb
CHANGED
data/lib/kube/cluster.rb
CHANGED
|
@@ -126,13 +126,29 @@ Kube::Cluster.config do
|
|
|
126
126
|
|
|
127
127
|
# VictoriaMetrics operator.
|
|
128
128
|
resolve "VLAgent", to: "operator.victoriametrics.com/v1/VLAgent"
|
|
129
|
+
resolve "VLCluster", to: "operator.victoriametrics.com/v1/VLCluster"
|
|
130
|
+
resolve "VLogs", to: "operator.victoriametrics.com/v1beta1/VLogs"
|
|
129
131
|
resolve "VLSingle", to: "operator.victoriametrics.com/v1/VLSingle"
|
|
130
132
|
resolve "VMAgent", to: "operator.victoriametrics.com/v1beta1/VMAgent"
|
|
131
133
|
resolve "VMAlert", to: "operator.victoriametrics.com/v1beta1/VMAlert"
|
|
134
|
+
resolve "VMAlertmanager", to: "operator.victoriametrics.com/v1beta1/VMAlertmanager"
|
|
135
|
+
resolve "VMAlertmanagerConfig", to: "operator.victoriametrics.com/v1beta1/VMAlertmanagerConfig"
|
|
136
|
+
resolve "VMAnomaly", to: "operator.victoriametrics.com/v1/VMAnomaly"
|
|
137
|
+
resolve "VMAnomalyConfig", to: "operator.victoriametrics.com/v1/VMAnomalyConfig"
|
|
138
|
+
resolve "VMAuth", to: "operator.victoriametrics.com/v1beta1/VMAuth"
|
|
139
|
+
resolve "VMCluster", to: "operator.victoriametrics.com/v1beta1/VMCluster"
|
|
140
|
+
resolve "VMDistributed", to: "operator.victoriametrics.com/v1alpha1/VMDistributed"
|
|
132
141
|
resolve "VMNodeScrape", to: "operator.victoriametrics.com/v1beta1/VMNodeScrape"
|
|
142
|
+
resolve "VMPodScrape", to: "operator.victoriametrics.com/v1beta1/VMPodScrape"
|
|
143
|
+
resolve "VMProbe", to: "operator.victoriametrics.com/v1beta1/VMProbe"
|
|
133
144
|
resolve "VMRule", to: "operator.victoriametrics.com/v1beta1/VMRule"
|
|
145
|
+
resolve "VMScrapeConfig", to: "operator.victoriametrics.com/v1beta1/VMScrapeConfig"
|
|
134
146
|
resolve "VMServiceScrape", to: "operator.victoriametrics.com/v1beta1/VMServiceScrape"
|
|
135
147
|
resolve "VMSingle", to: "operator.victoriametrics.com/v1beta1/VMSingle"
|
|
148
|
+
resolve "VMStaticScrape", to: "operator.victoriametrics.com/v1beta1/VMStaticScrape"
|
|
149
|
+
resolve "VMUser", to: "operator.victoriametrics.com/v1beta1/VMUser"
|
|
150
|
+
resolve "VTCluster", to: "operator.victoriametrics.com/v1/VTCluster"
|
|
151
|
+
resolve "VTSingle", to: "operator.victoriametrics.com/v1/VTSingle"
|
|
136
152
|
|
|
137
153
|
# Gateway API — pin to the stable v1 group/version.
|
|
138
154
|
resolve "GatewayClass", to: "gateway.networking.k8s.io/v1/GatewayClass"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kube_cluster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan K
|
|
@@ -244,13 +244,29 @@ files:
|
|
|
244
244
|
- lib/kube/cluster/standard/service_account.rb
|
|
245
245
|
- lib/kube/cluster/standard/service_account_with_role.rb
|
|
246
246
|
- lib/kube/cluster/standard/victoria_metrics/vl_agent.rb
|
|
247
|
+
- lib/kube/cluster/standard/victoria_metrics/vl_cluster.rb
|
|
247
248
|
- lib/kube/cluster/standard/victoria_metrics/vl_single.rb
|
|
249
|
+
- lib/kube/cluster/standard/victoria_metrics/vlogs.rb
|
|
248
250
|
- lib/kube/cluster/standard/victoria_metrics/vm_agent.rb
|
|
249
251
|
- lib/kube/cluster/standard/victoria_metrics/vm_alert.rb
|
|
252
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_alertmanager.rb
|
|
253
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_alertmanager_config.rb
|
|
254
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_anomaly.rb
|
|
255
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_anomaly_config.rb
|
|
256
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_auth.rb
|
|
257
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_cluster.rb
|
|
258
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_distributed.rb
|
|
250
259
|
- lib/kube/cluster/standard/victoria_metrics/vm_node_scrape.rb
|
|
260
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_pod_scrape.rb
|
|
261
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_probe.rb
|
|
251
262
|
- lib/kube/cluster/standard/victoria_metrics/vm_rule.rb
|
|
263
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_scrape_config.rb
|
|
252
264
|
- lib/kube/cluster/standard/victoria_metrics/vm_service_scrape.rb
|
|
253
265
|
- lib/kube/cluster/standard/victoria_metrics/vm_single.rb
|
|
266
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_static_scrape.rb
|
|
267
|
+
- lib/kube/cluster/standard/victoria_metrics/vm_user.rb
|
|
268
|
+
- lib/kube/cluster/standard/victoria_metrics/vt_cluster.rb
|
|
269
|
+
- lib/kube/cluster/standard/victoria_metrics/vt_single.rb
|
|
254
270
|
- lib/kube/cluster/standard/volume_processing.rb
|
|
255
271
|
- lib/kube/cluster/version.rb
|
|
256
272
|
- lib/kube/cluster/version.rb.erb
|