diff --git a/charts/miroir/templates/miroir-service.yaml b/charts/miroir/templates/miroir-service.yaml index aff3072..2051f9c 100644 --- a/charts/miroir/templates/miroir-service.yaml +++ b/charts/miroir/templates/miroir-service.yaml @@ -9,6 +9,7 @@ metadata: labels: {{- include "miroir.labels" . | nindent 4 }} app.kubernetes.io/component: miroir + app.kubernetes.io/component: metrics {{- with .Values.service.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/miroir/templates/miroir-servicemonitor.yaml b/charts/miroir/templates/miroir-servicemonitor.yaml index 45d3817..190f124 100644 --- a/charts/miroir/templates/miroir-servicemonitor.yaml +++ b/charts/miroir/templates/miroir-servicemonitor.yaml @@ -1,5 +1,6 @@ {{/* Miroir ServiceMonitor (requires prometheus-operator) +Plan §10: metrics scraping via ServiceMonitor */}} {{- if .Values.serviceMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 @@ -17,7 +18,7 @@ spec: selector: matchLabels: {{- include "miroir.selectorLabels" . | nindent 6 }} - app.kubernetes.io/component: miroir + app.kubernetes.io/component: metrics endpoints: - port: metrics interval: {{ .Values.serviceMonitor.interval | default "30s" }} diff --git a/charts/miroir/values.schema.json b/charts/miroir/values.schema.json index 70d2af6..b87149e 100644 --- a/charts/miroir/values.schema.json +++ b/charts/miroir/values.schema.json @@ -362,6 +362,21 @@ "annotations": {"type": "object"}, "name": {"type": "string"} } + }, + "serviceMonitor": { + "type": "object", + "properties": { + "enabled": {"type": "boolean"}, + "interval": {"type": "string"}, + "annotations": {"type": "object"} + } + }, + "prometheusRule": { + "type": "object", + "properties": { + "enabled": {"type": "boolean"}, + "annotations": {"type": "object"} + } } } } diff --git a/charts/miroir/values.yaml b/charts/miroir/values.yaml index 0ed11ec..2543796 100644 --- a/charts/miroir/values.yaml +++ b/charts/miroir/values.yaml @@ -187,3 +187,14 @@ serviceAccount: create: true annotations: {} name: "" + +# ServiceMonitor (plan §10) +serviceMonitor: + enabled: false # requires prometheus-operator in cluster + interval: 30s + annotations: {} + +# PrometheusRule (plan §10 + §14.9) +prometheusRule: + enabled: false # requires prometheus-operator in cluster + annotations: {}