Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Feature: support batch deployment strategy #22

Merged
merged 22 commits into from
Sep 25, 2023

Conversation

Charlie17Li
Copy link
Collaborator

@Charlie17Li Charlie17Li commented Aug 13, 2023

Description

支持自定义分组发布策略

测试结果如下所示,将一个 3 副本的 module deployment并分三组部署到 pod 上,并在 Status 可以看到每一个批次的状态信息

➜  module-controller git:(feat/batchDeploy) ✗ k describe moduledeployment moduledeployment-sample
...
Status:
  Conditions:
    last_transition_time:  2023-09-19T15:17:53Z
    Message:               deployment release: curbatch 1, batchCount 3
    Status:                True
    Type:                  Progressing
    last_transition_time:  2023-09-19T15:17:53Z
    Message:               deployment release: curbatch 2, batchCount 3
    Status:                True
    Type:                  Progressing
    last_transition_time:  2023-09-19T15:17:53Z
    Message:               deployment release: curbatch 3, batchCount 3
    Status:                True
    Type:                  Progressing
    last_transition_time:  2023-09-19T15:17:53Z
    Message:               deployment release progress completed
    Status:                True
    Type:                  Available
  Release Status:
    Current Batch:         4
    Last Transition Time:  2023-09-19T15:17:53Z
    Progress:              Completed

发生版本变更时

# 创建第一次发布
➜ k apply -f config/samples/module-deployment_v1alpha1_moduledeployment.yaml
moduledeployment.serverless.alipay.com/moduledeployment-sample created

➜ k get moduledeployment && k get modulereplicaset && k get  module
NAME                      AGE
moduledeployment-sample   41s
NAME                                 AGE
moduledeployment-sample-replicas-1   41s
NAME                                                        AGE
moduledeployment-sample-replicas-1-dynamic-provider-57zmn   40s
moduledeployment-sample-replicas-1-dynamic-provider-6jzjb   40s
moduledeployment-sample-replicas-1-dynamic-provider-zfjq4   41s

# 更新版本重新apply
➜ k apply -f config/samples/module-deployment_v1alpha1_moduledeployment.yaml
moduledeployment.serverless.alipay.com/moduledeployment-sample configured

➜ k get moduledeployment && k get modulereplicaset && k get  module         
NAME                      AGE
moduledeployment-sample   66s
NAME                                 AGE
moduledeployment-sample-replicas-1   66s
moduledeployment-sample-replicas-2   4s
NAME                                                        AGE
moduledeployment-sample-replicas-1-dynamic-provider-57zmn   65s
moduledeployment-sample-replicas-1-dynamic-provider-6jzjb   65s
moduledeployment-sample-replicas-1-dynamic-provider-zfjq4   66s
moduledeployment-sample-replicas-2-dynamic-provider-8t2g9   3s
moduledeployment-sample-replicas-2-dynamic-provider-dhmf9   3s
moduledeployment-sample-replicas-2-dynamic-provider-pm7rh   3s

# old replicaset 自动清除
➜ k get moduledeployment && k get modulereplicaset && k get  module
NAME                      AGE
moduledeployment-sample   107s
NAME                                 AGE
moduledeployment-sample-replicas-1   107s
moduledeployment-sample-replicas-2   45s
NAME                                                        AGE
moduledeployment-sample-replicas-2-dynamic-provider-8t2g9   44s
moduledeployment-sample-replicas-2-dynamic-provider-dhmf9   44s
moduledeployment-sample-replicas-2-dynamic-provider-pm7rh   44s

ref: #21

@sofastack-cla sofastack-cla bot added size/XL and removed size/L labels Sep 20, 2023
Copy link
Collaborator

@gold300jin gold300jin left a comment

Choose a reason for hiding this comment

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

核心逻辑先合并,部分细节需要继续优化

@gold300jin gold300jin merged commit d671a08 into sofastack:master Sep 25, 2023
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants