Unable to create a 'ClusterServiceBroker' resource via a yaml file.

Solution Verified - Updated -

Issue

  • When trying to create a ClusterServiceCluster resource, the process is failing with error;
user@ocp-system: ~ > cat csb.yaml
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ClusterServiceBroker
metadata:
  name: ocp-csb
spec:
  insecureSkipTLSVerify: true
  url: https://servicedemo.apps.example.com/
  authInfo:
    basic:
      secretRef:
        name: service-broker-secret
        namespace: kube-service-catalog
user@ocp-system: ~ >


user@ocp-system: ~ > oc create -f csb.yaml -n "kube-service-catalog" --loglevel=8
I0507 19:22:23.028395   15841 loader.go:359] Config loaded from file /home/cloud/.kube/config
I0507 19:22:23.028839   15841 decoder.go:224] decoding stream as YAML
I0507 19:22:23.034027   15841 loader.go:359] Config loaded from file /home/cloud/.kube/config
I0507 19:22:23.038324   15841 round_trippers.go:383] GET https://master-public-url/apis/servicecatalog.k8s.io/v1beta1?timeout=32s
I0507 19:22:23.038342   15841 round_trippers.go:390] Request Headers:
I0507 19:22:23.038349   15841 round_trippers.go:393]     Authorization: Bearer btz1czkZnk-TUH6bLnJWpaM46q8LCmaSJVOasWYJFT0
I0507 19:22:23.038355   15841 round_trippers.go:393]     Accept: application/json, */*
I0507 19:22:23.038361   15841 round_trippers.go:393]     User-Agent: oc/v1.11.0+d4cacc0 (linux/amd64) kubernetes/d4cacc0
I0507 19:22:23.185146   15841 round_trippers.go:408] Response Status: 401 Unauthorized in 146 milliseconds
I0507 19:22:23.185171   15841 round_trippers.go:411] Response Headers:
I0507 19:22:23.185178   15841 round_trippers.go:414]     Cache-Control: no-store
I0507 19:22:23.185184   15841 round_trippers.go:414]     Content-Type: application/json
I0507 19:22:23.185189   15841 round_trippers.go:414]     Date: Tue, 14 May 2019 07:16:16 GMT
I0507 19:22:23.185194   15841 round_trippers.go:414]     Content-Length: 129
I0507 19:22:23.185225   15841 request.go:897] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
[...]
I0507 19:22:23.654726   15841 cached_discovery.go:77] skipped caching discovery info due to Unauthorized
F0507 19:22:23.655928   15841 helpers.go:119] error: unable to recognize "csb.yaml": no matches for kind "ClusterServiceBroker" in version "servicecatalog.k8s.io/v1beta1"
user@ocp-system: ~ >

Environment

  • Red Hat OpenShift Container Platform
  • Service Catalog

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content