Skip to content

Commit

Permalink
COSI_65: Add service for metrics in kustomize
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Jan 2, 2025
1 parent ac7780a commit 1f69f34
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ resources:
- serviceaccount.yaml
- rbac.yaml
- deployment.yaml
- metrics-service.yaml
14 changes: 14 additions & 0 deletions kustomize/base/metrics-service.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions kustomize/base/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f69f34

Please sign in to comment.