How Harness lists Kubernetes resources to delete when using "Delete Resources by Release Name" option



This article explores how the Kubernetes (K8s) Delete step lists resources to delete when using the “Release Name” option.


How Harness Tracks Resources

When deploying a release using Harness, the platform creates a ConfigMap listing the resources associated with the release. The ConfigMap is stored in the same namespace as the release and contains two attributes, isReleaseHistoryCompressed and releaseHistory. The isReleaseHistoryCompressed attribute specifies whether the releaseHistory attribute is compressed or not. The releaseHistory attribute contains a list of resources associated with the release.

To view the resources tracked by Harness, you can use the kubectl command-line tool. Here is an example command that will decode and decompress the releaseHistory attribute of the ConfigMap to list the resources:

kubectl get configmap <release-name> -n <namespace_name> -o jsonpath='{.data.releaseHistory}' | base64 -d | gzip -d

For more information