Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] some rollingUpdate field can not updated,if the yaml did not set type: RollingUpdate #1128

Closed
13567436138 opened this issue Nov 18, 2022 · 3 comments · Fixed by #1189
Assignees
Labels
kind/bug Something isn't working kind/good-first-issue Good for newcomers

Comments

@13567436138
Copy link

What happened:

apiVersion: v1
kind: Service
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  ports:
  - port: 80
    name: web
  clusterIP: None
  selector:
    app: nginx
---
apiVersion: apps.kruise.io/v1beta1
kind: StatefulSet
metadata:
  name: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  serviceName: "nginx"
  replicas: 5
  template:
    metadata:
      labels:
        app: nginx
    spec:
      terminationGracePeriodSeconds: 10
      readinessGates:
      - conditionType: InPlaceUpdateReady      
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
          name: web
        volumeMounts:
        - name: www
          mountPath: /usr/share/nginx/html
  volumeClaimTemplates:
  - metadata:
      name: www
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: "nfs-sc"
      resources:
        requests:
          storage: 10Mi
  podManagementPolicy: Parallel
  updateStrategy:
    rollingUpdate:
      unorderedUpdate:
        priorityStrategy:
          weightPriority:
          - weight: 50
            matchSelector:
              matchLabels:
                test-key: foo
          - weight: 30
            matchSelector:
              matchLabels:
                test-key: bar

apply the yaml with the result:

[root@node01 ~]# kubectl get asts -n kruise nginx  -o yaml
apiVersion: apps.kruise.io/v1beta1
kind: StatefulSet
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"apps.kruise.io/v1beta1","kind":"StatefulSet","metadata":{"annotations":{},"name":"nginx","namespace":"kruise"},"spec":{"podManagementPolicy":"Parallel","replicas":5,"selector":{"matchLabels":{"app":"nginx"}},"serviceName":"nginx","template":{"metadata":{"labels":{"app":"nginx"}},"spec":{"containers":[{"image":"nginx","name":"nginx","ports":[{"containerPort":80,"name":"web"}],"volumeMounts":[{"mountPath":"/usr/share/nginx/html","name":"www"}]}],"readinessGates":[{"conditionType":"InPlaceUpdateReady"}],"terminationGracePeriodSeconds":10}},"updateStrategy":{"rollingUpdate":{"paused":true}},"volumeClaimTemplates":[{"metadata":{"name":"www"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Mi"}},"storageClassName":"nfs-sc"}}]}}
  creationTimestamp: "2022-11-18T13:23:02Z"
  generation: 2
  name: nginx
  namespace: kruise
  resourceVersion: "5535556"
  selfLink: /apis/apps.kruise.io/v1beta1/namespaces/kruise/statefulsets/nginx
  uid: 9edf5f77-ba7d-4164-a483-2c46136c758e
spec:
  persistentVolumeClaimRetentionPolicy:
    whenDeleted: Retain
    whenScaled: Retain
  podManagementPolicy: Parallel
  replicas: 5
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: nginx
  serviceName: nginx
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: nginx
        test: test
    spec:
      containers:
      - image: nginx
        name: nginx
        ports:
        - containerPort: 80
          name: web
        resources: {}
        volumeMounts:
        - mountPath: /usr/share/nginx/html
          name: www
      readinessGates:
      - conditionType: InPlaceUpdateReady
      terminationGracePeriodSeconds: 10
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
      minReadySeconds: 0
      partition: 0
      podUpdatePolicy: ReCreate
    type: RollingUpdate
  volumeClaimTemplates:
  - metadata:
      creationTimestamp: null
      name: www
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Mi
      storageClassName: nfs-sc
    status: {}
status:
  availableReplicas: 4
  collisionCount: 0
  currentReplicas: 0
  currentRevision: nginx-67cfcdcc8b
  labelSelector: app=nginx
  observedGeneration: 2
  readyReplicas: 4
  replicas: 5
  updateRevision: nginx-75c686858d
  updatedReadyReplicas: 4
  updatedReplicas: 4

focus at:

  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
      minReadySeconds: 0
      partition: 0
      podUpdatePolicy: ReCreate
    type: RollingUpdate

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kruise version:
  • Kubernetes version (use kubectl version):
  • Install details (e.g. helm install args):
  • Others:
@13567436138 13567436138 added the kind/bug Something isn't working label Nov 18, 2022
@zmberg
Copy link
Member

zmberg commented Dec 2, 2022

@zmberg zmberg assigned zmberg and unassigned FillZpp Dec 2, 2022
@zmberg zmberg modified the milestone: v1.4 Jan 5, 2023
diannaowa added a commit to diannaowa/kruise that referenced this issue Feb 22, 2023
Signed-off-by: liuzhenwei <dui_zhang@163.com>
@diannaowa
Copy link
Contributor

I met this issue too. May be fixed by #1189

@zmberg zmberg added the kind/good-first-issue Good for newcomers label Feb 22, 2023
@zmberg
Copy link
Member

zmberg commented Feb 22, 2023

/assign @diannaowa

@zmberg zmberg removed their assignment Feb 22, 2023
kruise-bot pushed a commit that referenced this issue Feb 22, 2023
Signed-off-by: liuzhenwei <dui_zhang@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/good-first-issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants