rollouts icon indicating copy to clipboard operation
rollouts copied to clipboard

How to partition update an native statefulset in batch

Open IamIpanda opened this issue 1 year ago • 1 comments

We're using a quite conservative k8s strategy, and now on 1.24, without alpha features. (No MaxUnavailable field.) Most of our workloads are native StatefulSet and we cannot change it.

Now we want to make its rollout quicker with 25% pods MaxUnavailable. I write a rollout like this:

apiVersion: rollouts.kruise.io/v1alpha1
kind: Rollout
metadata:
  name: foo
  annotations:
    rollouts.kruise.io/rolling-style: partition
spec:
  objectRef:
    workloadRef:
      apiVersion: apps/v1
      kind: StatefulSet
      name: foo
  strategy:
    canary:
      steps:
      - replicas: 1
      - replicas: 25%
      - replicas: 50%
      - replicas: 75%
      - replicas: 100%

The sts: podManagementPolicy is Parallel, updateStrategy is type: RollingUpdate

Now rollout works, but during its steps, it still rollout its pods one by one like native, not in batch. I want inner step, just remove all pods in this step. Is this supported? Or do I config something wrong?

Thanks.

IamIpanda avatar Oct 25 '23 03:10 IamIpanda

I'm afraid it is not supported, kruise rollout still relies on the referenced workload to manage the pod, and it make no sense to support the maxUnavailable of native statefulset below 1.24.

furykerry avatar Oct 25 '23 05:10 furykerry