From 38503d40bca9900f41142c1597373df1c977bf5a Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 17 Jul 2024 11:35:41 +0545 Subject: [PATCH] examples notification for CrashLoopBackOff & CronJob failure --- .../examples/kube-job-failing.md | 18 ++++++++++++++++++ .../examples/kube-podcrashlooping.md | 19 +++++++++++++++++++ mission-control/sidebars.js | 10 ++++++++++ 3 files changed, 47 insertions(+) create mode 100644 mission-control/docs/notifications/examples/kube-job-failing.md create mode 100644 mission-control/docs/notifications/examples/kube-podcrashlooping.md diff --git a/mission-control/docs/notifications/examples/kube-job-failing.md b/mission-control/docs/notifications/examples/kube-job-failing.md new file mode 100644 index 00000000..7ada6f9b --- /dev/null +++ b/mission-control/docs/notifications/examples/kube-job-failing.md @@ -0,0 +1,18 @@ +--- +title: Kubernetes Job Failing +--- + +```yaml title="cronjob-alerts.yaml" +--- +apiVersion: mission-control.flanksource.com/v1 +kind: Notification +metadata: + name: cronjob-alerts + namespace: default +spec: + events: + - config.unhealthy + to: + connection: connection://flanksource-slack + filter: config.type == 'Kubernetes::CronJob' +``` diff --git a/mission-control/docs/notifications/examples/kube-podcrashlooping.md b/mission-control/docs/notifications/examples/kube-podcrashlooping.md new file mode 100644 index 00000000..b1f72da2 --- /dev/null +++ b/mission-control/docs/notifications/examples/kube-podcrashlooping.md @@ -0,0 +1,19 @@ +--- +title: PodCrashLooping notification +--- + +```yaml title="podcrashlooping-alerts.yaml" +--- +apiVersion: mission-control.flanksource.com/v1 +kind: Notification +metadata: + name: podcrashlooping-alerts + namespace: default +spec: + events: + - config.unhealthy + filter: config.type == 'Kubernetes::Pod' && config.status == 'CrashLoopBackOff' + to: + # use the slack connection as the recipient for this notification + connection: connection://flanksource-slack +``` diff --git a/mission-control/sidebars.js b/mission-control/sidebars.js index cf38d09f..d8e3ad44 100644 --- a/mission-control/sidebars.js +++ b/mission-control/sidebars.js @@ -139,6 +139,16 @@ const sidebars = { type: 'category', label: 'Examples', items: [ + { + type: 'doc', + id: 'notifications/examples/kube-podcrashlooping', + label: 'PodCrashLooping' + }, + { + type: 'doc', + id: 'notifications/examples/kube-job-failing', + label: 'Kubernetes Job Failing' + }, { type: 'doc', id: 'notifications/examples/slack',