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

Invalid value: "v1beta1": must appear in spec.versions #1056

Closed
zhcf opened this issue Aug 6, 2019 · 5 comments
Closed

Invalid value: "v1beta1": must appear in spec.versions #1056

zhcf opened this issue Aug 6, 2019 · 5 comments
Labels

Comments

@zhcf
Copy link

zhcf commented Aug 6, 2019

Environment:
k8s 1.14.2
kuberctl 1.14.2
ks 0.13.1
kubeflow 0.4.1
minikube 1.2

Error
When I apply the CRD in the example, I get the below error:
kubectl apply -f ./examples/crd/crd-v1.yaml
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
The CustomResourceDefinition "tfjobs.kubeflow.org" is invalid:

  • spec.version: Invalid value: "v1beta1": must match the first version in spec.versions
  • status.storedVersions[0]: Invalid value: "v1beta1": must appear in spec.versions
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label kind/bug to this issue, with a confidence of 0.95. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@gaocegege
Copy link
Member

Hi you cannot use crd-v1.yaml for v1beta1, v1 and v1beta1 are two versions of API

@zhcf
Copy link
Author

zhcf commented Aug 7, 2019

This is a bug of the example crd, conflict between apiversion and the versions in spec.

apiVersion: apiextensions.k8s.io/v1beta1
spec:
 versions:
  - name: v1
    served: true
    storage: true
  - name: v1beta2
    served: true
    storage: false

The crd can work if I use the following yaml file, but for master brach, I can just build tf-operator.v1 and tf-operator.v1beta2, the crd is v1beta1, so the operator can not work.

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: tfjobs.kubeflow.org
spec:
  group: kubeflow.org
  scope: Namespaced
  names:
    kind: TFJob
    singular: tfjob
    plural: tfjobs
  version: v1beta1
  subresources:
    status: {}
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            tfReplicaSpecs:
              properties:
                # The validation works when the configuration contains
                # `Worker`, `PS` or `Chief`. Otherwise it will not be validated.
                Worker:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                PS:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                Chief:
                  properties:
                    replicas:
                      type: integer
                      minimum: 1
                      maximum: 1

I switch to the branch 0.5, it will work for both the crd and operator.

@johnugeorge
Copy link
Member

johnugeorge commented Aug 29, 2019

Can you use the latest tf operator installation in https://github.com/kubeflow/manifests/tree/master/tf-training/tf-job-operator ?

@gaocegege
Copy link
Member

/close

I am closing it since it is stale, but feel free to comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants