Skip to content

Commit

Permalink
feat: Dedicated metrics service with basic customization options
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
  • Loading branch information
mkilchhofer committed Feb 4, 2025
1 parent 08fe826 commit 2ff4f3e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
7 changes: 7 additions & 0 deletions charts/argo-cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,13 @@ To read more about this component, please read [Argo CD Manifest Hydrator] and [
| commitServer.livenessProbe.initialDelaySeconds | int | `30` | Number of seconds after the container has started before [probe] is initiated |
| commitServer.livenessProbe.periodSeconds | int | `30` | How often (in seconds) to perform the [probe] |
| commitServer.livenessProbe.timeoutSeconds | int | `5` | Number of seconds after which the [probe] times out |
| commitServer.metrics.enabled | bool | `false` | Enables prometheus metrics server |
| commitServer.metrics.service.annotations | object | `{}` | Metrics service annotations |
| commitServer.metrics.service.clusterIP | string | `""` | Metrics service clusterIP. `None` makes a "headless service" (no virtual IP) |
| commitServer.metrics.service.labels | object | `{}` | Metrics service labels |
| commitServer.metrics.service.portName | string | `"metrics"` | Metrics service port name |
| commitServer.metrics.service.servicePort | int | `8087` | Metrics service port |
| commitServer.metrics.service.type | string | `"ClusterIP"` | Metrics service type |
| commitServer.name | string | `"commit-server"` | Commit server name |
| commitServer.nodeSelector | object | `{}` (defaults to global.nodeSelector) | [Node selector] |
| commitServer.podAnnotations | object | `{}` | Annotations for the commit server pods |
Expand Down
35 changes: 35 additions & 0 deletions charts/argo-cd/templates/argocd-commit-server/metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if and .Values.commitServer.enabled .Values.commitServer.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "argo-cd.commitServer.fullname" . }}-metrics
namespace: {{ include "argo-cd.namespace" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.commitServer.name "name" "metrics") | nindent 4 }}
{{- with .Values.commitServer.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if or .Values.commitServer.metrics.service.annotations .Values.global.addPrometheusAnnotations }}
annotations:
{{- if .Values.global.addPrometheusAnnotations }}
prometheus.io/port: {{ .Values.commitServer.metrics.service.servicePort | quote }}
prometheus.io/scrape: "true"
{{- end }}
{{- range $key, $value := .Values.commitServer.metrics.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.commitServer.metrics.service.type }}
{{- if and .Values.commitServer.metrics.service.clusterIP (eq .Values.commitServer.metrics.service.type "ClusterIP") }}
clusterIP: {{ .Values.commitServer.metrics.service.clusterIP }}
{{- end }}
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.commitServer.metrics.service.portName }}
protocol: TCP
port: {{ .Values.commitServer.metrics.service.servicePort }}
targetPort: 8087
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.commitServer.name) | nindent 4 }}
{{- end }}
4 changes: 0 additions & 4 deletions charts/argo-cd/templates/argocd-commit-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ spec:
protocol: TCP
port: 8086
targetPort: 8086
- name: metrics
protocol: TCP
port: 8087
targetPort: 8087
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.commitServer.name) | nindent 4 }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/argo-cd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3796,6 +3796,23 @@ commitServer:
# -- List of extra volumes to add
extraVolumes: []

metrics:
# -- Enables prometheus metrics server
enabled: false
service:
# -- Metrics service type
type: ClusterIP
# -- Metrics service clusterIP. `None` makes a "headless service" (no virtual IP)
clusterIP: ""
# -- Metrics service annotations
annotations: {}
# -- Metrics service labels
labels: {}
# -- Metrics service port
servicePort: 8087
# -- Metrics service port name
portName: metrics

## commit server service configuration
service:
# -- commit server service annotations
Expand Down

0 comments on commit 2ff4f3e

Please sign in to comment.