You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello, I'm trying to create a helm chart for existing resources in the cluster with the least breaking changes as possible. So let's say I have a single resource to import (for simplicity):
$ kubectl get sa sa-test -o yaml
apiVersion: v1
imagePullSecrets:
- name: image-pull-secret
kind: ServiceAccount
metadata:
name: sa-test
namespace: test
My steps:
install an "empty" chart, with no resources (this is to trick helm diff upgrade to work)
hi @yxxhero I was able to figure out a workaround using helm-diff + another helm plugin called adopt
if I run adopt first (which in my understanding creates a release + puts labels and annotations over existing resource), and then follow by diff - the diff is properly displayed:
helm-diff is a plugin for Helm that is used to compare differences between two versions of Helm charts. By default, helm-diff performs its analysis by comparing the local Chart version with the version in the remote repository, and it does not interact directly with the resources deployed in the Kubernetes cluster.
When using helm-diff, its main functions are:
To compare the configurations and templates of two chart versions to identify the differences between them.
To display which Kubernetes resources would change if an upgrade to the new version were to be performed.
However, helm-diff does not directly interact with the Kubernetes cluster; it does not read the actual state of the resources running in the cluster. It simply analyzes the chart information saved in the Helm Release Secret and the current chart directory to show the differences.
If you want to compare the actual resources running in the Kubernetes cluster with the Helm templates, you might need to use other tools or methods, such as manually comparing with kubectl command-line tool, or using other specialized tools for cluster resource versioning and reconciliation.
Understanding the capabilities and limitations of each tool when dealing with Kubernetes cluster resources and Helm charts is crucial for effectively managing and deploying your applications.
Activity
AndriiOmelianenko commentedon Jul 4, 2024
regarding step #1 , without it, I get this:
AndriiOmelianenko commentedon Jul 4, 2024
here is even simpler flow:
what am I missing?
yxxhero commentedon Jul 4, 2024
@AndriiOmelianenko what's your expected?
AndriiOmelianenko commentedon Jul 5, 2024
hi @yxxhero I was able to figure out a workaround using
helm-diff+ another helm plugin calledadoptif I run adopt first (which in my understanding creates a release + puts labels and annotations over existing resource), and then follow by diff - the diff is properly displayed:
I wonder why the same doesn't work if I just label and annotate resources myself
yxxhero commentedon Jul 5, 2024
helm-diffis a plugin for Helm that is used to compare differences between two versions of Helm charts. By default,helm-diffperforms its analysis by comparing the local Chart version with the version in the remote repository, and it does not interact directly with the resources deployed in the Kubernetes cluster.When using
helm-diff, its main functions are:However,
helm-diffdoes not directly interact with the Kubernetes cluster; it does not read the actual state of the resources running in the cluster. It simply analyzes the chart information saved in the Helm Release Secret and the current chart directory to show the differences.If you want to compare the actual resources running in the Kubernetes cluster with the Helm templates, you might need to use other tools or methods, such as manually comparing with
kubectlcommand-line tool, or using other specialized tools for cluster resource versioning and reconciliation.Understanding the capabilities and limitations of each tool when dealing with Kubernetes cluster resources and Helm charts is crucial for effectively managing and deploying your applications.