Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crd logic #144

Open
kfox1111 opened this issue Aug 4, 2022 · 6 comments
Open

crd logic #144

kfox1111 opened this issue Aug 4, 2022 · 6 comments

Comments

@kfox1111
Copy link

kfox1111 commented Aug 4, 2022

https://github.com/IBM/trusted-service-identity/blob/main/charts/spire/templates/spiffeid.spiffe.io_spiffeids.tpl

Won't the check pass the first time, having the crd be managed by the chart, then on upgrade, it sees it already exists, and then turn it back off causing it to get deleted?

@mrsabath
Copy link
Member

mrsabath commented Aug 5, 2022

The ongoing problem with CRDs is they cannot be easily deleted if they are referenced by at least one object. So removal might be difficult since Workload Registrar is managing the SPIFFEID instances. Sometimes CRD is deleted after successful creation, setup and execution of Workload Registrar that cleared the instances. This trick with checking for an existing instance of SPIFFEID helps with installation.
If it gets deleted, it can be manually created:
kubectl -n spire create -f charts/spire/ext/spiffeid.spiffe.io_spiffeids.yaml

Perhaps there is a better way to solve this.

@kfox1111
Copy link
Author

kfox1111 commented Aug 5, 2022

I usually just recommend managing the crds outside of helm. there have been so many bugs/inconsistencies with the helm engine and crds its pretty risky to rely on it.

At very least, I'd recommend putting the "never delete" helm annotation on the crds to keep it a little safer.

@mrsabath
Copy link
Member

mrsabath commented Aug 5, 2022

These are good suggestions. Thank you. I will test it with the helm annotation.

@mrsabath
Copy link
Member

After reviewing the Helm current best practices for dealing with CRDs https://helm.sh/docs/chart_best_practices/custom_resource_definitions/
and related conversation helm/helm#7505 we have decided to move the CRDs into crds directory.

@kfox1111
Copy link
Author

I'd recommend leaving it in the chart where it is with the annotation to disallow deletion for a version. Otherwise, if anyone upgrades to the newer version, it could get unmanaged and deleted. Once it has been in for at least one released version (and users have upgraded to that specific version) it should be safe to move to the crd's directory I think.

@mrsabath
Copy link
Member

This issue has been addressed by PR #145 as per Helm documentation https://helm.sh/docs/howto/charts_tips_and_tricks/#tell-helm-not-to-uninstall-a-resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants