From eafae7646bab25b8845471e1bcdff0202e33eabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20L=C3=BCders?= Date: Wed, 6 Dec 2023 09:59:32 +0100 Subject: [PATCH] docs: better gather helm docs --- docs/gathered-data.md | 12 ++++++++++-- pkg/gatherers/workloads/gather_helm_info.go | 14 +++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/gathered-data.md b/docs/gathered-data.md index 68f24daa0..8015626dc 100644 --- a/docs/gathered-data.md +++ b/docs/gathered-data.md @@ -771,8 +771,16 @@ None ## HelmInfo -Collects summarized info about the helm usage on a cluster -in a generic fashion +Collects statistics about resources deployed via HelmChart, counting only the resources +with `app.kubernetes.io/managed-by=Helm` and `helm.sh/chart` labels. The data is then summarized +and grouped by hashed namespace. + +Resource types included: +- ReplicaSets +- DaemonSets +- StatefulSets +- Services +- Deployments ### API Reference None diff --git a/pkg/gatherers/workloads/gather_helm_info.go b/pkg/gatherers/workloads/gather_helm_info.go index 13ab6f583..e5de3f5bf 100644 --- a/pkg/gatherers/workloads/gather_helm_info.go +++ b/pkg/gatherers/workloads/gather_helm_info.go @@ -20,8 +20,16 @@ import ( const labelChartNameKey = "helm.sh/chart" -// GatherHelmInfo Collects summarized info about the helm usage on a cluster -// in a generic fashion +// GatherHelmInfo Collects statistics about resources deployed via HelmChart, counting only the resources +// with `app.kubernetes.io/managed-by=Helm` and `helm.sh/chart` labels. The data is then summarized +// and grouped by hashed namespace. +// +// Resource types included: +// - ReplicaSets +// - DaemonSets +// - StatefulSets +// - Services +// - Deployments // // ### API Reference // None @@ -84,7 +92,7 @@ func gatherHelmInfo( // Anonymize the namespace to make it unique identifier hash, err := createHash(item.GetNamespace()) if err != nil { - klog.Errorf("unable to hash the namespace '%s': %v", labels[labelChartNameKey], err) + klog.Errorf("unable to hash the namespace '%s': %v", item.GetNamespace(), err) continue }