DEV Community

Abdelrahman Ahmed
Abdelrahman Ahmed

Posted on

Monitor Persistent Volume usage in your cluster using kwatch

In this tutorial, I will help you set up and deploy kwatch on your Kubernetes cluster to monitor Persistent Volumes (PV) usage and detect crashes in your running apps.

Plus, integrate with Teams to get notified on a channel when volume usage is higher than a threshold.

You can integrate with your favorite channel as kwatch supports integrations with (Slack, Discord, Email, PagerDuty, Telegram, Rocket Chat, Mattermost, Opsgenie, Matrix, DingTalk, FeiShu, And Custom webhook).

Configure kwatch with Teams

Step 1: Get webhook

First of all, we need to get the webhook URL of the channel you want the notification to be received on it.
(Here
is how to get it)

Step 2: Get Configuration

Get the configuration template

curl  -L https://raw.githubusercontent.com/abahmed/kwatch/v0.8.3/deploy/config.yaml -o config.yaml
Enter fullscreen mode Exit fullscreen mode

Step 3: Edit config.yaml with the corresponding config

apiVersion: v1
kind: Namespace
metadata:
  name: kwatch
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: kwatch
  namespace: kwatch
data:
  config.yaml: |
    alert:
      teams:
        webhook: WEBHOOK_URL
    pvcMonitor:
      enabled: true
      interval: 5
      threshold: 70
Enter fullscreen mode Exit fullscreen mode

For more configurations check here

Step 4: Apply Configuration

kubectl apply -f config.yaml
Enter fullscreen mode Exit fullscreen mode

Deploy kwatch

Deploy kwatch on your cluster with one command

kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.8.3/deploy/deploy.yaml
Enter fullscreen mode Exit fullscreen mode

After deploying you will get notified on the channel that kwatch has started
successfully. Now, kwatch is monitoring your volumes and apps!

kwatch start message

Here is an example of kwatch messages when volume usage exceeds the threshold

kwatch detected issue

If you like kwatch, give it a star on GitHub!

We are happy to hear feedback from you and if you have any request, or suggestion don't hesitate to ping us on our channels (Discord, GitHub)

Top comments (0)