From 5b2757a3544a17b9860ac1d4590d2d71649db08f Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Fri, 30 Aug 2024 01:07:25 -0400 Subject: [PATCH 1/2] Remove bogus exclusion of Namespace and Service Signed-off-by: Mike Spreitzer --- pkg/agent/agent.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 6069df0..9eb01f7 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -36,9 +36,7 @@ var excludedGVKs = map[string]bool{ "rbac.authorization.k8s.io/v1, Kind=RoleBinding": true, "/v1, Kind=Secret": true, "/v1, Kind=ConfigMap": true, - "/v1, Kind=Namespace": true, "/v1, Kind=ServiceAccount": true, - "/v1, Kind=Service": true, } // Agent tracks objects applied by the work agent by watching From 01cf763a6ccc842b8a80e5c42177a8ce7bc27ae1 Mon Sep 17 00:00:00 2001 From: Braulio Dumba Date: Fri, 20 Sep 2024 13:33:15 -0400 Subject: [PATCH 2/2] Adding named ports and annotations for monitoring with Prometheus & Pyroscope Signed-off-by: Braulio Dumba --- .ci-operator.yaml | 2 +- config/manager/manager.yaml | 14 ++++++++++++++ pkg/controller/manifests/templates/deployment.yaml | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.ci-operator.yaml b/.ci-operator.yaml index 9582616..a935e79 100644 --- a/.ci-operator.yaml +++ b/.ci-operator.yaml @@ -1,4 +1,4 @@ build_root_image: namespace: ci name: kcp-dev-build-root - tag: "1.19.2" + tag: "1.21.2" diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index e05d55d..d9fc3ec 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -20,6 +20,13 @@ spec: metadata: labels: app: status-controller + annotations: + profiles.grafana.com/cpu.port: "9282" + profiles.grafana.com/cpu.scrape: "true" + profiles.grafana.com/goroutine.port: "9282" + profiles.grafana.com/goroutine.scrape: "true" + profiles.grafana.com/memory.port: "9282" + profiles.grafana.com/memory.scrape: "true" spec: securityContext: runAsNonRoot: true @@ -55,6 +62,13 @@ spec: - name: status-controller image: controller imagePullPolicy: IfNotPresent + ports: + - containerPort: 9280 + protocol: TCP + name: metrics + - containerPort: 9282 + protocol: TCP + name: debug-pprof securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/pkg/controller/manifests/templates/deployment.yaml b/pkg/controller/manifests/templates/deployment.yaml index e0b7d3f..f1d0857 100644 --- a/pkg/controller/manifests/templates/deployment.yaml +++ b/pkg/controller/manifests/templates/deployment.yaml @@ -14,6 +14,13 @@ spec: metadata: labels: app: status-agent + annotations: + profiles.grafana.com/cpu.port: "8082" + profiles.grafana.com/cpu.scrape: "true" + profiles.grafana.com/goroutine.port: "8082" + profiles.grafana.com/goroutine.scrape: "true" + profiles.grafana.com/memory.port: "8082" + profiles.grafana.com/memory.scrape: "true" spec: serviceAccountName: status-agent-sa {{- if .NodeSelector }} @@ -42,6 +49,13 @@ spec: - name: status-agent image: {{ .Image }} imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + protocol: TCP + name: metrics + - containerPort: 8082 + protocol: TCP + name: debug-pprof {{- if or .HTTPProxy .HTTPSProxy}} env: {{- if .HTTPProxy }}