From 87f52def1562f59553b9cf89df1a409b2d3b05c2 Mon Sep 17 00:00:00 2001 From: Anurag Mittal Date: Thu, 2 Jan 2025 12:22:44 +0100 Subject: [PATCH] COSI-65: Add service for metrics in kustomize --- kustomize/base/deployment.yaml | 3 +++ kustomize/base/kustomization.yaml | 1 + kustomize/base/metrics-service.yaml | 14 ++++++++++++++ kustomize/base/rbac.yaml | 3 +++ 4 files changed, 21 insertions(+) create mode 100644 kustomize/base/metrics-service.yaml diff --git a/kustomize/base/deployment.yaml b/kustomize/base/deployment.yaml index e0cd1f78..f5525a8e 100644 --- a/kustomize/base/deployment.yaml +++ b/kustomize/base/deployment.yaml @@ -24,6 +24,9 @@ spec: args: - "--driver-prefix=cosi" - "--v=$(COSI_DRIVER_LOG_LEVEL)" + - "--driver-metrics-address=:8080" + - "--driver-metrics-path=/metrics" + - "--driver-custom-metrics-prefix=scality_cosi_driver" volumeMounts: - mountPath: /var/lib/cosi name: socket diff --git a/kustomize/base/kustomization.yaml b/kustomize/base/kustomization.yaml index 366895c2..f88823eb 100644 --- a/kustomize/base/kustomization.yaml +++ b/kustomize/base/kustomization.yaml @@ -8,3 +8,4 @@ resources: - serviceaccount.yaml - rbac.yaml - deployment.yaml + - metrics-service.yaml diff --git a/kustomize/base/metrics-service.yaml b/kustomize/base/metrics-service.yaml new file mode 100644 index 00000000..f43581d1 --- /dev/null +++ b/kustomize/base/metrics-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: scality-cosi-driver-metrics + labels: + app.kubernetes.io/name: scality-cosi-driver + app.kubernetes.io/part-of: container-object-storage-interface +spec: + selector: + app.kubernetes.io/name: scality-cosi-driver + ports: + - protocol: TCP + port: 8080 # The port Prometheus will scrape + targetPort: 8080 # The port exposed by the container diff --git a/kustomize/base/rbac.yaml b/kustomize/base/rbac.yaml index 45b44756..9e99f9b0 100644 --- a/kustomize/base/rbac.yaml +++ b/kustomize/base/rbac.yaml @@ -12,6 +12,9 @@ rules: - apiGroups: [""] resources: ["secrets", "events"] verbs: ["get", "delete", "update", "create"] + - apiGroups: [""] + resources: ["services", "endpoints"] + verbs: ["get", "list", "watch"] --- apiVersion: rbac.authorization.k8s.io/v1