Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions helm/templates/prometheus-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.metrics.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ .Chart.Name | trimSuffix "-chart" | trunc 44 }}-controller-rules
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ack-rds-controller.app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
k8s-app: {{ include "ack-rds-controller.app.name" . }}
helm.sh/chart: {{ include "ack-rds-controller.chart.name-version" . }}
{{- with .Values.metrics.prometheusRule.additionalLabels }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
groups:
- name: {{ include "ack-rds-controller.app.name" . }}
rules:
{{- with .Values.metrics.prometheusRule.rules }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}

36 changes: 36 additions & 0 deletions helm/templates/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Chart.Name | trimSuffix "-chart" | trunc 44 }}-controller-metrics
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "ack-rds-controller.app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
k8s-app: {{ include "ack-rds-controller.app.name" . }}
helm.sh/chart: {{ include "ack-rds-controller.chart.name-version" . }}
{{- with .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "ack-rds-controller.app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: Helm
k8s-app: {{ include "ack-rds-controller.app.name" . }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: metricsport
{{- with .Values.metrics.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- end }}

53 changes: 53 additions & 0 deletions helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,59 @@
"type"
],
"type": "object"
},
"serviceMonitor": {
"description": "Prometheus ServiceMonitor settings",
"properties": {
"enabled": {
"type": "boolean"
},
"additionalLabels": {
"type": "object"
},
"interval": {
"type": "string"
},
"scrapeTimeout": {
"type": "string"
}
},
"type": "object"
},
"prometheusRule": {
"description": "Prometheus PrometheusRule settings",
"properties": {
"enabled": {
"type": "boolean"
},
"additionalLabels": {
"type": "object"
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"alert": {
"type": "string"
},
"expr": {
"type": "string"
},
"for": {
"type": "string"
},
"labels": {
"type": "object"
},
"annotations": {
"type": "object"
}
}
}
}
},
"type": "object"
}
},
"required": [
Expand Down
26 changes: 26 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,32 @@ metrics:
# Which Type to use for the Kubernetes Service?
# See: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
type: "ClusterIP"
serviceMonitor:
# Set to true to automatically create a Prometheus ServiceMonitor resource
# Requires the Prometheus Operator CRDs to be installed
enabled: false
# Additional labels for the ServiceMonitor (e.g., for Prometheus selector)
additionalLabels: {}
# Scrape interval
interval: 30s
# Scrape timeout
scrapeTimeout: 10s
prometheusRule:
# Set to true to automatically create a Prometheus PrometheusRule resource
# Requires the Prometheus Operator CRDs to be installed
enabled: false
# Additional labels for the PrometheusRule (e.g., for Prometheus selector)
additionalLabels: {}
# Alert rules (can be overridden or extended)
rules:
- alert: RDSControllerSyncErrors
expr: sum by (controller) (rate(controller_runtime_reconcile_errors_total{job="rds-controller-metrics"}[10m])) > 0.5
for: 5m
labels:
severity: critical
annotations:
description: RDS controller having sync errors in the last 10 minutes for controller {{ $labels.controller }}
summary: RDS controller having sync errors with one or more objects

resources:
requests:
Expand Down