Helm 2.10 introduced a new hook as described here https://docs.helm.sh/developing_charts/#defining-a-crd-with-the-crd-install-hook , and this can make sure all CRDs can be installed first before install other resources and make chart CRD management more easy.
Most people are now trying to use helm to install applications, it is better to enable all of the CRDs generated by Kubebuilder include the annotation for crd-install. This can make sure if the CRDs are included in helm chart, then those CRDs can be created first before other resources.
annotations:
"helm.sh/hook": crd-install
/cc @pmorie
Related with Federation V2 helm chart https://github.com/kubernetes-sigs/federation-v2/pull/245
Thanks for your feedback. After editing type scheme, user has to run make for generating manifest. CRD yaml files can be found in config/crds. User can modify the yaml files as wish, including above annotations for helm.
I think it could not be necessary to force add helm annotations for all crds since there are still some use-cases do not apply it.
@fanzhangio I would suggest we add this annotation, because:
1) It has no side effect to the CRD resources.
2) It can help facilitate the translation of YAML template to helm chart as helm chart is becoming the installation standard for Kubernetes resources.
3) It is not convenient for user to update the kubebuilder generated YAML template, as the user need to update the YAML template each time when the YAML template was generated.
Comments? Thanks.
Looks good to me. It should be good to consider supporting helm chart in kubebuilder. I think kubebuilder could have a flag in controller-gen for generating this stuff.
What do you think? @droot
@gyliu513 I was thinking more about it and realized that its a good usecase for using kustomize for adding that annotation to the generated CRD.
Newer version of Kubebuilder generated default kustomization which a project owner can tweak to this use case. Let me know if you have any questions.
@droot so how to add this annotation to the CRD? Any example command you can share with me with kubebuilder? How kubebuilder use kustomize to customize those CRD? Thanks.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen.
Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/remove-lifecycle rotten
/reopen
@muvaf: You can't reopen an issue/PR unless you authored it or you are a collaborator.
In response to this:
/reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Most helpful comment
Looks good to me. It should be good to consider supporting helm chart in kubebuilder. I think kubebuilder could have a flag in
controller-genfor generating this stuff.What do you think? @droot