#3935: Move gradual rollout config to admin guide (#3990)

* 3935: Move gradual rollout config to admin guide

* add snippets and developer docs

* fix typo

* fix nav

* Update docs/snippets/route-status-updates.md

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update docs/snippets/route-status-updates.md

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update docs/snippets/route-status-updates.md

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update docs/snippets/multiple-rollouts.md

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update docs/snippets/gradual-rollout-intro.md

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update docs/snippets/gradual-rollout-intro.md

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update config/nav.yml

Co-authored-by: RichardJJG <rijohnson@vmware.com>

* Update config/nav.yml

Co-authored-by: RichardJJG <rijohnson@vmware.com>

Co-authored-by: RichardJJG <rijohnson@vmware.com>
This commit is contained in:
Ashleigh Brennan 2021-07-13 13:33:50 -05:00 committed by GitHub
parent 519e3b08ee
commit 424de458eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 163 additions and 130 deletions

View File

@ -53,6 +53,7 @@ nav:
# Serving config
- Knative Serving configuration:
- Configure Deployment resources: admin/serving/deployment.md
- Configuring gradual rollout of traffic to Revisions: admin/serving/rolling-out-latest-revision-configmap.md
# Eventing config
- Knative Eventing configuration:
- Configure Broker defaults: admin/eventing/broker-configuration.md
@ -68,6 +69,7 @@ nav:
- Configuring custom domains: developer/serving/services/custom-domains.md
- Configure resource requests and limits: developer/serving/services/configure-requests-limits-services.md
- Traffic management: developer/serving/traffic-management.md
- Configuring gradual rollout of traffic to Revisions: developer/serving/rolling-out-latest-revision.md
- Deploying from private registries: developer/serving/deploying-from-private-registry.md
- Tag resolution: developer/serving/tag-resolution.md
- Troubleshooting:
@ -112,7 +114,6 @@ nav:
- Knative Serving:
- Overview: serving/README.md
- Developer Topics:
- Gradually rolling out latest Revisions: serving/rolling-out-latest-revision.md
- Creating and using Subroutes: serving/using-subroutes.md
- Load balancing:
- Overview: serving/load-balancing/README.md

View File

@ -1,6 +1,7 @@
plugins:
redirects:
redirect_maps:
serving/rolling-out-latest-revision.md: developer/serving/rolling-out-latest-revision.md
serving/tag-resolution.md: developer/serving/tag-resolution.md
serving/deploying-from-private-registry.md: developer/serving/deploying-from-private-registry.md
serving/samples/blue-green-deployment.md: developer/serving/traffic-management.md

View File

@ -0,0 +1,32 @@
{% include "gradual-rollout-intro.md" %}
## Procedure
You can configure the `rollout-duration` parameter by modifying the `config-network` ConfigMap, or by using the Operator.
=== "ConfigMap configuration"
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: config-network
namespace: knative-serving
data:
rolloutDuration: "380s" # Value in seconds.
```
=== "Operator configuration"
```yaml
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
spec:
config:
network:
rolloutDuration: "380s"
```
{% include "route-status-updates.md" %}
{% include "multiple-rollouts.md" %}

View File

@ -0,0 +1,22 @@
{% include "gradual-rollout-intro.md" %}
## Procedure
You can configure the `rollout-duration` parameter per Knative Service or Route by using an annotation.
!!! tip
For information about global, ConfigMap configurations for roll-out durations, see the [Administration guide](../../../admin/serving/rolling-out-latest-revision-configmap)
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
annotations:
serving.knative.dev/rolloutDuration: "380s"
```
{% include "route-status-updates.md" %}
{% include "multiple-rollouts.md" %}

View File

