cdk8s-team / cdk8s

Define Kubernetes native apps and abstractions using object-oriented programming

Home Page:https://cdk8s.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install multiple CRDs via single remote URL

jackpordi opened this issue · comments

Description of the feature or enhancement:

Many Helm Charts are now publishing their CRDs as multiple, separate manifests, e.g. Traefik.
I'd like to be able to do the following command via cdk8s:

kubectl apply --server-side --force-conflicts -k https://github.com/traefik/traefik-helm-chart/traefik/crds/

I have tried to do

    new Include(this, 'dashboard', {
      url: 'https://github.com/traefik/traefik-helm-chart/traefik/crds/',
    });

But this does not work as I get a 404.

Use Case:

To install CRDs that are published as multiple files separately from Helm charts.

Proposed Solution:

Allow Include to work with remote directories as well.

Other:

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Just realized this is essentially asking for Kustomize support

@jackpordi I'm interested in this - why do you say its essentially Kustomize support? I see it more as a request for the Include construct to be able to handle github directory URLs? Specifically in the example you posted, the kustomization.yaml file doesn't really do anything except for list of the files in that directory.

@iliapolo Maybe "essentially asking for Kustomize support" is not the right choice of words here, but I don't think its straightforward. I'm not super familiar with Kustomize myself, but here are my thoughts:

CRD declarations don't necessarily follow a convention - maintainer could put it all in a single file (which would currently work with cdk8s), or they could just list all files in a remote directory with a kustomization.yaml file, or they could list all files in a remote directory without a kustomization file. There's probably a number of other ways which I'm not aware of as well.

If CDK8s does support CRDs though a remote kustomization.yaml file, it would then be odd to only support kustomize in this very specific scenario.

Specifically in the example you posted, the kustomization.yaml file doesn't really do anything except for list of the files in that directory.

In this case, true - but perhaps other kustomization files might include other things (like patches and bases). Again I don't know enough about Kustomize to be able to say what those cases would be for CRD declarations.

@jackpordi Yeah I see your point. In any case I don't think that the Include construct is the right place to do massive network calls and handle git clones and such. This feels like a pre-processing step before invoking cdk8s.

Just wanted to better understand your thoughts around kustomize. Thanks! 👍