Skip to content

Commit 7269563

Browse files
committed
Add service credential rotation feature doc
1 parent 2ad225a commit 7269563

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

services/application-binding.html.md.erb

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ To update your service credentials:
255255

256256
### <a id='update-credentials-without-downtime'></a>Without downtime
257257

258-
To update your service credentials without experiencing app downtime:
258+
To update your service credentials without experiencing app downtime you can either employ a blue-green update scheme or use the new service credential binding rotation feature.
259+
260+
#### <a id='blue-green-update'></a>Blue-green update
259261

260262
1. Start a blue-green update of the app. For more information, see [Using blue-green deployment to reduce downtime and risk](../deploy-apps/blue-green.html). Push the "Green" version of the app with the `--no-start` parameter to prevent the app from starting right away:
261263

@@ -281,6 +283,35 @@ To update your service credentials without experiencing app downtime:
281283
$ cf unbind-service YOUR-APP YOUR-SERVICE-INSTANCE
282284
</pre>
283285

286+
#### <a id='service-credential-binding-rotation'></a>Service credential binding rotation
287+
288+
The service credential binding rotation feature allows you to rotate credentials for a service instance without unbinding and rebinding the service instance. This feature requires the following prerequisites:
289+
290+
- The Cloud Foundry platform must support at least 2 bindings per service instance. This is configured by the platform operator with the `cc.max_service_credential_bindings_per_app_service_instance` property in the Cloud Controller configuration.
291+
- The service broker must support multiple bindings for the service offering.
292+
- You must use at least CF CLI v8.18.0.
293+
294+
To rotate credentials for an already bound service instance with no downtime:
295+
296+
1. Create an additional service binding to your service instance by running:
297+
298+
<pre class="terminal">
299+
$ cf bind-service YOUR-APP YOUR-SERVICE-INSTANCE --strategy multiple
300+
</pre>
301+
302+
1. Trigger a rolling update of your application. The updated application instances will only see the new credentials:
303+
304+
<pre class="terminal">
305+
$ cf restage YOUR-APP --strategy rolling
306+
</pre>
307+
308+
1. Once the update has been completed, you can delete the old service bindings with the `cleanup-outdated-service-bindings` command. It only keeps the newest binding and deletes the old bindings:
309+
310+
<pre class="terminal">
311+
$ cf cleanup-outdated-service-bindings YOUR-APP
312+
</pre>
313+
314+
284315
## <a id='unbind'></a>Unbind a service instance
285316

286317
Unbinding a service removes the credentials created for your app from the [VCAP_SERVICES](../deploy-apps/environment-variable.html) environment variable.
@@ -293,3 +324,6 @@ OK
293324

294325
<p class="note important">
295326
You must restart or in some cases re-push your app for changes to be applied to the <a href="../deploy-apps/environment-variable.html">VCAP_SERVICES</a> environment variable and for the app to recognize these changes.</p>
327+
328+
<p class="note important">
329+
If there are multiple service bindings as described in [Service credential binding rotation](#service-credential-binding-rotation), make sure to use CF CLI v8.18.0 or later to unbind all service bindings.</p>

0 commit comments

Comments
 (0)