dragonfly-operator icon indicating copy to clipboard operation
dragonfly-operator copied to clipboard

fix(manifests): Separate the crds from the operator manifests

Open omar-khallaf opened this issue 2 years ago • 4 comments

Trying to install the operator with flux kustomization pointing to the manifest directory results in error relating to crds being duplicated.

This commit separates the different manifests in different directories so they don't get combined.

omar-khallaf avatar Aug 26 '24 06:08 omar-khallaf

That is indeed a good idea. I'm using Flux and I want to install the CRDs in a distinct step.

Smana avatar Oct 06 '24 15:10 Smana

I think this might help you, or at least that's how I did it:

---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: dragonfly-operator
  namespace: storage-system
spec:
  interval: 168h
  url: https://github.com/dragonflydb/dragonfly-operator.git
  ref:
    branch: main
  ignore: |
    # exclude all
    /*
    # include charts directory
    !/charts/
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: dragonfly-operator
  namespace: storage-system
spec:
  interval: 1h
  chart:
    spec:
      chart: charts/dragonfly-operator
      sourceRef:
        kind: GitRepository
        name: dragonfly-operator
        namespace: storage-system

omar-khallaf avatar Oct 06 '24 15:10 omar-khallaf

thank you @omar-mohamed-khallaf , however you don't really separate the crds from the helm chart here? Actually I want to use dragonfly as the k/v solution for my repo here, and I always deploy the crds first. Maybe I can use the ignore statement anyway... I'm gonna give it a try

Smana avatar Oct 06 '24 16:10 Smana

Yes, the crds are installed with the chart.

If it's necessary you may use Post Renderers to omit other resources at the step of installing crds.

Then use the chart again to install previously omitted resources at the appropriate step.

omar-khallaf avatar Oct 06 '24 16:10 omar-khallaf