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

WorkloadSpread support workload rolling update case #1197

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

veophi
Copy link
Member

@veophi veophi commented Mar 1, 2023

Ⅰ. Describe what this PR does

WorkloadSpread support rolling update via versioned subset statuses.

Ⅱ. Does this pull request fix one issue?

#1194. #834

Ⅲ. Describe how to verify it

e2e and ut

@veophi veophi changed the title WorkloadSpread support rolling update WorkloadSpread support workload rolling update case Mar 1, 2023
@veophi veophi force-pushed the ws-rolling-support branch 2 times, most recently from 32e9dbe to 765d8af Compare March 2, 2023 07:40
@zmberg zmberg added this to the v1.5 milestone Mar 9, 2023
@guhan121
Copy link

👍

@veophi veophi requested review from furykerry and removed request for FillZpp March 20, 2023 06:53
@veophi veophi force-pushed the ws-rolling-support branch 3 times, most recently from 0716f5b to 70a358f Compare March 21, 2023 03:43
@guhan121
Copy link

build from

commit 70a358f59d2214a19eb471b63996821ffd2cdbb2 (HEAD -> ws-rolling-support)
Author: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
Date:   Wed Mar 1 17:33:05 2023 +0800

    workloadspread support rolling update
    
    Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
spec:
  scheduleStrategy:
    type: Fixed
  subsets:
  - maxReplicas: 1
    name: ap-southeast-1a-spot
    patch:
      metadata:
      - labels:
          biz.type: spot
      - labels:
          topology.application.deploy/zone: ap-southeast-1a
    requiredNodeSelectorTerm:
      matchExpressions:
      - key: biz.type
        operator: In
        values:
        - spot
      - key: topology.kubernetes.io/zone
        operator: In
        values:
        - ap-southeast-1a
  - maxReplicas: 2
    name: ap-southeast-1b-spot
    patch:
      metadata:
      - labels:
          biz.type: spot
      - labels:
          topology.application.deploy/zone: ap-southeast-1b
    requiredNodeSelectorTerm:
      matchExpressions:
      - key: biz.type
        operator: In
        values:
        - spot
      - key: topology.kubernetes.io/zone
        operator: In
        values:
        - ap-southeast-1b
  targetRef:
    apiVersion: apps.kruise.io/v1alpha1
    kind: CloneSet
    name: golang-demo-project-dev1
status:
  observedGeneration: 1
  subsetStatuses:
  - missingReplicas: 0
    name: ap-southeast-1a-spot
    replicas: 6
  - missingReplicas: 2
    name: ap-southeast-1b-spot
    replicas: 0
  versionedSubsetStatuses:
    8c964dfc4:
    - missingReplicas: 1
      name: ap-southeast-1a-spot
      replicas: 0
    - missingReplicas: 2
      name: ap-southeast-1b-spot
      replicas: 0
    66f47fc4c5:
    - missingReplicas: 0
      name: ap-southeast-1a-spot
      replicas: 6
    - missingReplicas: 2
      name: ap-southeast-1b-spot
      replicas: 0
NAME                             zone
golang-demo-project-dev1-255ps   ap-southeast-1a
golang-demo-project-dev1-4qb7n   ap-southeast-1a
golang-demo-project-dev1-k8jvn   ap-southeast-1a
golang-demo-project-dev1-tfrsc   ap-southeast-1a
golang-demo-project-dev1-tkzjs   ap-southeast-1a
golang-demo-project-dev1-znc7m   ap-southeast-1a

@veophi

@veophi
Copy link
Member Author

veophi commented Mar 24, 2023

build from

commit 70a358f59d2214a19eb471b63996821ffd2cdbb2 (HEAD -> ws-rolling-support)
Author: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
Date:   Wed Mar 1 17:33:05 2023 +0800

    workloadspread support rolling update
    
    Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
