feat(argo-cd): Allow service monitor relabeling configs (#897)
* Allow service monitor relabeling configs Signed-off-by: Petr Drastil <petr.drastil@gmail.com> * Revert scrape interval to optional field Signed-off-by: Petr Drastil <petr.drastil@gmail.com> * Revert path to original place Signed-off-by: Petr Drastil <petr.drastil@gmail.com> * Fix trailing character on README Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
91e6e0749a
commit
8e11387e7d
7 changed files with 76 additions and 30 deletions
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
appVersion: 2.1.0
|
appVersion: 2.1.0
|
||||||
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
||||||
name: argo-cd
|
name: argo-cd
|
||||||
version: 3.15.0
|
version: 3.16.0
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://argoproj.github.io/argo-cd/assets/logo.png
|
icon: https://argoproj.github.io/argo-cd/assets/logo.png
|
||||||
keywords:
|
keywords:
|
||||||
|
@ -21,4 +21,5 @@ dependencies:
|
||||||
condition: redis-ha.enabled
|
condition: redis-ha.enabled
|
||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/changes: |
|
artifacthub.io/changes: |
|
||||||
- "[Added]: Global configuration for pod annotations and labels"
|
- "[Added]: Service monitor relabelings and metricsRelabelings"
|
||||||
|
- "[Fixed]: Service monitor interval configuration for all components"
|
||||||
|
|
|
@ -203,6 +203,8 @@ NAME: my-release
|
||||||
| controller.metrics.service.servicePort | Metrics service port | `8082` |
|
| controller.metrics.service.servicePort | Metrics service port | `8082` |
|
||||||
| controller.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
| controller.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
||||||
| controller.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
| controller.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
||||||
|
| controller.metrics.serviceMonitor.relabelings | Prometheus [RelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) to apply to samples before scraping | `[]` |
|
||||||
|
| controller.metrics.serviceMonitor.metricRelabelings | Prometheus [MetricRelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs) to apply to samples before ingestion | `[]` |
|
||||||
| controller.name | Controller name string. | `"application-controller"` |
|
| controller.name | Controller name string. | `"application-controller"` |
|
||||||
| controller.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` |
|
| controller.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` |
|
||||||
| controller.podAnnotations | Annotations for the controller pods | `{}` |
|
| controller.podAnnotations | Annotations for the controller pods | `{}` |
|
||||||
|
@ -255,6 +257,8 @@ NAME: my-release
|
||||||
| repoServer.metrics.service.servicePort | Metrics service port | `8082` |
|
| repoServer.metrics.service.servicePort | Metrics service port | `8082` |
|
||||||
| repoServer.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
| repoServer.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
||||||
| repoServer.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
| repoServer.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
||||||
|
| repoServer.metrics.serviceMonitor.relabelings | Prometheus [RelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) to apply to samples before scraping | `[]` |
|
||||||
|
| repoServer.metrics.serviceMonitor.metricRelabelings | Prometheus [MetricRelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs) to apply to samples before ingestion | `[]` |
|
||||||
| repoServer.name | Repo server name | `"repo-server"` |
|
| repoServer.name | Repo server name | `"repo-server"` |
|
||||||
| repoServer.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` |
|
| repoServer.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` |
|
||||||
| repoServer.podAnnotations | Annotations for the repo server pods | `{}` |
|
| repoServer.podAnnotations | Annotations for the repo server pods | `{}` |
|
||||||
|
@ -335,6 +339,8 @@ NAME: my-release
|
||||||
| server.metrics.service.servicePort | Metrics service port | `8082` |
|
| server.metrics.service.servicePort | Metrics service port | `8082` |
|
||||||
| server.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
| server.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
||||||
| server.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
| server.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
||||||
|
| server.metrics.serviceMonitor.relabelings | Prometheus [RelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) to apply to samples before scraping | `[]` |
|
||||||
|
| server.metrics.serviceMonitor.metricRelabelings | Prometheus [MetricRelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs) to apply to samples before ingestion | `[]` |
|
||||||
| server.name | Argo CD server name | `"server"` |
|
| server.name | Argo CD server name | `"server"` |
|
||||||
| server.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` |
|
| server.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` |
|
||||||
| server.podAnnotations | Annotations for the server pods | `{}` |
|
| server.podAnnotations | Annotations for the server pods | `{}` |
|
||||||
|
@ -387,6 +393,8 @@ NAME: my-release
|
||||||
| dex.metrics.service.labels | Metrics service labels | `{}` |
|
| dex.metrics.service.labels | Metrics service labels | `{}` |
|
||||||
| dex.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
| dex.metrics.serviceMonitor.enabled | Enable a prometheus ServiceMonitor. | `false` |
|
||||||
| dex.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
| dex.metrics.serviceMonitor.selector | Prometheus ServiceMonitor selector. | `{}` |
|
||||||
|
| dex.metrics.serviceMonitor.relabelings | Prometheus [RelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) to apply to samples before scraping | `[]` |
|
||||||
|
| dex.metrics.serviceMonitor.metricRelabelings | Prometheus [MetricRelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs) to apply to samples before ingestion | `[]` |
|
||||||
| dex.name | Dex name | `"dex-server"` |
|
| dex.name | Dex name | `"dex-server"` |
|
||||||
| dex.env | Environment variables for the Dex server. | `[]` |
|
| dex.env | Environment variables for the Dex server. | `[]` |
|
||||||
| dex.envFrom | `envFrom` to pass to the Dex server. | `[]` (See [values.yaml](values.yaml)) |
|
| dex.envFrom | `envFrom` to pass to the Dex server. | `[]` (See [values.yaml](values.yaml)) |
|
||||||
|
|
|
@ -3,16 +3,16 @@ apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "argo-cd.controller.fullname" . }}
|
name: {{ template "argo-cd.controller.fullname" . }}
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.namespace }}
|
{{- with .Values.controller.metrics.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.controller.metrics.serviceMonitor.namespace }}
|
namespace: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.selector }}
|
{{- with .Values.controller.metrics.serviceMonitor.selector }}
|
||||||
{{- toYaml .Values.controller.metrics.serviceMonitor.selector | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.additionalLabels }}
|
{{- with .Values.controller.metrics.serviceMonitor.additionalLabels }}
|
||||||
{{- toYaml .Values.controller.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
endpoints:
|
endpoints:
|
||||||
|
@ -21,6 +21,14 @@ spec:
|
||||||
interval: {{ . }}
|
interval: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
path: /metrics
|
path: /metrics
|
||||||
|
{{- with .Values.controller.metrics.serviceMonitor.relabelings }}
|
||||||
|
relabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.controller.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
- {{ .Release.Namespace }}
|
- {{ .Release.Namespace }}
|
||||||
|
@ -28,4 +36,3 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }}
|
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,16 @@ apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "argo-cd.repoServer.fullname" . }}
|
name: {{ template "argo-cd.repoServer.fullname" . }}
|
||||||
{{- if .Values.repoServer.metrics.serviceMonitor.namespace }}
|
{{- with .Values.repoServer.metrics.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.repoServer.metrics.serviceMonitor.namespace }}
|
namespace: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }}
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }}
|
||||||
{{- if .Values.repoServer.metrics.serviceMonitor.selector }}
|
{{- with .Values.repoServer.metrics.serviceMonitor.selector }}
|
||||||
{{- toYaml .Values.repoServer.metrics.serviceMonitor.selector | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.repoServer.metrics.serviceMonitor.additionalLabels }}
|
{{- with .Values.repoServer.metrics.serviceMonitor.additionalLabels }}
|
||||||
{{- toYaml .Values.repoServer.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
endpoints:
|
endpoints:
|
||||||
|
@ -21,6 +21,14 @@ spec:
|
||||||
interval: {{ . }}
|
interval: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
path: /metrics
|
path: /metrics
|
||||||
|
{{- with .Values.repoServer.metrics.serviceMonitor.relabelings }}
|
||||||
|
relabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.repoServer.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
- {{ .Release.Namespace }}
|
- {{ .Release.Namespace }}
|
||||||
|
@ -28,4 +36,3 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-metrics" .Values.repoServer.name)) | nindent 6 }}
|
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-metrics" .Values.repoServer.name)) | nindent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -8,19 +8,27 @@ metadata:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
|
||||||
{{- if .Values.server.metrics.serviceMonitor.selector }}
|
{{- with .Values.server.metrics.serviceMonitor.selector }}
|
||||||
{{- toYaml .Values.server.metrics.serviceMonitor.selector | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.server.metrics.serviceMonitor.additionalLabels }}
|
{{- with .Values.server.metrics.serviceMonitor.additionalLabels }}
|
||||||
{{- toYaml .Values.server.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
endpoints:
|
endpoints:
|
||||||
- port: metrics
|
- port: metrics
|
||||||
{{- with .Values.controller.metrics.serviceMonitor.interval }}
|
{{- with .Values.server.metrics.serviceMonitor.interval }}
|
||||||
interval: {{ . }}
|
interval: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
path: /metrics
|
path: /metrics
|
||||||
|
{{- with .Values.server.metrics.serviceMonitor.relabelings }}
|
||||||
|
relabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.server.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
- {{ .Release.Namespace }}
|
- {{ .Release.Namespace }}
|
||||||
|
@ -28,4 +36,3 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.server.name "name" (printf "%s-metrics" .Values.server.name)) | nindent 6 }}
|
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.server.name "name" (printf "%s-metrics" .Values.server.name)) | nindent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -3,28 +3,36 @@ apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "argo-cd.dex.fullname" . }}
|
name: {{ template "argo-cd.dex.fullname" . }}
|
||||||
{{- if .Values.dex.metrics.serviceMonitor.namespace }}
|
{{- with .Values.dex.metrics.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.dex.metrics.serviceMonitor.namespace }}
|
namespace: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
|
||||||
{{- if .Values.dex.metrics.serviceMonitor.selector }}
|
{{- with .Values.dex.metrics.serviceMonitor.selector }}
|
||||||
{{- toYaml .Values.dex.metrics.serviceMonitor.selector | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.dex.metrics.serviceMonitor.additionalLabels }}
|
{{- with .Values.dex.metrics.serviceMonitor.additionalLabels }}
|
||||||
{{- toYaml .Values.dex.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
endpoints:
|
endpoints:
|
||||||
- port: metrics
|
- port: metrics
|
||||||
{{- with .Values.controller.metrics.serviceMonitor.interval }}
|
{{- with .Values.dex.metrics.serviceMonitor.interval }}
|
||||||
interval: {{ . }}
|
interval: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
path: /metrics
|
path: /metrics
|
||||||
|
{{- with .Values.dex.metrics.serviceMonitor.relabelings }}
|
||||||
|
relabelings:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.dex.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings:
|
||||||
|
{{- toYaml . |nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
- {{ .Release.Namespace }}
|
- {{ .Release.Namespace }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 6 }}
|
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -169,6 +169,8 @@ controller:
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
relabelings: []
|
||||||
|
metricRelabelings: []
|
||||||
# selector:
|
# selector:
|
||||||
# prometheus: kube-prometheus
|
# prometheus: kube-prometheus
|
||||||
# namespace: monitoring
|
# namespace: monitoring
|
||||||
|
@ -230,6 +232,8 @@ dex:
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
relabelings: []
|
||||||
|
metricRelabelings: []
|
||||||
# selector:
|
# selector:
|
||||||
# prometheus: kube-prometheus
|
# prometheus: kube-prometheus
|
||||||
# namespace: monitoring
|
# namespace: monitoring
|
||||||
|
@ -576,6 +580,8 @@ server:
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
relabelings: []
|
||||||
|
metricRelabelings: []
|
||||||
# selector:
|
# selector:
|
||||||
# prometheus: kube-prometheus
|
# prometheus: kube-prometheus
|
||||||
# namespace: monitoring
|
# namespace: monitoring
|
||||||
|
@ -961,6 +967,8 @@ repoServer:
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
relabelings: []
|
||||||
|
metricRelabelings: []
|
||||||
# selector:
|
# selector:
|
||||||
# prometheus: kube-prometheus
|
# prometheus: kube-prometheus
|
||||||
# namespace: monitoring
|
# namespace: monitoring
|
||||||
|
|
Loading…
Reference in a new issue