update chart to support multi env reporting#690
Conversation
AlexKantor87
left a comment
There was a problem hiding this comment.
Nice work on this, Sami — the move to a multi-environment config list is clean and the ConfigMap approach is solid. A few things I'd flag:
1. kosliOrg default changed from "" to "my-org" (values.yaml)
This looks unintentional. The old default was an empty string — shipping a placeholder like "my-org" means someone could install the chart without overriding it and silently report to a non-existent org. I'd revert this to "".
2. Default environment entry - name: prod-env is uncommented (values.yaml)
The default values ship with an active (uncommented) entry. Combined with the new validation only checking that environments is non-empty and each entry has a name, helm install will succeed without the user configuring anything meaningful — it'll try to report to prod-env in my-org. The old chart used a required call to force the user to set kosliEnvironmentName. I'd suggest either commenting out the default entry (so the validation fails and prompts the user to configure), or keeping the environments default as [] and relying on the validation to surface a clear error.
3. Per-entry namespace conflict validation is gone
The old _validations.tpl checked that include and exclude selectors weren't combined (e.g. namespaces + excludeNamespaces). The new validation only checks for a non-empty list and presence of name. If this conflict validation is now handled by the CLI when it parses config.yaml, that's fine — but worth confirming, and maybe worth a comment in the template noting where that validation lives now.
4. README table vs actual defaults mismatch
The values table says reporterConfig.environments defaults to [], but the actual values.yaml has a populated entry. Minor, but worth aligning.
Everything else looks good — ConfigMap template correctly uses toJson for array fields and quote for name, cronjob volume/volumeMount is well-placed, --config-file arg swap is clean, and the old env var injection removal is complete.
|
Summary
related to kosli-dev/server#4720
Breaking change (v2.0.0): Replaces the single-environment reporting model in the k8s-reporter Helm chart with a new multi-environment configuration.
What changed
The old chart allowed reporting to only one Kosli environment at a time via flat values (
kosliEnvironmentName,namespaces,namespacesRegex,excludeNamespaces,excludeNamespacesRegex). This PR replaces all of those with a singlereporterConfig.environmentslist, where each entry has a requirednameand optional namespace selectors. This enables reporting to multiple Kosli environments with different namespace filters from a single chart installation.Changes by file
environmentslist including commented-out examplesconfig.yamlmounted into the reporter container/config; container args now use--config-file /config/config.yamlinstead of positional env name; removed old env var injection for namespace filtersenvironmentsis non-empty and every entry has anameMigration from v1.x
Users must migrate from the old flat values to the new
reporterConfig.environmentslist format. A single-environment setup is a list with one entry: