Bug 1671528 - error: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"
Summary: error: no kind "CustomResourceDefinition" is registered for version "apiexten...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Templates
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.1.0
Assignee: Gabe Montero
QA Contact: XiuJuan Wang
URL:
Whiteboard:
: 1662865 (view as bug list)
Depends On:
Blocks: 1702693
TreeView+ depends on / blocked
 
Reported: 2019-01-31 20:04 UTC by Erik M Jacobs
Modified: 2019-06-04 10:43 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: 'oc new-app' originated before the rise of CRDs, does not support them, and the error message around not being able to create them is confusing Consequence: users were left unclear on how to create their CRDs Fix: better recognize the error when trying to create CRDs and clearly propose to the user which command should be used to create them Result: a clearer path exists for the user
Clone Of:
: 1702693 (view as bug list)
Environment:
Last Closed: 2019-06-04 10:42:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:43:52 UTC

Description Erik M Jacobs 2019-01-31 20:04:22 UTC
Description of problem:

When trying to process a template (eg: https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml ) I receive the error in the subject:

error: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

Version-Release number of selected component (if applicable):
oc v4.0.0-0.79.0
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://beta-10-190131-2-api.ocp4testing.openshiftdemos.com:6443
kubernetes v1.11.0+c69f926354


How reproducible:
100%

Steps to Reproduce:
1. oc new-app https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml

Actual results:
error: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

Expected results:
Successful creation of template resources

Additional info:
Older oc against the same cluster works:
oc v3.11.16
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://beta-10-190131-2-api.ocp4testing.openshiftdemos.com:6443
kubernetes v1.11.0+c69f926354

Comment 1 Maciej Szulik 2019-02-01 14:26:25 UTC
Fix in https://github.com/openshift/origin/pull/21936

Comment 2 Maciej Szulik 2019-03-01 14:01:36 UTC
Devexp team should re-write new-app, I've created https://jira.coreos.com/browse/DEVEXP-285 to track it.

Comment 3 Ben Parees 2019-03-01 15:52:42 UTC
*** Bug 1662865 has been marked as a duplicate of this bug. ***

Comment 5 Erik M Jacobs 2019-03-18 16:41:28 UTC
This is still not fixed with v4.0.22

Comment 6 Adam Kaplan 2019-03-18 20:35:55 UTC
@Erik did you update your oc client?

Comment 8 Erik M Jacobs 2019-03-18 21:18:11 UTC
oc new-app -n istio-operator -f https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml -p OPENSHIFT_ISTIO_MASTER_PUBLIC_URL=https://api.beta-190318-1.ocp4testing.openshiftdemos.com:6443

error: no kind \"CustomResourceDefinition\" is registered for version \"apiextensions.k8s.io/v1beta1\" in scheme \"k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28\

oc version
Client Version: version.Info{Major:"4", Minor:"0+", GitVersion:"v4.0.22", GitCommit:"d14915559e", GitTreeState:"", BuildDate:"2019-03-14T21:55:38Z", GoVersion:"", Compiler:"", Platform:""}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.4+0f8e04e", GitCommit:"0f8e04e", GitTreeState:"clean", BuildDate:"2019-03-04T15:33:19Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}

There is no newer build available on the mirror site.

Comment 10 Adam Kaplan 2019-03-25 16:46:57 UTC
`oc process` does support templates which create CRDs and custom resources. Work-around is to pipe `oc process` output to `oc create` [1].
oc new-app should capture this error and inform developers of this work-around.

[1] https://docs.openshift.com/container-platform/3.11/dev_guide/templates.html#generating-a-list-of-objects

Comment 12 Adam Kaplan 2019-04-04 15:37:48 UTC
Moving this to low-severity - this should not block 4.1 GA release.

Comment 14 Gabe Montero 2019-04-09 15:49:29 UTC
PR https://github.com/openshift/origin/pull/22518 is up against master branch

Assuming we'll cherry pick back to 3.11.x

Comment 15 Adam Kaplan 2019-04-10 14:14:32 UTC
@Gabe If we're going to backport to 3.11, I'd clone this BZ so errata can be generated through the normal process.

Comment 16 Gabe Montero 2019-04-17 13:40:30 UTC
Actually @Adam I'm instead going to employ

- have QA verify with a 4.x build that contains the merged commit from https://github.com/openshift/origin/pull/22518
- when they mark it verified, move the bug back to POST and cherrypick into 3.11
- when that PR merges, we'll move through the MODIFIED/doc for Errata/verify on 3.11 cycle.

Comment 17 XiuJuan Wang 2019-04-18 02:44:38 UTC
A little defect need be improved.
When  'oc new-app -f' with file, the promption is "oc process -f file | oc create -f -". But if without -f in 'oc new-app', the promption is 'oc process | oc create', it's not clear in next step for customer.

$oc new-app -f  ~/workdir/xiuwang/cmbuild/template-with-crd.yaml 
error: The template contained an object type unknown to `oc new-app`.  Use `oc process -f /home/wxj/workdir/xiuwang/cmbuild/template-with-crd.yaml | oc create -f -` instead.  Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

$oc new-app https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml 
error: The template contained an object type unknown to `oc new-app`.  Use `oc process | oc create` instead.  Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

$oc version 
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0", GitCommit:"85db872d8", GitTreeState:"", BuildDate:"2019-04-17T20:07:02Z", GoVersion:"", Compiler:"", Platform:""}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.4+53af542", GitCommit:"53af542", GitTreeState:"clean", BuildDate:"2019-04-16T06:50:32Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

Comment 18 Gabe Montero 2019-04-18 16:52:40 UTC
PR https://github.com/openshift/origin/pull/22604 is up to address @XiuJuan's suggestion plus something @Adam realized

Comment 19 Gabe Montero 2019-04-23 13:55:39 UTC
FYI @XiuJuan during PR review it has been decided to go with a generic format of:

oc process -f <template> | oc create -f -

we won't try to place the actual supplied parameters.

Comment 20 Gabe Montero 2019-04-24 00:10:07 UTC
OK PR https://github.com/openshift/origin/pull/22604 has merged.

See #Comment 19 on where we landed with the message.

If QE verifies in 4.x I'll move on to crafting the 3.11 change with this bug.

Comment 21 XiuJuan Wang 2019-04-24 06:47:56 UTC
The fix works with oc client getting from payload 4.1.0-0.ci-2019-04-24-043324

$ oc new-app -f template-with-crd.yaml 
error: The template contained an object type unknown to `oc new-app`.  Use `oc process -f <template> | oc create -f -` instead.  Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

$ oc new-app  https://raw.githubusercontent.com/Maistra/openshift-ansible/maistra-0.7/istio/istio_community_operator_template.yaml  
error: The template contained an object type unknown to `oc new-app`.  Use `oc process -f <template> | oc create -f -` instead.  Error details: no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1" in scheme "k8s.io/kubernetes/pkg/kubectl/scheme/scheme.go:28"

$ oc version --short
Client Version: v4.0.0-alpha.0+2cbb022-2151-dirty
Server Version: v1.13.4+c3edcc6

Comment 22 Gabe Montero 2019-04-24 13:31:32 UTC
great thanks @XiuJuan

and eschewing the re-purpose this bug for 3.11 with Adam's clone the bug

Comment 24 errata-xmlrpc 2019-06-04 10:42:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0758


Note You need to log in before you can comment on or make changes to this bug.