spec:
  scheduleStrategy:
    type: Fixed
  subsets:
  - maxReplicas: 1
    name: ap-southeast-1a-spot
    patch:
      metadata:
      - labels:
          biz.type: spot
      - labels:
          topology.application.deploy/zone: ap-southeast-1a
    requiredNodeSelectorTerm:
      matchExpressions:
      - key: biz.type
        operator: In
        values:
        - spot
      - key: topology.kubernetes.io/zone
        operator: In
        values:
        - ap-southeast-1a
  - maxReplicas: 2
    name: ap-southeast-1b-spot
    patch:
      metadata:
      - labels:
          biz.type: spot
      - labels:
          topology.application.deploy/zone: ap-southeast-1b
    requiredNodeSelectorTerm:
      matchExpressions:
      - key: biz.type
        operator: In
        values:
        - spot
      - key: topology.kubernetes.io/zone
        operator: In
        values:
        - ap-southeast-1b
  targetRef:
    apiVersion: apps.kruise.io/v1alpha1
    kind: CloneSet
    name: golang-demo-project-dev1
status:
  observedGeneration: 1
  subsetStatuses:
  - missingReplicas: 0
    name: ap-southeast-1a-spot
    replicas: 6
  - missingReplicas: 2
    name: ap-southeast-1b-spot
    replicas: 0
  versionedSubsetStatuses:
    8c964dfc4:
    - missingReplicas: 1
      name: ap-southeast-1a-spot
      replicas: 0
    - missingReplicas: 2
      name: ap-southeast-1b-spot
      replicas: 0
    66f47fc4c5:
    - missingReplicas: 0
      name: ap-southeast-1a-spot
      replicas: 6
    - missingReplicas: 2
      name: ap-southeast-1b-spot
      replicas: 0
NAME                             zone
golang-demo-project-dev1-255ps   ap-southeast-1a
golang-demo-project-dev1-4qb7n   ap-southeast-1a
golang-demo-project-dev1-k8jvn   ap-southeast-1a
golang-demo-project-dev1-tfrsc   ap-southeast-1a
golang-demo-project-dev1-tkzjs   ap-southeast-1a
golang-demo-project-dev1-znc7m   ap-southeast-1a

@veophi

@guhan121 fixed.
plz rebuild and try again.

@veophi veophi force-pushed the ws-rolling-support branch 3 times, most recently from dd4b6d1 to 0c194db Compare March 24, 2023 11:08
@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2023

Codecov Report

Attention: 113 lines in your changes are missing coverage. Please review.

Comparison is base (6a62320) 48.35% compared to head (15a67e3) 48.63%.
Report is 4 commits behind head on master.

Files Patch % Lines
pkg/util/workloadspread/workloadspread.go 71.14% 49 Missing and 9 partials ⚠️
...roller/workloadspread/workloadspread_controller.go 66.66% 16 Missing and 3 partials ⚠️
...troller/workloadspread/update_pod_deletion_cost.go 65.62% 7 Missing and 4 partials ⚠️
...rcedistribution/resourcedistribution_controller.go 0.00% 10 Missing ⚠️
...ler/workloadspread/workloadspread_event_handler.go 74.19% 6 Missing and 2 partials ⚠️
pkg/util/tools.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1197      +/-   ##
==========================================
+ Coverage   48.35%   48.63%   +0.28%     
==========================================
  Files         154      154              
  Lines       21663    21892     +229     
==========================================
+ Hits        10475    10648     +173     
- Misses      10037    10082      +45     
- Partials     1151     1162      +11     
Flag Coverage Δ
unittests 48.63% <66.56%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

stale bot commented Nov 19, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 19, 2023
@stale stale bot closed this Nov 26, 2023
@veophi veophi reopened this Nov 27, 2023
@stale stale bot removed the wontfix This will not be worked on label Nov 27, 2023
@veophi veophi force-pushed the ws-rolling-support branch 4 times, most recently from 34f39cf to 1ce2978 Compare December 11, 2023 06:20
Copy link
Member

@furykerry furykerry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz add missing unit tests, especially for. pkg/util/workloadspread/workloadspread.go

pkg/controller/workloadspread/update_pod_deletion_cost.go Outdated Show resolved Hide resolved
Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
@veophi
Copy link
Member Author

veophi commented Dec 19, 2023

plz add missing unit tests, especially for. pkg/util/workloadspread/workloadspread.go

done @furykerry

@zmberg
Copy link
Member

zmberg commented Dec 26, 2023

/approve

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zmberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@furykerry
Copy link
Member

/lgtm

@kruise-bot kruise-bot merged commit fa7a1da into openkruise:master Dec 26, 2023
27 checks passed
@zmberg zmberg modified the milestones: v1.5, 1.6 Mar 7, 2024
ppbits pushed a commit to ppbits/kruise that referenced this pull request Apr 4, 2024
Co-authored-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants