Prerequisites
- Have access to a Kubernetes cluster.
- Create a Kubernetes Kosli environment named
k8s-tutorial. - Get a Kosli API token.
Report a snapshot
- Helm chart (recommended)
- Externally scheduled cron
- Kosli CLI (testing only)
The Kosli K8S reporter Helm chart deploys a inside your cluster that automatically reports running artifacts to Kosli on a schedule. This is the recommended approach for production use.Install Helm if you have not done so.The CronJob will now run every 5 minutes and report what is running in the cluster to Kosli.
- Create a Kubernetes secret containing your Kosli API token:
- Create a
tutorial-values.yamlfile to configure the chart:
- Install the chart:
- Confirm the CronJob was created:
Running on EKS with Karpenter, or another node autoscaler? A reporter pod arriving every 5 minutes can stop nodes being consolidated. Pin the reporter to a stable node group, widen
cronSchedule, or run it out of cluster. See Running on EKS with Karpenter.Running multiple reporters
If you are considering running more than one reporter against the same cluster, the table below summarizes which setups produce meaningful snapshots and which don’t.| Scenario | Supported | Explanation |
|---|---|---|
| Two orgs, separate environments, overlapping namespaces | Yes | Different environments → independent snapshots. |
| One org, two environments, overlapping namespaces | Yes | Same as above. |
| One org, same environment, two reporters with overlapping namespaces | No | Snapshots toggle between each reporter’s view. No data is deleted, but diffs between consecutive snapshots become meaningless. |
| One org, same environment, two reporters with disjoint namespaces | No | Each snapshot only reflects one reporter’s namespaces, so diffs compare unrelated scopes. |
What you’ve accomplished
You have reported a snapshot of your Kubernetes cluster to Kosli. Kosli now tracks the running artifacts in that environment and will record changes as they happen. From here you can:- Query your environment with
kosli list snapshotsandkosli get snapshot - Compare snapshots to see what changed
- Trace a running artifact back to its git commit with the From commit to production tutorial