0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

helmfileでKubewatchを導入してリソースの変更をSlackに通知してみた

0
Last updated at Posted at 2025-12-22

この記事は kubernetes Advent Calendar 2025の記事です。

はじめに

ふと、k8s環境を運用している時に誰か悪い人間が悪戯で設定を変えても誰も悪戯に気付けないじゃん、と思い今回Kubewatchを検証してみました。

Kubewatchとは

k8sリソースに変更が加わった際に変更されたことの通知を送信するk8sリソースです。
通知先はSlackやメール等に通知可能です。

結論

Kubewatchよりrobustaの方が便利です!

検証で利用したバージョン

  • EKS:v1.32
  • helmfile:v0.144.0
  • KubewatchのChartバージョン:3.5.0

導入前準備

弊社環境ではAWS ECRにイメージを格納して利用していますので、下記URL先のイメージ(タグ:v2.9.0)を格納しました。

Kubewatch導入

今回はhelmfileを利用して導入しました。
弊社では他のリソース(Nginx Ingress ControllerやTrident等)もhelmfileで併せて導入しているのでhelmfileに集約させてデプロイするようにしています。

1.helmfileを導入しているk8s環境管理用サーバに下記2ファイルを作成

helmfile.yaml
repositories:
 - name: robusta
   url: https://robusta-charts.storage.googleapis.com

releases:
 - name: kubewatch
   namespace: monitoring
   createNamespace: true
   chart: robusta/kubewatch
   version: 3.5.0
   values:
   - /yaml/values.yaml
values.yaml
# /yamlディレクトリ配下に作成
image:
  repository: <aws-account-id>.dkr.ecr.ap-northeast-1.amazonaws.com/monitoring/kubewatch
  tag: v2.9.0
  pullPolicy: Always
slack:
  enabled: false
slackwebhook: #今回はSlackのwebhookを使っています。
  enabled: true
  channel: '<#channel-name>'
  username: 'test-bot'
  emoji: ""
  slackwebhookurl: '<webhook-url>'
resourcesToWatch: #お好みで各リソースを対象/非対象とするか決めてください。
  daemonset: true
  services: true
  event: false
  pod: false
  ingress: true
rbac:
  create: true

2.デプロイコマンド実行
※helmfile.yamlを配置したディレクトリで下記コマンドを実行

# helmfile apply

これでデプロイ完了です。
簡単!


※GithubのREADMEには記載されていますが、Helmで導入する場合は下記コマンドで導入可能です。カスタマイズの方法は割愛します。

$ helm repo add robusta https://robusta-charts.storage.googleapis.com && helm repo update
$ helm install my-release robusta/kubewatch

検証

・KubewatchのPodを再起動
結果:Slackのチャンネルに通知が一度に5件ほど入る。
→Deploymentのステータス更新が5回入るから?原因不明。

image.png

・ingressのpathの設定を変える
結果:通知1件入る

image.png

最後に

Kubewatchを使ってみて感じた良いところは”軽量”。
それくらいかなと思いました。

逆に不満に思ったことは、設定が変更されたことは通知されるが、何が変更されたかは通知から分からないことです。
通知が入ったら結局環境を見に行って差分を探す必要があります。
カスタマイズ性も低い。

robustaを使うことでSlackだけでどのk8sリソースのどこの設定が変更となったかを確認できると他の方の記事で見たので、次はrobustaを検証してみたいと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?