Repository navigation
Support for binding expiration/rotation and notification of workloads ? #228
Description
Activity
The Service Binding Spec doesn't have any direct mechanism for provisioning/rotating/revoking credentials. This is left to individual provisioned services to define. The goal for bindings is to connect provisioned services to workloads while being agnostic to the content of both.
We can explore creating a spec extension that provides recommendations for services to be able to communicate to workloads when credentials expire. Formalizing the keys you suggest should be a quick process.
With the reference implementation of the spec there are two ways to rotate credentials today:
- Update the content of the credentials within the referenced binding secret. The workload will need to notice the change on the filesystem and pickup the new creds. If the workload does not detect the new creds, once the existing creds are invalidated, it should crash and restart to pick up the new creds.
- Create a new secret and update the provisioned service's reference to point at the new secret. The ServiceBinding controller will update workloads to use the new secret triggering a Deployment rollout (or equivalent for other resources). Resources like Knative Revisions that freeze the spec will continue to use the old credentials until that revision is retired.
@gberche-orange Hey there, long time no see! I'll put in my two-cents that option 2 is where we've seen the most success. The idea that an individual secret is immutable and you simply create new, uniquely named secrets that roll out using standard Pod behaviors has a lot of advantages.
Thanks @scothis and @nebhale for your prompt answers (and good time together with CloudFoundry ! )
The Service Binding Spec doesn't have any direct mechanism for provisioning/rotating/revoking credentials. This is left to individual provisioned services to define.
Do you know if other specs had some progress on this area to standardize a common contract to provisionned services ? I recall discussions about opensourcing vmware Services-Toolkit
BTW, I just briefely looked at documentation for version 0.9 and could not yet spot a clear UX for secret rotation of provisioned services.We can explore creating a spec extension that provides recommendations for services to be able to communicate to workloads when credentials expire. Formalizing the keys you suggest should be a quick process.
That would be great, thanks !
With the reference implementation of the spec there are two ways to rotate credentials today:
- [...] If the workload does not detect the new creds, once the existing creds are invalidated, it should crash and restart to pick up the new creds
This seems very dependent on app behavior in face of errors from the service rejecting credentials, and creates unavoidable downtime.
- Create a new secret and update the provisioned service's reference to point at the new secret. The ServiceBinding controller will update workloads to use the new secret triggering a Deployment rollout (or equivalent for other resources).
This is great, and removes the need for a distinct controller such as https://github.com/stakater/Reloader
I could not spot this behavior mentionned in this specs. Did I miss it ? Would it make sense to document it ?A deployment rollout might take various time, or even fail for unrelated reasons.
How would be provisionned service know how long to keep the old secret active ?
Thanks again for your help!
At its core the Service Binding Core Specification is three things:
- a way for services to advertise binding credentials
- a way for a workload process to discover services bound to the container
- a way to wire the binding credentials advertised by a service into a workload container
More advanced behavior can be built on top of this core, but is not covered by the spec. Not that we don't think those higher level experience are important, we started with a non-contentious core that can serve as a foundation to build upon as there is interest. That can either be done in open source or proprietary layers.
A service knowing when a credential is no longer used is a hard problem to solve since it implies knowledge of how the workload operates. For example, scale to zero workloads add a dynamic where any previous running pod could be restarted.
The core spec doesn't assume the implementation will be a controller activity participating in the cluster, although the reference implementation is such a controller. The logic to perform a binding is in a package independent of the controller lifecycle. A conformant implementation could just as easily be implemented in a CLI or other client that applies bound workloads to the cluster.
Some of the rollout behavior is specific to how the reference implementation works, we can document it there. We should also add docs about the reference implementation to the website.
Reacted by Guillaume Berche
I'd like to learn how the service binding project suggest to handle binding credentials rotations.
In particular:
.status.bindingLocalObjectReference ?As an inspiration, here is how the open service broker api supports binding rotations:
OSB specs extract
https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#binding-metadata-object
https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#binding-rotation
Is there prior art/ discussion on this topic I can refer to ?
Thanks in advance for your help.