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

Please support apiextensions.k8s.io/v1 api version for CRDs #5473

Closed
andrewsav-bt opened this issue Sep 24, 2019 · 12 comments · Fixed by #7815
Closed

Please support apiextensions.k8s.io/v1 api version for CRDs #5473

andrewsav-bt opened this issue Sep 24, 2019 · 12 comments · Fixed by #7815
Assignees
Milestone

Comments

@andrewsav-bt
Copy link

andrewsav-bt commented Sep 24, 2019

Do you want to request a feature or report a bug?

Feature

What did you expect to see?

Kubernetes 1.16 is now out and with it CRDs graduated to GA. The new api version which is now apiextensions.k8s.io/v1 as opposed to the older one apiextensions.k8s.io/v1beta1 is designed to support multiple versions of CRDs and added migration support between CRD versions. To this end it requires CRD openAPIV3Schema schema to be defined in the CRD, which was not a requirement for v1beta1.

All the examples of CRD given in traefik documentation are written for v1beta1 and as such do not include the schema.

This makes it impossible to use them with apiextensions.k8s.io/v1. Since apiextensions.k8s.io/v1beta1 is going to be removed in 1.19 it is extremely desirable, that apiextensions.k8s.io/v1 is supported.

This is a request to make that happen.

@msnelling
Copy link

This issue prevents the use of IngressRoute CRDs on Kubernetes 1.16 as there are no examples for the CRD definitions with the openAPIV3Schema attribute.

@AndrewSav
Copy link
Contributor

@msnelling That's not true. I'm using them on 1.16 and they work. Examples (without openAPIV3Schema) are in the docs and they still work in 1.16

@msnelling
Copy link

msnelling commented Oct 11, 2019

@AndrewSav Really? I have just tried this on a fresh MicroK8s snap install on Ubuntu 18.04 with the following CRD.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: ingressroutes.traefik.containo.us

spec:
  group: traefik.containo.us
  versions:
    - name: v1alpha1
      served: true
      storage: true
  names:
    kind: IngressRoute
    plural: ingressroutes
    singular: ingressroute
  scope: Namespaced

I get the following error...

The CustomResourceDefinition "ingressroutes.traefik.containo.us" is invalid: spec.versions[0].schema.openAPIV3Schema: Required value: schemas are required

Version

Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

@AndrewSav
Copy link
Contributor

AndrewSav commented Oct 11, 2019

@msnelling, well this what this github issue is about, they don't work in apiextensions.k8s.io/v1, just don't move them in that version and use the example from the doco verbatim,as I mentioned above. In this case they do work and will continue to work until kubernetes 1.19

@ldez ldez self-assigned this Dec 19, 2019
@alexchiri
Copy link

Beyond the compatibility with the new version, it would be quite nice to have the openAPISchemas on the CRDs, so you can quickly kubectl explain them to figure out their fields.

@AndrewSav
Copy link
Contributor

AndrewSav commented Jul 1, 2020

Kubernetes 1.19 is slated to be out on 25th of August. This is the version that was going to remove apiextensions.k8s.io/v1beta1

@SantoDE SantoDE self-assigned this Jul 1, 2020
@AndrewSav

This comment has been minimized.

@mfriess2
Copy link

Beyond the compatibility with the new version, it would be quite nice to have the openAPISchemas on the CRDs, so you can quickly kubectl explain them to figure out their fields.

... and to (hopefully) get support for the CRDs in the IntelliJ Kubernetes plugin!

@dwang13

This comment has been minimized.

@rtribotte rtribotte added the priority/P1 need to be fixed in next release label Sep 29, 2020
@SantoDE SantoDE assigned jbdoumenjou and rtribotte and unassigned SantoDE Sep 29, 2020
@rtribotte rtribotte removed the priority/P2 need to be fixed in the future label Sep 29, 2020
@AndrewSav
Copy link
Contributor

removal has been retargeted at 1.22

@james-d-elliott
Copy link

james-d-elliott commented Jan 20, 2021

This is my work in progress (manual) on this: https://gist.github.com/james-d-elliott/c3323ab66df3f09150b7538a8a8a8aca

Is anyone working on this? Or are there plans to automate it? If not I may do a PR with just the changes, including documenting some of the structs in pkg/provider/kubernetes/crd according to other struct tags found throughout the repo.

Additionally I'm running this in my cluster currently, however I only really use the Middleware and IngressRoute types.

@jbdoumenjou
Copy link
Member

Hello @james-d-elliott,

We have started to work on it.
Indeed, we will use code generation for the open schema API to facilitate the maintenance and upgrades.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.