-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add monitor resources creation to forklift operator
Signed-off-by: Bella Khizgiyaev <[email protected]>
- Loading branch information
Showing
29 changed files
with
75 additions
and
7,374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
operator/roles/forkliftcontroller/templates/monitor/service-metrics.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: {{ app_name }} | ||
service: {{ metric_service_name }} | ||
prometheus.forklift.konveyor.io: "true" | ||
control-plane: controller-manager | ||
controller-tools.k8s.io: "1.0" | ||
name: {{ metric_service_name }} | ||
namespace: {{ app_namespace }} | ||
spec: | ||
ports: | ||
- name: {{ metric_port_name }} | ||
port: 2112 | ||
targetPort: 2112 | ||
protocol: TCP | ||
selector: | ||
app: {{ app_name }} | ||
prometheus.forklift.konveyor.io: "true" | ||
controller-tools.k8s.io: "1.0" |
21 changes: 21 additions & 0 deletions
21
operator/roles/forkliftcontroller/templates/monitor/servicemonitor-metrics.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ metric_servicemonitor_name }} | ||
namespace: {{ app_namespace }} | ||
labels: | ||
app: {{ app_name }} | ||
prometheus.forklift.konveyor.io: "true" | ||
control-plane: controller-manager | ||
spec: | ||
endpoints: | ||
- interval: {{ metric_interval }} | ||
port: {{ metric_port_name }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ app_namespace }} | ||
selector: | ||
matchLabels: | ||
app: {{ app_name }} | ||
prometheus.forklift.konveyor.io: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +0,0 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "metrics", | ||
srcs = ["metrics.go"], | ||
importpath = "github.com/konveyor/forklift-controller/pkg/monitoring/metrics", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1:monitoring", | ||
"//vendor/k8s.io/api/core/v1:core", | ||
"//vendor/k8s.io/apimachinery/pkg/api/errors", | ||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:meta", | ||
"//vendor/k8s.io/apimachinery/pkg/types", | ||
"//vendor/k8s.io/apimachinery/pkg/util/intstr", | ||
"//vendor/k8s.io/client-go/kubernetes", | ||
"//vendor/sigs.k8s.io/controller-runtime/pkg/client", | ||
], | ||
) | ||
Oops, something went wrong.