k8s-reporter
This reference applies to chart version 2.3.1, which defaults to CLI v2.12.0 via
appVersion. Override with image.tag.name and optional namespace selectors. Use one entry for a single environment, or multiple entries to report to different environments with different selectors.
Breaking change in v2.0.0
Version 2.0.0 removes the previous single-environment mode (kosliEnvironmentName and the namespaces / namespacesRegex / excludeNamespaces / excludeNamespacesRegex flags). You now configure one or more environments only via reporterConfig.environments. To report a single environment, use a list with one entry.
Prerequisites
- A Kubernetes cluster (minimum supported version is
v1.21) - Helm v3.0+
- If you want to report artifacts from just one namespace, you need to have permissions to
getandlistpods in that namespace. - If you want to report artifacts from multiple namespaces or entire cluster, you need to have cluster-wide permissions to
getandlistpods.
Installing the chart
To install this chart via the Helm chart repository:Install the helm chart
Configure reporterConfig.environments (required). Each entry has required One environment, specific namespaces:Multiple environments with different selectors:
name and optional namespaces, namespacesRegex, excludeNamespaces, excludeNamespacesRegex. Omit namespace fields for an entry to report the entire cluster to that environment.One environment, entire cluster:Chart source can be found at GitHub.
See all available configuration options below.
Upgrading the chart
If upgrading from v1.x to v2.0.0, migrate your values to the environments list format (see above). Then:Uninstalling chart
Running behind a TLS-inspecting proxy (corporate / custom CA bundle)
If your network sits behind a TLS-inspecting appliance (Zscaler, Netskope, Palo Alto, etc.) that re-signs HTTPS traffic with a corporate CA certificate, the reporter will fail withx509: certificate signed by unknown authority. To fix this, make the appliance’s CA bundle available to the reporter.
The chart offers two ways to do this. Use whichever fits your deployment flow.
Option 1 — customCA convenience wrapper (recommended for the common case)
The chart mounts the certificate as a single file at
/etc/ssl/certs/kosli-custom-ca.crt using subPath. Go’s standard library on Linux loads CA roots in two independent passes — it reads the system bundle file (e.g. /etc/ssl/certs/ca-certificates.crt) and also scans /etc/ssl/certs/ for additional certificate files. The mounted file is picked up by the directory scan and added to the trust store alongside the system roots, so no SSL_CERT_FILE env var is needed.
The wrapper deliberately does not set SSL_CERT_FILE. Setting it would replace the system bundle entirely with the customer’s file, breaking trust for any public CAs the bundle does not include.
Option 2 — generic extraVolumes / extraVolumeMounts / extraEnvVars
Use these when you need a non-default mount path, a ConfigMap instead of a Secret, multiple volumes, or any other shape the wrapper does not cover:Pod Security Standards
Both options usesecret-backed volumes, which are permitted under the Pod Security Standards restricted profile. hostPath mounts are not permitted under that profile and should not be used here.
Cluster-wide alternative
If you already run cert-manager’s trust-manager to distribute a corporate CA bundle into a well-known ConfigMap in every namespace, pointextraVolumes / extraVolumeMounts at that ConfigMap instead of creating a per-namespace Secret.
Running on EKS with Karpenter (or another node autoscaler)
By default the reporter runs as a CronJob every 5 minutes. On clusters that use Karpenter for node autoscaling, this frequent scheduling can prevent nodes from being consolidated (scaled down). The cause is Karpenter’sconsolidateAfter timer: Karpenter only consolidates a node once it has seen no pod scheduling activity on it for the configured window. A reporter pod arriving every 5 minutes keeps resetting that timer, so any node whose consolidateAfter is longer than the reporter interval never becomes eligible for consolidation (see karpenter#1921). This is Karpenter working as designed, not a reporter bug.
Frequent snapshots are what let Kosli surface drift or an unauthorized change quickly, so the best fix keeps the 5-minute cadence and moves the reporter out of Karpenter’s way. Widening the interval trades away that detection speed and should be a last resort.
1. Pin the reporter to a stable node group (recommended)
If you run a stable managed node group that Karpenter does not manage, schedule the reporter there so it never disturbs Karpenter-managed nodes. UsenodeSelector, and tolerations if that node group is tainted:
affinity (a plain nodeSelector cannot express “not on these nodes”):
2. Run the reporter out of the cluster
For zero footprint on cluster nodes, runkosli snapshot k8s on a schedule outside the cluster (for example a CI cron job) with kubeconfig access, keeping your reporting cadence without placing a pod on the cluster’s nodes. See the Kubernetes environment reporting tutorial.
3. Widen the report interval (last resort)
Only if you cannot pin the reporter or move it out of cluster: setcronSchedule longer than your NodePool’s consolidateAfter so nodes get quiet windows long enough to consolidate. This works, but a longer interval widens the window in which a change can go unreported, so prefer the options above.
Configurations
General
Affinity rules for scheduling the reporter pod. Supports nodeAffinity, podAffinity and podAntiAffinity.
Specifies how to treat concurrent executions of a Job that is created by this CronJob.
The cron schedule at which the reporter is triggered to report to Kosli.
Specifies the number of failed finished jobs to keep.
Overrides the fullname used for the created k8s resources. It has higher precedence than
nameOverride.Overrides the name used for the created k8s resources. If
fullnameOverride is provided, it has higher precedence than this one.Node labels for scheduling the reporter pod. On EKS with Karpenter, use this to pin the reporter to a stable managed node group (e.g.
eks.amazonaws.com/nodegroup: <name>) so it does not interfere with node consolidation. See the “Running on EKS with Karpenter” section of the README.Annotations to add to the CronJob object itself. For pod-level annotations (added to each reporter pod), use
podTemplateAnnotations instead.Custom labels to add to pods.
Annotations to add to the reporter pod template (applied to each Job pod that the CronJob creates).
Specifies the number of successful finished jobs to keep.
Tolerations for scheduling the reporter pod, e.g. to run on a dedicated or tainted node group.
Image
The kosli reporter image pull policy.
The kosli reporter image repository.
The kosli reporter image tag, overrides the image tag whose default is the chart appVersion.
Reporter configuration
Whether the dry run mode is enabled or not. In dry run mode, the reporter logs the reports to stdout and does not send them to kosli.
List of Kosli environments to report to. Each entry has required ‘name’ and optional namespace selectors. Use one entry to report a single environment; use multiple entries to report to multiple environments with different selectors. Per entry: name (required), namespaces, namespacesRegex, excludeNamespaces, excludeNamespacesRegex (optional). Leave namespace fields unset for an entry to report the entire cluster to that environment.
The http proxy url.
The name of the Kosli org.
The security context for the reporter cronjob. Set to null or to disable security context entirely (not recommended). For OpenShift with SCC, explicitly set runAsUser to null to let OpenShift assign the UID from the allowed range. Simply omitting runAsUser from your values override will not work because Helm deep-merges with these defaults. Example OpenShift override: securityContext: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: null.
Whether to allow privilege escalation.
Whether to run as non root.
The user id to run as. For OpenShift environments with SCC, set to null (runAsUser: null) to allow automatic UID assignment. Simply omitting this field will not work due to Helm’s deep merge with chart defaults.
Kosli API token
The name of the key in the secret data which contains the Kosli API token.
The name of the secret containing the kosli API token.
Environment variables
Map of plain environment variables to inject into the reporter container. For a single-tenant Kosli instance, set
KOSLI_HOST to https://INSTANCE_NAME.kosli.com.Additional environment variables to inject into the reporter container. List of
{name, value} or {name, valueFrom} entries, rendered verbatim into the container env. Supports plain values and valueFrom (secretKeyRef / configMapKeyRef). Note: entries here are appended after the chart’s own env entries; on duplicate names the later entry wins.Volumes
Additional container-level volumeMounts for the reporter container. Rendered verbatim into the container spec alongside the chart’s own mounts.
Additional Pod-level volumes to attach to the reporter pod. Rendered verbatim into the Pod spec alongside the chart’s own volumes. Use together with
extraVolumeMounts to mount Secrets, ConfigMaps, or other volumes into the container.Custom CA
Convenience wrapper for mounting a corporate / custom CA bundle. See the “Running behind a TLS-inspecting proxy” section of the README for usage.
Enable mounting a corporate/custom CA bundle into the trust store.
Key within the Secret that holds the PEM-formatted CA certificate (single cert or multi-cert PEM bundle).
Name of an existing Secret in the same namespace containing the CA bundle.
Resources
The cpu limit.
The memory limit.
The memory request.
Service account
Annotations to add to the service account.
Specifies whether a service account should be created.
The name of the service account to use. If not set and create is true, a name is generated using the fullname template.
Specifies whether to create a cluster-wide permissions for the service account or namespace-scoped permissions. allowed values are: [cluster, namespace].
Autogenerated from chart metadata using helm-docs v1.14.2