openkruise / rollouts

Enhanced Rollouts features for application automation.
Apache License 2.0
220 stars 67 forks source link

[Feature] Support specifying batch index for rolling #120

Open Somefive opened 1 year ago

Somefive commented 1 year ago

By far, in the spec of Rollout, we can only specify the steps of the rolling process but cannot set which step we want to reached. In the case that the Rollout process needs to be managed by upper layer system, like App Delivery Tools / GitOps Tools / Business Platform, we need to set all the steps before the desired step to use no duration to allow a direct rolling.

For example, if we have a rolling process that contains 5 steps

steps:
  - weight: 5
  - weight: 10
  - weight: 20
  - weight: 50
  - weight: 100

If we want to let the rolling to reach the 4th step and stop there, we need to write

steps:
  - weight: 5
    pause:
      duration: 0
  - weight: 10
    pause:
      duration: 0
  - weight: 20
    pause:
      duration: 0
  - weight: 50
    pause: {}
  - weight: 100

This might not be a very convenient way especially when user needs to interact with the whole spec of the rollout object directly.

If we can support a more convenient way to do that, like directly specifying the desired step id or index, it could make it easier for the interaction like

stepIndex: 3
steps:
  - weight: 5
  - weight: 10
  - weight: 20
  - weight: 50
  - weight: 100

BTW, the currentStepIndex in the status field could also be an alternative place for changing step index. As in kubectl v1.26, we could use kubectl edit --subresource=status to edit the status of the Kubernetes resources.

veophi commented 1 year ago

/assign @veophi