Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate CRDs between serving-crds.yaml and serving-core.yaml #9945

Closed
johanbrandhorst opened this issue Oct 26, 2020 · 6 comments
Closed
Labels
area/API API objects and controllers kind/bug Categorizes issue or PR as related to a bug.

Comments

@johanbrandhorst
Copy link

/area API

What version of Knative?

0.18.1

Expected Behavior

I expected to be able to use the manifests as a kustomize base.

Actual Behavior

The CRD configurations.serving.knative.dev appears in both serving-crds.yaml and serving-core.yaml. Kustomize does not allow you to apply both at once since their definitions clash:

$ kubectl  apply -k .
error: AccumulateTarget: rawResources failed to read Resources: id '"apiextensions.k8s.io_v1_CustomResourceDefinition|~X|~P|configurations.serving.knative.dev|~S"' already used

Steps to Reproduce the Problem

Download serving-core.yaml and serving-crds.yaml to the same directory, add a kustomization using both of them as resources, and attempt to kubectl apply -k ..

Related issues

knative-extensions/net-contour#333

Discussion

It seems to me that serving-core.yaml should not need the CRDs, when there is a CRD-specific file.

@johanbrandhorst johanbrandhorst added the kind/bug Categorizes issue or PR as related to a bug. label Oct 26, 2020
@knative-prow-robot knative-prow-robot added the area/API API objects and controllers label Oct 26, 2020
@dprotaso
Copy link
Member

What kubectl version are you running?

Kustomize does not allow you to apply both at once since their definitions clash:

Are you following installation directions from anywhere they suggest to use -k? The yamls provided as part of a release aren't intended to be installed together all at once but to be used more selectively for your needs.

ie. serving-post-install-jobs.yaml actually contains serving-storage-version-migration.yaml serving-default-domain.yaml`. All these jobs are intended to be run after upgrading/installing

@johanbrandhorst
Copy link
Author

I'm running v1.19.2. I was following the instructions at https://knative.dev/docs/install/any-kubernetes-cluster/#installing-the-serving-component and hoping I could build a kustomize base out of the two files it says to install. I removed the duplicate CRDs from serving-core.yaml and it applies fine, is there a good reason we can't do that universally?

@dprotaso
Copy link
Member

The intent of producing a separate crd.yaml & suggesting to install things in two steps is because users saw issues where the API server would report a CRD/resource type was not found after it was just applied. We saw this with our ImageCache resource.

If you're using kustomize, which I believe is smart about applying CRDs first, then you should only need the -core yaml file.

@dprotaso
Copy link
Member

We also apply labels to our CRDs knative.dev/crd-install=true so I believe you could do some filtering on that

@mattmoor
Copy link
Member

Looks like this is resolved, please let us know if there are any further issues.

@johanbrandhorst
Copy link
Author

johanbrandhorst commented Oct 29, 2020

It appears serving-core.yaml is missing caching.internal.knative.dev/v1alpha1.Image. I'd be happy to repurpose this issue to track the inclusion of this CRD into serving-core.yaml, so that kustomize environments can use just that manifest.

EDIT: False alarm, I was using an incorrect copy locally. This is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API API objects and controllers kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants