Configuring gradual roll-out of traffic to Revisions

    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.

    Knative provides a 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.

    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.

    During a rollout, the system updates the Route and Knative Service status conditions. Both the traffic and conditions status parameters are affected.

    1. apiVersion: serving.knative.dev/v1
    2. kind: Service
    3. metadata:
    4. ...
    5. spec:
    6. ...
    7. traffic:
    8. - percent: 55
    9. configurationName: config # Pinned to latest ready Revision

    Initially 1% of the traffic is rolled out to the Revisions:

    Then the rest of the traffic is rolled out in increments of 18%:

    1. apiVersion: serving.knative.dev/v1
    2. kind: Service
    3. metadata:
    4. ...
    5. spec:
    6. ...
    7. traffic:
    8. - percent: 36
    9. revisionName: config-00008
    10. - percent: 19
    11. revisionName: config-00009
    12. - percent: 45

    The rollout continues until the target traffic configuration is reached:

    During the rollout, the Route and Knative Service status conditions are as follows:

    1. kind: Service
    2. metadata:
    3. ...
    4. spec:
    5. ...
    6. status:
    7. conditions:
    8. ...
    9. - lastTransitionTime: "..."
    10. message: A gradual rollout of the latest revision(s) is in progress.
    11. reason: RolloutInProgress
    12. status: Unknown