-
Notifications
You must be signed in to change notification settings - Fork 382
Configure broker relist behavior on a per-broker basis #705
Comments
Addition items from #812:
|
I have folks at Red Hat that have volunteered to take this on. We spent some time today talking through a design that satisfies the known requirements for this feature, namely:
Here's our proposal: API changes: type BrokerRelistBehavior string
const (
BrokerRelistBehaviorDuration BrokerRelistBehavior = "Duration"
BrokerRelistBehaviorManual BrokerRelistBehavior = "Manual"
)
type BrokerSpec struct {
// other fields omitted
RelistBehavior BrokerRelistBehavior
RelistDuration *metav1.Duration
} Defaults:
Validations:
Other changes:
Additionally, there should be:
I have outlined the basic API changes to provide a good example; @jmrodri will write up his proposal for the subresource and porcelain commands Note: This proposal represents an amount of work larger than is appropriate for a single PR. A good factoring of this work into PRs would be:
Also, all names are merely suggestions; better suggestions are welcome. |
couple of questions:
|
The new
I would strongly prefer not to have magic values for the duration field. Without a magic value to indicate the manual-only behavior, in order to have a default for the duration, we need the behavior enum to disambiguate between 'use the default duration' and 'manual relist only'. |
Actually, even with the magic value, it's impossible to distinguish between 'set the default' and 'manual' |
Are we not allow to do... no "duration" property == "use default". value of "0" means "manual"? |
CLI proposal: Add a With PR #840 we could create a new // Some pseudo code and boilerplate stuff
package main
...
const usage = `Usage:
kubectl plugin relist-broker BROKER_NAME`
func main() {
svcURL := utils.SCUrlEnv()
if svcURL == "" {
svcURL = "192.168.99.100:30080"
}
if len(os.Args) < 1 {
utils.Exit1(usage)
}
...
restConfig := rest.Config{
Host: svcURL,
APIPath: "/apis/servicecatalog.k8s.io/v1alpha1",
}
svcClient, err := clientset.NewForConfig(&restConfig)
if err != nil {
utils.Exit1(...)
}
// Relist the broker
resp, err := svcClient.Brokers().Relist()
if err != nil {
utils.Exit1(...)
}
utils.Ok()
} We will also need to update the
$(BINDIR)/relist-broker/relist-broker: \
plugin/cmd/kubectl/relist-broker/relist-broker.go \
plugin/cmd/kubectl/relist-broker/plugin.yaml
rm -rf $(BINDIR)/relist-broker
$(DOCKER_CMD) go build -o $@ $<
$(DOCKER_CMD) cp plugin/cmd/kubectl/relist-broker/*yaml \
$(BINDIR)/relist-broker/
plugins: $(BINDIR)/bind-service/bind-service \
$(BINDIR)/create-service-broker/create-service-broker \
$(BINDIR)/create-service-instance/create-service-instance \
$(BINDIR)/relist-broker/relist-broker The name: "relist-broker"
shortDesc: "This command relists the service instances"
command: "./relist-broker" |
Subresource proposal: Add a First, in // other entries omitted
brokerStorage, brokerStatusStorage := broker.NewStorage(*brokerOpts)
brokerRelistStorage := broker.NewStorage(*brokerOpts) Then add it to the return map. return map[string]rest.Storage{
// other entries omitted
"brokers/status": brokerStatusStorage,
"brokers/relist": brokerRelistStorage, // NEW ENTRY
... Since we updated the The last bit should be to update the broker strategy located in I believe that's all that needs to get done. But there might be some unknowns in |
That might sound a bit hacky, but isn't just removing the status from |
Users normally don't have the ability to clear status themselves. I have a solution which doesn't rely on destroying status or creating a subresource which I described in the meeting last thursday, but haven't had a chance to write up yet. TLDR: add a field to No subresource is required to do this, and it fits entirely within kube precedent. |
Is there precedence in kube for defining a URL/route/sub-resource??? that represents a function? I'm asking because:
is a lot easier than:
|
Broker has a field that defaults and a manual relist endpoint. |
Created from #627; we should be able to configure the controller's relist behavior on a per-broker basis. I have requirements for:
The user should always be able to trigger a manual relist, see #704
The text was updated successfully, but these errors were encountered: