Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the service monitor in rollout helm chart. #134

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion charts/rollout/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: rollout
appVersion: 0.1.0
description: Chart to deploy Rollout
engine: gotpl
version: 0.14.4
apiVersion: v1
version: 0.14.5
maintainers:
- email: [email protected]
name: Prakarsh
- email: [email protected]
name: Devtron Devops Team
24 changes: 24 additions & 0 deletions charts/rollout/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if $.Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
{{- if .Values.prometheusRule.annotations }}
annotations:
{{ toYaml .Values.prometheusRule.annotations | indent 4 }}
{{- end }}
{{- if .Values.prometheusRule.labels }}
labels:
{{ toYaml .Values.prometheusRule.labels | indent 4 }}
{{- end }}
name: prometheus-operator-kubernetes-rollout-rules
{{- if .Values.prometheusRule.namespace }}
namespace: {{ .Values.prometheusRule.namespace }}
{{- end }}
spec:
groups:
- name: rollout.rules
{{- if .Values.prometheusRule.rules }}
rules:
{{ toYaml .Values.prometheusRule.rules | indent 8 }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/rollout/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if $.Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.serviceMonitor.labels }}
labels:
{{ toYaml .Values.serviceMonitor.labels | indent 4 }}
{{- end }}
name: argo-rollouts-sm
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.serviceMonitor.endpoints }}
endpoints:
{{ toYaml .Values.serviceMonitor.endpoints | indent 2 }}
{{- end }}
selector:
{{- if .Values.serviceMonitor.matchLabels }}
matchLabels:
{{ toYaml .Values.serviceMonitor.matchLabels | indent 6 }}
{{- end }}
{{- end }}
68 changes: 67 additions & 1 deletion charts/rollout/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,70 @@ rollout:
tolerations: []
podLabels: {}
podAnnotations: {}
replicaCount: 1
replicaCount: 1

# configuration for service monitor
serviceMonitor:
enabled: false
labels:
app: argo-rollouts
kind: Prometheus
release: monitoring
endpoints:
- interval: 50s
path: /metrics
port: metrics
scheme: http
scrapeTimeout: 9s
matchLabels:
app.kubernetes.io/name: argo-rollouts-metrics

# configuration for prometheus rule
prometheusRule:
enabled: false
# Provide the requried labels
labels: {}
annotations: {}
namespace: monitoring
rules:
- alert: Rollout-Paused
annotations:
message: Rollout {{ $labels.name }} is Paused in namespace {{
$labels.exported_namespace }}
expr: sum by (name,exported_namespace) (rollout_phase{phase="Paused"} ) > 0
for: 5m
labels:
severity: critical
- alert: Rollout-InvalidSpec
annotations:
message: Rollout {{ $labels.name }} has InvalidSpec in namespace {{
$labels.exported_namespace }}
expr: sum by (name,exported_namespace) (rollout_phase{phase="InvalidSpec"} ) > 0
for: 5m
labels:
severity: critical
- alert: Rollout-Error
annotations:
message: Rollout {{ $labels.name }} has Error in namespace {{
$labels.exported_namespace }}
expr: sum by (name,exported_namespace) (rollout_phase{phase="Error"} ) > 0
for: 1m
labels:
severity: critical
- alert: Rollout-Progressing
annotations:
message: Rollout {{ $labels.name }} is in progressing state in namespace {{
$labels.exported_namespace }} since 20 minute
expr: sum by (name,exported_namespace) (rollout_phase{phase="Progressing"} ) > 0
for: 20m
labels:
severity: critical
- alert: Rollout-Timeout
annotations:
message: Rollout {{ $labels.name }} taking longer to get healthy in namespace {{
$labels.exported_namespace }}
expr: sum by (name,exported_namespace) (rollout_phase{phase="Timeout"} ) > 0
for: 1m
labels:
severity: critical