kubernetes-retired / service-catalog

Consume services in Kubernetes using the Open Service Broker API
https://svc-cat.io
Apache License 2.0
1.05k stars 384 forks source link

RBAC error in latest published catalog Helm chart #2274

Closed migmartri closed 6 years ago

migmartri commented 6 years ago

Bug Report

What happened:

The latest version of the catalog chart released here does not seem to work correctly in neither GKE nor Minikube.

This issue seems to be fixed in the chart existing in the Git repository, so releasing that chart upstream should fix the issue.

See error below:

k logs catalog-catalog-controller-manager-d6bf74d9f-ggpcb -n catalog 

...
I0809 17:00:07.205504       1 round_trippers.go:405] GET https://10.15.240.1:443/apis/servicecatalog.k8s.io/v1beta1/servicebrokers?limit=500&resourceVersion=0 403 Forbidden in 15 milliseconds
I0809 17:00:07.205548       1 round_trippers.go:411] Response Headers:
I0809 17:00:07.205555       1 round_trippers.go:414]     Content-Type: application/json
I0809 17:00:07.205560       1 round_trippers.go:414]     X-Content-Type-Options: nosniff
I0809 17:00:07.205565       1 round_trippers.go:414]     Content-Length: 459
I0809 17:00:07.205569       1 round_trippers.go:414]     Date: Thu, 09 Aug 2018 17:00:07 GMT
I0809 17:00:07.205574       1 round_trippers.go:414]     Audit-Id: b06b9e09-b289-43a6-b171-1451c6f5e0e3
I0809 17:00:07.205594       1 request.go:897] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"servicebrokers.servicecatalog.k8s.io is forbidden: User \"system:serviceaccount:catalog:service-catalog-controller-manager\" cannot list servicebrokers.servicecatalog.k8s.io at the cluster scope: Unknown user \"system:serviceaccount:catalog:service-catalog-controller-manager\"","reason":"Forbidden","details":{"group":"servicecatalog.k8s.io","kind":"servicebrokers"},"code":403}
E0809 17:00:07.205655       1 reflector.go:205] github.com/kubernetes-incubator/service-catalog/pkg/client/informers_generated/externalversions/factory.go:118: Failed to list *v1beta1.ServiceBroker: servicebrokers.servicecatalog.k8s.io is forbidden: User "system:serviceaccount:catalog:service-catalog-controller-manager" cannot list servicebrokers.servicecatalog.k8s.io at the cluster scope: Unknown user "system:serviceaccount:catalog:service-catalog-con

What you expected to happen:

By deploying the chart in the git repo https://github.com/kubernetes-incubator/service-catalog/tree/master/charts/catalog the call returns 200.

k logs catalog-catalog-controller-manager-d6bf74d9f-ggpcb -n catalog | grep "GET 
https://10.15.240.1:443/apis/servicecatalog.k8s.io/v1beta1/servicebrokers" -A 2
I0809 17:08:09.775997       1 round_trippers.go:405] GET https://10.15.240.1:443/apis/servicecatalog.k8s.io/v1beta1/servicebrokers?limit=500&resourceVersion=0 200 OK in 174 milliseconds

How to reproduce it (as minimally and precisely as possible):

# Install upstream chart
$ helm install svc-cat/catalog --name catalog --namespace catalog \
   --set apiserver.storage.etcd.persistence.enabled=true

$ helm list
NAME    REVISION    UPDATED                     STATUS      CHART                           NAMESPACE
catalog 1           Thu Aug  9 09:58:01 2018    DEPLOYED    catalog-0.1.28                  catalog  

$ k logs catalog-catalog-controller-manager-d6bf74d9f-ggpcb -n catalog 
# You can see 403 errors.
...
I0809 17:00:07.205504       1 round_trippers.go:405] GET https://10.15.240.1:443/apis/servicecatalog.k8s.io/v1beta1/servicebrokers?limit=500&resourceVersion=0 403 Forbidden in 15 milliseconds...

# Upgrade the release to use the chart in the repository fixes it
$ git clone git@github.com:kubernetes-incubator/service-catalog.git

$ helm upgrade catalog service-catalog/charts/catalog/

# Upgraded to rev 2
$ helm list
NAME    REVISION    UPDATED                     STATUS      CHART                           NAMESPACE
catalog 2           Thu Aug  9 10:07:12 2018    DEPLOYED    catalog-0.1.28                  catalog  

# And now it returns 200
$ k logs catalog-catalog-controller-manager-d6bf74d9f-ggpcb -n catalog | grep "GET 
https://10.15.240.1:443/apis/servicecatalog.k8s.io/v1beta1/servicebrokers" -A 2
I0809 17:08:09.775997       1 round_trippers.go:405] GET https://10.15.240.1:443/apis/servicecatalog.k8s.io/v1beta1/servicebrokers?limit=500&resourceVersion=0 200 OK in 174 milliseconds

Anything else we need to know?:

Environment:

jboyd01 commented 6 years ago

thanks for the report @migmartri, we just got this reported & fixed earlier this week by https://github.com/kubernetes-incubator/service-catalog/pull/2263 and it will be in the next release of catalog we do today.