-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add operator-metrics port (#171)
* feat!: add operator-metrics port * fix: document fields, bump version, fix indent * feat: add dedicated ServiceMonitor for operator * fix: use different names on ServiceMonitors * fix: disable ServiceMonitors by default * fix: update README
- Loading branch information
Showing
9 changed files
with
128 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{- if .Values.prometheusRule.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ include "pyrra.fullname" . }}-prometheusrule | ||
labels: | ||
{{- include "pyrra.labels" . | nindent 4 }} | ||
spec: | ||
groups: | ||
- name: {{ include "pyrra.fullname" . }}-prometheusrules | ||
rules: | ||
- alert: PyrraReconciliationError | ||
# We use a 20m interval as the controller only reconciles roughly once every 15 minutes. This interval is | ||
# large enough to stop the rate from dropping to 0, causing a flapping alert. | ||
# The interval is short enough to resolve within a reasonable time after a broken SLO has been fixed/removed. | ||
expr: sum by (job) (rate(controller_runtime_reconcile_errors_total{controller="servicelevelobjective"}[20m])) > 0 | ||
for: 1m | ||
labels: | ||
severity: {{ .Values.prometheusRule.pyrraReconciliationError.severity }} | ||
{{- if .Values.prometheusRule.labels }} | ||
{{- toYaml .Values.prometheusRule.labels | nindent 12 }} | ||
{{- end }} | ||
annotations: | ||
summary: Failed to reconcile state | ||
description: 'Pyrra Kubernetes operator failed to reconcile. Check logs for invalid ServiceLevelObjectives.' | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{- if .Values.serviceMonitorOperator.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ template "pyrra.fullname" . }}-operator | ||
labels: | ||
{{- include "pyrra.labels" . | nindent 4 }} | ||
{{- if .Values.serviceMonitorOperator.labels }} | ||
{{- toYaml .Values.serviceMonitorOperator.labels | nindent 4}} | ||
{{- end }} | ||
spec: | ||
jobLabel: {{ .Values.serviceMonitorOperator.jobLabel | default (printf "%s-operator" (include "pyrra.fullname" .)) }} | ||
selector: | ||
matchLabels: | ||
{{- include "pyrra.selectorLabels" . | nindent 6 }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
endpoints: | ||
- port: op-metrics | ||
{{- if .Values.serviceMonitorOperator.interval }} | ||
interval: {{ .Values.serviceMonitorOperator.interval }} | ||
{{- end }} | ||
{{- if .Values.serviceMonitorOperator.metricRelabelings }} | ||
metricRelabelings: | ||
{{- toYaml .Values.serviceMonitorOperator.metricRelabelings | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.serviceMonitorOperator.relabelings }} | ||
relabelings: | ||
{{- toYaml .Values.serviceMonitorOperator.relabelings | nindent 6 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters