A kubernetes controller for monitoring kubernetes cluster resources and send notifications/alerts on events. This system gets a set of rules as an input, after that it surveillance your cluster and it sends notifications via email if any violations occurred.
Here is the state machine of our system.
Kubernetes cluster -> Pods -> Resources -> Check rules -> Rules violation -> Send email
Create a config.yml
file based on config.example.yml
template.
mailgun:
sender: "pods-watcher.monitoring.snapp.ir"
receiver: "main.sre.team.snapp.ir"
subject: "pods-watcher-violation-email"
domain: "<mailgun.domain>"
key: "<mailgun.private_key>"
rules:
- name: "nginx apps"
cpu: 10
ram: 10
labels:
app: nginx
In order to make a deployment of this controller run make
command.