Search code examples
kuberneteskubernetes-helmkubectl

Is There a Way to Detect Changes made to Resources Deployed by a Helm Chart


We have several resources deployed as part of a helm (v3) chart. Some time ago, I made changes to resources deployed by that helm chart manually, via kubectl. This caused some drift between the values in the yaml resources deployed by the helm release (as show by helm get values <release>) and what is actually deployed in the cluster

Example: kubectl describe deployment <deployment> shows an updated image that was manually applied via a kubectl re-apply. Whereas helm show values <release> shows the original image used by helm for said deployment.

I realize that I should have performed a helm upgrade with a modified values.yaml file to execute the image change, but I am wondering if there is a way for me to sync the state of the values I manually updated with the values in the helm release. The goal is to create a new default values.yaml that reflect the current state of the cluster resources.

Thanks!


Solution

  • kubectl diff will help to identify the changes but it needs the manifests to do that. One has to generate manifests from the helm and identify drifts from each one of them by running kubectl diff.

    I have created a helm plugin helm-drift (heavily depends on kubectl diff) which takes care of communication between helm and kubectl-diff to identify drifts.