@ -1,129 +0,0 @@
---
title: "Gradually rolling out latest Revisions"
weight: 20
type: "docs"
---
# Gradually rolling out latest Revisions
If your traffic configuration points to a Configuration target, rather than revision target, it means that when a new Revision is created and ready 100% of that target's traffic will be immediately shifted to the new revision, which might not be ready to accept that scale with a single pod and with cold starts taking some time it is possible to end up in a situation where a lot of requests are backed up either at QP or Activator and after a while they might expire or QP might outright reject the requests.
To mitigate this problem Knative as of 0.20 release Knative provides users with a possibility to gradually shift the traffic to the latest revision.
This is governed by a single parameter which denotes `rollout-duration`.
The affected Configuration targets will be rolled out to 1% of traffic first and then in equal incremental steps for the rest of the assigned traffic. Note, that the rollout is purely time based and does not interact with the Autoscaling subsystem.
This feature is available to untagged and tagged traffic targets configured for both Kservices and Kservice-less Routes.
## Configuring gradual Rollout
This value currently can be configured on the cluster level (starting v0.20) via a setting in the `config-network` ConfigMap or per Kservice or Route using an annotation (staring v.0.21).
=== "Per-revision"
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
annotations:
serving.knative.dev/rolloutDuration: "380s"
...
```
=== "Global (ConfigMap)"
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: config-network
namespace: knative-serving
data:
rolloutDuration: "380s" # Value in seconds.
```
=== "Global (Operator)"
```yaml
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
spec:
config:
network:
rolloutDuration: "380s"
```
## Route Status updates
During the rollout the system will update the Route and Kservice status. Both `traffic` and `conditions` status fields will be affected.
For example, a possible rollout of the following traffic configuration
```yaml
traffic:
- percent: 55
configurationName: config # Pinned to latest ready Revision
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
would be (if inspecting the route status):
```yaml
traffic:
- percent: 54
revisionName: config-00008
- percent: 1
revisionName: config-00009
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
and then, presuming steps of 18%:
```yaml
traffic:
- percent: 36
revisionName: config-00008
- percent: 19
revisionName: config-00009
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
and so on until final state is achieved:
```yaml
traffic:
- percent: 55
revisionName: config-00009
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
During the rollout the Route and (Kservice, if present) status conditions will be the following:
```yaml
...
status:
conditions:
...
- lastTransitionTime: "..."
message: A gradual rollout of the latest revision(s) is in progress.
reason: RolloutInProgress
status: Unknown
type: Ready
...
```
## Multiple Rollouts
If a new revision is created while the rollout is in progress then the system would start shifting the traffic immediately to the newest revision and it will drain the incomplete rollouts from newest to the oldest.

View File

@ -0,0 +1,13 @@
# Configuring gradual roll-out of traffic to Revisions
If your traffic configuration points to a Configuration target instead of a Revision target, when a new Revision is created and ready, 100% of the traffic from the target is immediately shifted to the new Revision.
This might make the request queue too long, either at the QP or Activator, and cause the requests to expire or be rejected by the QP.
<!--QUESTION: QP == queue proxy?-->
Knative provides a `rollout-duration` parameter, which can be used to gradually shift traffic to the latest Revision, preventing requests from being queued or rejected. Affected Configuration targets are rolled out to 1% of traffic first, and then in equal incremental steps for the rest of the assigned traffic.
!!! note
`rollout-duration` is time-based, and does not interact with the autoscaling subsystem.
This feature is available for tagged and untagged traffic targets, configured for either Knative Services or Routes without a service.

View File

@ -0,0 +1,3 @@
## Multiple roll-outs
If a new revision is created while a rollout is in progress, the system begins to shift traffic immediately to the newest Revision, and drains the incomplete roll-outs from newest to oldest.

View File

@ -0,0 +1,90 @@
## Route status updates
During a rollout, the system updates the Route and Knative Service status conditions. Both the `traffic` and `conditions` status parameters are affected.
For example, for the following traffic configuration:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
spec:
...
traffic:
- percent: 55
configurationName: config # Pinned to latest ready Revision
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
Initially 1% of the traffic is rolled out to the Revisions:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
spec:
...
traffic:
- percent: 54
revisionName: config-00008
- percent: 1
revisionName: config-00009
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
Then the rest of the traffic is rolled out in increments of 18%:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
spec:
...
traffic:
- percent: 36
revisionName: config-00008
- percent: 19
revisionName: config-00009
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
The rollout continues until the target traffic configuration is reached:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
spec:
...
traffic:
- percent: 55
revisionName: config-00009
- percent: 45
revisionName: config-00005 # Pinned to a specific Revision.
```
During the rollout, the Route and Knative Service status conditions are as follows:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
spec:
...
status:
conditions:
...
- lastTransitionTime: "..."
message: A gradual rollout of the latest revision(s) is in progress.
reason: RolloutInProgress
status: Unknown
type: Ready
```