shell-operator icon indicating copy to clipboard operation
shell-operator copied to clipboard

Lazy subscribing to CRDs

Open diafour opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

There is allowFailure for hooks, but Kubernetes bindings can't ignore error on subscribing to non existent kinds. The idea is to periodically retry subscribing and run hook when kind appears (CRD created).

It can be a solution for setups with CRD creating in main queue and hooks in parallel queues. Subscribing in parallel queues can occur before creating CRD and it leads to global error.

Describe the solution you'd like to see

Describe alternatives you've considered

Additional context

diafour avatar Jul 07 '22 07:07 diafour

This problem leaked to the deckhouse, and now we are using the thing called dynamic subscription to play around with this.

For example, a hook written in Go in Deckhouse changes the subscription. When CRD appears in the cluster:

https://github.com/deckhouse/deckhouse/blob/7a47d938e8b48164d9fbc65d09ad5e8e62206283/modules/040-node-manager/hooks/get_crds.go#L108-L115

https://github.com/deckhouse/deckhouse/blob/7a47d938e8b48164d9fbc65d09ad5e8e62206283/modules/040-node-manager/hooks/get_crds.go#L169-L197

We can avoid the magic with lazy subscriptions and subscribe to all possible instance classes.

nabokihms avatar Mar 18 '23 14:03 nabokihms