Skip to main content

Monitor Persistent Volumes in your cluster using kwatch

ยท 2 min read
Abdelrahman Ahmed

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.5/deploy/config.yaml -o config.yaml

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

For more configurations check here

Step 4: Apply Configuration

kubectl apply -f config.yaml

Deploy kwatchโ€‹

Deploy kwatch on your cluster with one command

kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.8.5/deploy/deploy.yaml

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

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

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)