Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[kubewatch] Track all changes to Kubernetes Resource.

Posted on January 5, 2026January 7, 2026 By nim No Comments on [kubewatch] Track all changes to Kubernetes Resource.

Làm thể nào để chúng ta kiểm tra hay các nhận thông báo nếu ai đó change secret trên K8S không?

Đâu tiên chúng ta tìm hiểu kubewatch

https://github.com/robusta-dev/kubewatch/tree/master

repo: https://robusta-charts.storage.googleapis.com
Chart: kubewatch:3.5.0

Helm value:


resourcesToWatch:
  deployment: false
  replicationcontroller: false
  replicaset: false
  daemonset: false
  services: false
  pod: false
  job: false
  secret: true
  configmap: false
  ingress: false
  event: false
slack:
  enabled: false
  channel: ""
  token: ""
msteams:
  enabled: true
  webhookurl: "https://default58122277edf8404896c4ec80d30669.b8.environment.api.powerplatform.com:443/powerautomate/automations/direct/workflows/7428fdb75cad4150825de9aae19b8084/triggers/manual/paths/invoke?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=ous1sSkDadDNZkYe-LPoltFxxxxxxs"
namespaceToWatch: "nim-dev"

rbac:
  create: true
  clusterRole: true 
  customRoles:
    - apiGroups: [""]
      resources: ["secrets", "events"]
      verbs: ["list", "watch", "get"]
    - apiGroups: ["events.k8s.io"]
      resources: ["events"]
      verbs: ["list", "watch", "get"]

Cấu hình này yêu cầu Kubewatch chỉ giám sát các thay đổi liên quan đến Secret nằm trong namespace mdaas-engines-dev và gửi thông báo về Microsoft Teams (thông qua Power Automate).

Chi tiết từng phần:

  1. resourcesToWatch (Bộ lọc nội dung):
    • secret: true: Chỉ bật tính năng theo dõi Secret (tạo/sửa/xóa).
    • event: false: Tắt theo dõi các sự kiện hệ thống chung (như Pod scaling, Error logs…) để tránh bị spam tin nhắn rác.
    • Các resource khác (Pod, Deployment…): Đều tắt (false).
  2. msteams (Kênh thông báo):
    • Gửi tin nhắn đến URL Webhook của Power Automate (Workflow) mà bạn đã thiết lập.
  3. namespaceToWatch (Phạm vi):
    • Chỉ định cụ thể namespace mdaas-engines-dev. Kubewatch sẽ bỏ qua tất cả thay đổi ở các namespace khác (như default, kube-system…).
  4. rbac (Quyền hạn):
    • Cấp quyền cho Pod Kubewatch được phép “nhìn thấy” (list/watch) Secrets và Events trên API Server.
    • Lưu ý: Mặc dù bạn đã tắt event: false ở trên (để không nhận thông báo), nhưng bạn vẫn cấp quyền events ở đây để tránh việc Pod bị crash do lỗi “Forbidden” khi khởi động.

Payload mà Kubewatch gửi vào team sẽ là như sau:

{
  "@type": "MessageCard",
  "@context": "http://schema.org/extensions",
  "themeColor": "DEFF22",
  "summary": "kubewatch notification received",
  "title": "kubewatch",
  "sections": [
    {
      "activityTitle": "A `Secret` in namespace `-dev` has been `Updated`:\n`secret`",
      "facts": null,
      "markdown": true
    }
  ]
}
{
    "type": "object",
    "properties": {
        "summary": {
            "type": "string"
        },
        "themeColor": {
            "type": "string"
        },
        "sections": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "activityTitle": {
                        "type": "string"
                    },
                    "markdown": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "activityTitle"
                ]
            }
        }
    }
}

Để cấu hình teams thì bạn coi bên này.

[Teams] Microsoft Teams notification
Kubernetes, Kubernetes & Container

Post navigation

Previous Post: [Paping] Check TCP connection using Paping on Ubuntu.
Next Post: [Interview] Những kiến thực thú vị cần tìm hiểu trong interview

More Related Articles

[Vault] Eliminate Kubernetes Secrets With Secrets Store CSI Driver (SSCSID) Kubernetes
[Nextcloud] Hướng dẫn tăng dung lượng upload file trong Docker nextcloud – upload_max_filesize Kubernetes & Container
[HPA/Kubernetes] Scale Up As Usual, Scale Down Very Gradually – behavior in HPA K8s Kubernetes
[K8s] Signals and the “kubectl delete” command Kubernetes
[Vault/Consul] Install vault and consul through Helm in K8s Kubernetes & Container
[Helm Chart] Tìm hiểu – (gạch giữa), _ (gạch dưới), dấu chấm “.” trong helm chart Helm Chart

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • Compare Instance mode (NodePort) và IP mode (Pod IP) in EKS Application Load Balancer (ALB) March 14, 2026
  • [Database] How do you choose the best database for your product. March 14, 2026
  • [Openclaw] Openclaw authentication with chatgpt March 8, 2026
  • [OpenClaw]”Openclaw suddenly became stupid” or “lost its rights.” March 8, 2026
  • [GatewayAPI/Traefik] (Error) Failed to verify certificate: x509: certificate has expired March 6, 2026

Archives

  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • AI
    • OpenClaw
  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2026 NimTechnology.