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

Can't apply turtorial crd.yaml example,The CustomResourceDefinition "ephemeralvolumeclaims.zalando.org" is invalid #382

Closed
kopf-archiver bot opened this issue Aug 18, 2020 · 1 comment
Labels
archive bug Something isn't working

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

An issue by tarjintor at 2020-07-09 04:12:34+00:00
Original URL: zalando-incubator/kopf#382
 

I am trying to run the turtorial https://kopf.readthedocs.io/en/latest/walkthrough/resources/
And when I
kubectl apply -f crd.yaml
then it goes wrong as

The CustomResourceDefinition "ephemeralvolumeclaims.zalando.org" is invalid: spec.versions: Invalid value: []apiextensions.CustomResourceDefinitionVersion{apiextensions.CustomResourceDefinitionVersion{Name:"v1", Served:true, Storage:true, Schema:(*apiextensions.CustomResourceValidation)(0xc01c503bc0), Subresources:(*apiextensions.CustomResourceSubresources)(nil), AdditionalPrinterColumns:[]apiextensions.CustomResourceColumnDefinition(nil)}}: per-version schemas may not all be set to identical values (top-level validation should be used instead)

my k8s version are:

ubuntu@k8s-master:~/k8s_operator$ kubectl version 
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:18:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.4", GitCommit:"67d2fcf276fcd9cf743ad4be9a9ef5828adc082f", GitTreeState:"clean", BuildDate:"2019-09-18T14:41:55Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}


Commented by tarjintor at 2020-07-09 07:00:46+00:00
 

I read the docs of k8s v1.15 and search some git issues,I change crd.yaml to

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: ephemeralvolumeclaims.zalando.org
spec:
  scope: Namespaced
  group: zalando.org
  names:
    kind: EphemeralVolumeClaim
    plural: ephemeralvolumeclaims
    singular: ephemeralvolumeclaim
    shortNames:
      - evcs
      - evc
  versions:
    - name: v1
      served: true
      storage: true
  validation:
    openAPIV3Schema:
      type: object
      properties:
        spec:
          type: object
          x-kubernetes-preserve-unknown-fields: true
        status:
          type: object
          x-kubernetes-preserve-unknown-fields: true

It is OK then.

@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] Can't apply turtorial crd.yaml example,The CustomResourceDefinition "ephemeralvolumeclaims.zalando.org" is invalid Aug 19, 2020
@kopf-archiver kopf-archiver bot added the bug Something isn't working label Aug 19, 2020
@kopf-archiver kopf-archiver bot reopened this Aug 19, 2020
@nolar
Copy link
Owner

nolar commented Sep 9, 2020

@tarjintor Sorry for the slow response.

For Kubernetes 1.15 and below, CRD v1beta1 should be used: https://github.com/nolar/kopf/blob/master/examples/crd-v1beta1.yaml

@nolar nolar closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant