Skip to content

[BUG] CloneSet creates new pods even if in-place update is possible #2369

@amirakhmedov

Description

@amirakhmedov

What happened:
Given a CloneSet with InPlaceIfPossible update strategy and maxSurge set. If you update the annotation in the pod template which should trigger in-place update for the running pods but this is not happening. It creates new pods configured in the maxSurge and in-place updates the remaining pods.

What you expected to happen:
I expect all pods to be in-place updated.

How to reproduce it (as minimally and precisely as possible):
Create a CloneSet with InPlaceIfPossible update strategy and maxSurge

Cloneset
apiVersion: apps.kruise.io/v1alpha1
kind: CloneSet
metadata:
  labels:
    app: sample
  name: sample
spec:
  replicas: 5
  selector:
    matchLabels:
      app: sample
  updateStrategy:
    type: InPlaceIfPossible
    maxSurge: 3
  template:
    metadata:
      labels:
        app: sample
      annotations:
        tracking-number: one
    spec:
      containers:
        - name: nginx
          image: nginx:alpine

Update the pod template to update the annotation

annotations:
  tracking-number: two

You can observe that 3 new pods are created, 3 old pods are deleted and the remaining 2 pods are in-place updated.

Anything else we need to know?:

Environment:

  • Kruise version: v1.8.0
  • Kubernetes version (use kubectl version): Client Version: v1.35.0, Server Version: v1.35.0
  • Install details (e.g. helm install args): helm install kruise openkruise/kruise --version 1.8.0
  • Others:

Metadata

Metadata

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions