servicebinding / spec

Specification for binding services to k8s workloads
https://servicebinding.io
Apache License 2.0
92 stars 35 forks source link

Define ServiceAvailable condition #218

Closed scothis closed 2 years ago

scothis commented 2 years ago

Add a ServiceAvailable condition to the ServiceBinding status. Logically, the behavior covered by the ServiceAvailable condition is a subset of the existing Ready condition. The behavior of the Ready condition is unchanged.

The status is True when the referenced Provisioned Service is resolved and exposes a binding secret. The status is False if the Provisioned Service cannot be resolved, either because it does not exist, or is not visible to the implementation. The status is Unknown when the referenced Provisioned Service is resolved, but does not expose a binding secret.

When managing the rollout of resources that include a service, binding and workload it can be difficult today to observe each resource to know when there is a problem that requires remediation.

The above cases make it difficult for tools to observe the health of either resource during the rollout, while the resource will eventually settle on a healthy status, a circuit breaker could flip in the interim that reverts the rollout. With a new ServiceAvailable condition we can stagger the rollout of the resource to upsert the service and binding, wait for ServiceAvailable to become True and then upsert the workload.

Additionally, if the workload is immutable (like a Job), the creation of the workload must be held until the service is known to exist. The ServiceAvailable condition becoming True can signal that it's ok to create the workload. If the workload is created before the service is available, the ServiceBinding won't be able to complete the binding.

Signed-off-by: Scott Andrews andrewssc@vmware.com

scothis commented 2 years ago

More details of the problem and reproducible test cases are available in https://github.com/vmware-tanzu/carvel-kapp/issues/427