After this, every Deployment, StatefulSet, and DaemonSet change in your cluster generates a CDEvent automatically — no matter how it was deployed.
Episode #5 explained the gap. This episode closes it.
What You Need
- CDviz running with
cdviz-collectorreachable from inside the cluster - Kubernetes v1.19+ with kubectl access
- Helm 3
The Command
helm install cdviz-collector oci://ghcr.io/cdviz-dev/charts/cdviz-collector \
--set kubewatch.enabled=true \
--namespace cdviz \
--create-namespace
That single flag (kubewatch.enabled=true) deploys kubewatch alongside cdviz-collector and wires them together:
- kubewatch watches Deployment/StatefulSet/DaemonSet changes cluster-wide (can be configured)
- cdviz-collector receives kubewatch CloudEvents and transforms them to CDEvents
- RBAC is configured automatically (read-only ClusterRole)
See Kubernetes (via Kubewatch) Integration for details.
Verify It Works
1. Check both pods are running:
kubectl get pods -n cdviz
# NAME READY STATUS
# cdviz-collector-xxx 1/1 Running
# kubewatch-xxx 1/1 Running
2. Trigger a test deployment:
kubectl create deployment test-nginx --image=nginx:latest
3. Confirm the CDEvent arrived:
kubectl logs -n cdviz -l app=cdviz-collector --tail=20 | grep service.deployed
You should see a service.deployed event within a few seconds. Check your Grafana dashboard — the deployment appears there too.
4. Clean up:
kubectl delete deployment test-nginx
What Gets Captured
| Kubernetes change | CDEvent type |
|---|---|
| Deployment created | service.deployed |
| Image or config updated | service.upgraded |
| Deployment deleted | service.removed |
| StatefulSet / DaemonSet changes | same as above |
The provided transformer for kubewatch event defines the service ID as "{{ namespace }}/{{ resource_name }}/{{ container_name }}" (where resource_name is the name of the Deployment, StatefulSet, or DaemonSet) to avoid collisions. In our example: default/test-nginx/nginx.
Limiting Scope (Optional)
By default, kubewatch watches all namespaces. To limit to specific ones:
helm upgrade cdviz-collector oci://ghcr.io/cdviz-dev/charts/cdviz-collector \
--set kubewatch.enabled=true \
--set kubewatch.namespaceToWatch="production,staging" \
--namespace cdviz
This reduces event volume and avoids noise from system namespaces.
Top comments (0)