From 91d22487283583d449df042b7e50036a35e01d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Drzewiecki?= Date: Thu, 28 Dec 2023 12:27:00 +0100 Subject: [PATCH] adjust configuration for metrics --- config/manager/manager.yaml | 15 +++++++++------ config/manager/metrics.yaml | 23 +++++++++++++++++++++++ config/prometheus/monitor.yaml | 13 +++++++------ 3 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 config/manager/metrics.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 56cd1913..b1e77c5f 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,8 +2,8 @@ apiVersion: v1 kind: Namespace metadata: labels: - control-plane: controller-manager - app.kubernetes.io/name: namespace + control-plane: infrastructure-manager + app.kubernetes.io/name: infrastructure-manager app.kubernetes.io/instance: system app.kubernetes.io/component: manager app.kubernetes.io/created-by: infrastructure-manager @@ -17,10 +17,10 @@ metadata: name: controller-manager namespace: system labels: - control-plane: controller-manager - app.kubernetes.io/name: deployment - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/component: manager + control-plane: infrastructure-manager + app.kubernetes.io/name: infrastructure-manager + app.kubernetes.io/instance: infrastructure-manager + app.kubernetes.io/component: infrastructure-manager.kyma-project.io app.kubernetes.io/created-by: infrastructure-manager app.kubernetes.io/part-of: infrastructure-manager app.kubernetes.io/managed-by: kustomize @@ -77,6 +77,9 @@ spec: capabilities: drop: - "ALL" + ports: + - containerPort: 8080 + name: metrics livenessProbe: httpGet: path: /healthz diff --git a/config/manager/metrics.yaml b/config/manager/metrics.yaml new file mode 100644 index 00000000..c75da51c --- /dev/null +++ b/config/manager/metrics.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + control-plane: infrastructure-manager + app.kubernetes.io/name: metrics + app.kubernetes.io/instance: infrastructure-manager + app.kubernetes.io/component: infrastructure-manager.kyma-project.io + app.kubernetes.io/created-by: infrastructure-manager + app.kubernetes.io/part-of: infrastructure-manager + app.kubernetes.io/managed-by: kustomize + name: infrastructure-manager-metrics + namespace: kcp-system +spec: + ports: + - name: metrics + port: 8080 + protocol: TCP + appProtocol: http + targetPort: metrics + selector: + app.kubernetes.io/name: infrastructure-manager + app.kubernetes.io/component: infrastructure-manager.kyma-project.io \ No newline at end of file diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index efbe164e..4b897f9c 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -4,9 +4,9 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: - control-plane: controller-manager - app.kubernetes.io/name: servicemonitor - app.kubernetes.io/instance: controller-manager-metrics-monitor + control-plane: infrastructure-manager + app.kubernetes.io/name: infrastructure-manager-metrics-monitor + app.kubernetes.io/instance: infrastructure-manager-metrics-monitor app.kubernetes.io/component: metrics app.kubernetes.io/created-by: infrastructure-manager app.kubernetes.io/part-of: infrastructure-manager @@ -16,11 +16,12 @@ metadata: spec: endpoints: - path: /metrics - port: https - scheme: https + port: metrics + scheme: http bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token tlsConfig: insecureSkipVerify: true selector: matchLabels: - control-plane: controller-manager + app.kubernetes.io/name: metrics + app.kubernetes.io/component: infrastructure-manager.kyma-project.io