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

support batch id label for canary strategy #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PersistentJZH
Copy link

Ⅰ. Describe what this PR does
new pods created by each step of a rollout canary release will be patched with the rollouts.kruise.io/rollout-id and rollouts.kruise.io/rollout-batch-id labels, which is useful for platforms to select pods with some specific batch

Ⅱ. Does this pull request fix one issue?
fixes #249

Ⅲ. Special notes for reviews

@PersistentJZH PersistentJZH force-pushed the zhihao/feat/support-batch-id-label-for-canary-and-bluegreen-strategy branch from 0980b79 to 227898c Compare January 13, 2025 10:07
@PersistentJZH PersistentJZH force-pushed the zhihao/feat/support-batch-id-label-for-canary-and-bluegreen-strategy branch from 227898c to e8e810c Compare January 13, 2025 10:37
@@ -182,6 +182,15 @@ func (rc *realController) CalculateBatchContext(release *v1beta1.BatchRelease) (
NoNeedUpdatedReplicas: noNeedUpdate,
PlannedUpdatedReplicas: plannedUpdate,
DesiredUpdatedReplicas: desiredUpdate,
FilterFunc: func(pods []*corev1.Pod, ctx *batchcontext.BatchContext) []*corev1.Pod {
Copy link
Member

Choose a reason for hiding this comment

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

per previous code design, FilterFunc is used to filtering pods durning rollback situation (refer to the impl func FilterPodsForUnorderedUpdate and FilterPodsForOrderedUpdate), the comparison of IsConsistentWithRevision is common and not necessary to include it in the FilterFunc. In addition, in the case of canary deployment, the logic to select pods of canary deployment can also be included in the FilterFunc.

Copy link
Author

Choose a reason for hiding this comment

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

In the partitionstyle scenario, compare the pod label with UpdateRevision to filter pod. In the canarystyle scenario, need to compare it with StableRevision. Can I refer to the implementation of #250 so that different patcher can have different revisionConsistents Func.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support batch-id labeling for canary and bluegreen strategy
2 participants