redhat-cop / keepalived-operator

An operator to manage VIPs backed by keepalived
Apache License 2.0
117 stars 36 forks source link

Separate CRDs from helm template so in order to skip CRD deployment #100

Closed cedricmckinnie closed 1 year ago

cedricmckinnie commented 1 year ago

I'm unable to separate CRDs from other resources deployed via helm

cedricmckinnie commented 1 year ago

@raffaelespazzoli Hey I'm not 100% sure this will fix the problem. I'm running into some issues with running the Makefile as I run on Apple Silicon (M1). Does this deploy a test helm package that I can pull to verify if this separated the CRDs correctly?

raffaelespazzoli commented 1 year ago

There should be a parameter in help to not install the CRD if that is what you want to achieve. @sabre1041

cedricmckinnie commented 1 year ago

@raffaelespazzoli it's currently including apiextensions.k8s.io_v1_customresourcedefinition_keepalivedgroups.redhatcop.redhat.io.yaml file in charts/keepalived-operator/templates directory and there is no helm value available to disable deploying them. Ideally, CRDs should be in charts/keepalived-operator/crds dir and not in charts/keepalived-operator/templates dir. That way we can use the builtin --skip-crds flag under helm install i.e.

helm install -h | grep skip-crds
      --skip-crds                                  if set, no CRDs will be installed. By default, CRDs are installed if not already present
cedricmckinnie commented 1 year ago

@raffaelespazzoli I just tried to deploy this to a cluster that has the CRDs deployed separately and it failed since helm cannot manage resources that it did not deploy.

Btw, thank you so much for all of the quick response up to this point. You've been massively helpful!

raffaelespazzoli commented 1 year ago

@davgordo any idea why this might have been commented out? What do we do for the other operators? overall this seems a good idea.

raffaelespazzoli commented 1 year ago

I figured out what happened, we should have this.