dragonflydb / dragonfly-operator

A Kubernetes operator to install and manage Dragonfly instances.
https://www.dragonflydb.io/docs/managing-dragonfly/operator/installation
Apache License 2.0
146 stars 34 forks source link

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

Open omar-mohamed-khallaf opened 3 months ago

omar-mohamed-khallaf commented 3 months ago

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.

Smana commented 1 month ago

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

omar-mohamed-khallaf commented 1 month ago

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
Smana commented 1 month ago

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

omar-mohamed-khallaf commented 1 month ago

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.