Skip to content

Commit

Permalink
COSI-65: Add service for metrics in helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Jan 2, 2025
1 parent 160732f commit ac7780a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helm/scality-cosi-driver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: "/metrics"

spec:
replicas: {{ .Values.replicaCount }}
Expand All @@ -27,6 +31,9 @@ spec:
args:
- "--driver-prefix=cosi"
- "--v={{ .Values.logLevels.driver }}"
- "--driver-metrics-address={{ .Values.metrics.address }}"
- "--driver-metrics-path={{ .Values.metrics.path }}"
- "--driver-custom-metrics-prefix={{ .Values.metrics.prefix }}"
resources:
limits:
cpu: {{ .Values.resources.limits.cpu }}
Expand Down
16 changes: 16 additions & 0 deletions helm/scality-cosi-driver/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "scality-cosi-driver.fullname" . }}-metrics
labels:
app.kubernetes.io/name: {{ include "scality-cosi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: container-object-storage-interface
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
selector:
app.kubernetes.io/name: {{ include "scality-cosi-driver.name" . }}
ports:
- protocol: TCP
port: {{ .Values.metrics.port }}
targetPort: {{ .Values.metrics.port }}
6 changes: 6 additions & 0 deletions helm/scality-cosi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ serviceAccount:
name: scality-object-storage-provisioner
create: true

metrics:
enabled: true
port: 8080
prefix: "scality_cosi_driver"
address: "0.0.0.0:8080"
path: "/metrics"

resources:
limits:
Expand Down

0 comments on commit ac7780a

Please sign in to comment.