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.What gets reported
A snapshot lists the pods running in scope. The reporter is blind to workload kind — aJob pod is reported exactly like a Deployment pod — and only pods in the Running and Failed phases are reported; Succeeded and Pending pods are not.
That matters most for short-lived workloads. A Job or CronJob pod is captured only while it is running, so a job that starts and finishes between two snapshots never appears, and a successful run leaves no trace in the environment. A pod that fails is the exception — it keeps being reported until Kubernetes cleans it up.
For the full model — how job pods affect environment churn and compliance, and what to do about it — see Understand Kubernetes reporting.
Running multiple reporters
A single Kosli environment must have exactly one reporter feeding it. Pointing two reporters at the same environment does not delete data, but it makes diffs between consecutive snapshots meaningless. For the supported and unsupported topologies, see Running multiple reporters.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
- See what snapshots do and don’t capture in Understand Kubernetes reporting