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

After removing a ServiceClass from a broker, the service-catalog doesn't reflect this #1096

Closed david-martin closed 7 years ago

david-martin commented 7 years ago

For reproducing this, I'm using an example with the template-service-broker in OpenShift.

I can add a new template to the openshift namespace for the template-server-broker to pick up

oc create -f https://raw.githubusercontent.com/feedhenry/fh-sync-server/master/fh-sync-server-DEVELOPMENT.yaml -n openshift

Calling directly to the broker responds with our SerivceClass included

oc exec controller-manager-119773966-w9zwd -- curl -k -H 'X-Broker-Api-Version:2.7' https://kubernetes.default.svc:443/brokers/template.openshift.io/v2/catalog | grep fh-sync-server
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 70361    0 70361    0     0   909k      0 --:--:-- --:--:-- --:--:--  916k
    "name": "fh-sync-server",
     "documentationUrl": "https://github.com/feedhenry/fh-sync-server",
     "supportUrl": "https://github.com/feedhenry/fh-sync-server/issues"

After some time (<5m), the serviceclass appears in openshift too

oc get serviceclass | grep fh-sync-server
fh-sync-server             ServiceClass.v1alpha1.servicecatalog.k8s.io

This is expected.

If I remove the template, the template-service-broker picks up on this. Calling directly to the broker no longer includes a ServiceClass.

oc delete template fh-sync-server -n openshift
oc exec controller-manager-119773966-w9zwd -- curl -k -H 'X-Broker-Api-Version:2.7' https://kubernetes.default.svc:443/brokers/template.openshift.io/v2/catalog | grep fh-sync-server
(no result)

This is also expected.

However, the ServiceClass is not removed from the service-catalog. This command will always list the ServiceClass.

oc get serviceclass | grep fh-sync-server
fh-sync-server             ServiceClass.v1alpha1.servicecatalog.k8s.io

Is this expected behavior? I can work around this by manually deleting the ServiceClass, and then the catalog no longer includes it. e.g. oc delete serviceclass fh-sync-server But this seems like an unnecessary step. Should the service catalog keep up to date with new and removed ServiceClasses that each broker has?

pmorie commented 7 years ago

@david-martin This is related to the broker refresh interval, which we are working on now: #1086

Currently there is a single refresh interval for all brokers, which is a property of the controller-manager binary. You would eventually see the desired change, but not immediately upon updating the broker's services. The API described in #1086 will allow configuration of this interval on a per-broker period, and allow the user to trigger relisting the broker manually.

Does that make sense?

david-martin commented 7 years ago

@pmorie That makes sense. Given the thought and discussion going into #1086, I'm happy to close this