Gradually rolling out latest Revisions
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 .
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.
apiVersion: v1
kind: ConfigMap
metadata:
name: config-network
namespace: knative-serving
rolloutDuration: "380s" # Value in seconds.
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
- 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):
traffic:
- percent: 36
revisionName: config-00008
- percent: 19
revisionName: config-00009
and so on until final state is achieved:
During the rollout the Route and (Kservice, if present) status conditions will be the following:
...
status:
conditions:
...
- lastTransitionTime: "..."
message: A gradual rollout of the latest revision(s) is in progress.
reason: RolloutInProgress
status: Unknown
type: Ready
...
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.