argo-helm icon indicating copy to clipboard operation
argo-helm copied to clipboard

add-crds-in-to-argocd-templates-with-condition-enabled-true-false

Open MohamedKhelifi opened this issue 2 years ago • 3 comments

Is your feature request related to a problem?

Hello,

When I'm trying to deploy Argocd with terraform, I can't add the option --install-crd on terraform code (helm_release resource) So it will be good if we can enable CRD installation on values.yaml like on argo-events.

Thanks

Related helm chart

argo-cd

Describe the solution you'd like

Like argo-events move crds directory on argocd/templates/

Add this condition on CRD files:

{{- if .Values.crds.install }}

#code

{{- end }}

On values.yaml:

## Custom resource configuration
crds:
  # -- Install and upgrade CRDs
  install: true

Describe alternatives you've considered

No response

Additional context

No response

MohamedKhelifi avatar Jun 21 '22 15:06 MohamedKhelifi

what if helm uninstall is done mistakenly or due to some unavoidable condition? helm will remove all crds which would also remove all "Application"s in the cluster. and if I reinstall the chart immediately, I cannot get back all Applications without recreating all the Applications which would also mean deleting pods and recreating.

I think crds should be either in top level crds/ folder or should be a separate chart as recommended by helm itself -> https://helm.sh/docs/chart_best_practices/custom_resource_definitions/

kernel164 avatar Jun 27 '22 06:06 kernel164

There is similar solution in argo-events or argo-rollouts that allows to keep CRDs after uninstall. The real problem are configuration options additionalProjects or additionalApplications that would fail the installation if used in this way.

pdrastil avatar Jun 27 '22 21:06 pdrastil

FYI, I am planning to follow the steps below. 🙋 https://github.com/argoproj/argo-helm/pull/1342#pullrequestreview-1019481838

yu-croco avatar Jun 29 '22 12:06 yu-croco

Actually, you can choose to install CRD's or not-install CRD's using terraform. https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#skip_crds

lnattrass avatar Aug 31 '22 20:08 lnattrass