Skip to content

[Multi_K8s-Plugin] Primary Rollout #6591

Open
mohammedfirdouss wants to merge 6 commits intopipe-cd:masterfrom
mohammedfirdouss:feat/k8s-multi-primary-rollout
Open

[Multi_K8s-Plugin] Primary Rollout #6591
mohammedfirdouss wants to merge 6 commits intopipe-cd:masterfrom
mohammedfirdouss:feat/k8s-multi-primary-rollout

Conversation

@mohammedfirdouss
Copy link
Contributor

@mohammedfirdouss mohammedfirdouss commented Mar 14, 2026

What this PR does
Implements K8S_PRIMARY_ROLLOUT for the kubernetes_multicluster plugin. After a canary is validated, this stage promotes the new version as PRIMARY across all targeted clusters in parallel. It supports addVariantLabelToSelector (inject variant label into workload selectors), createService (generate a PRIMARY-varianta Service), and prune (delete stale primary resources no longer in Git).

Why we need it
This is the promotion step in the canary pipeline lifecycle — K8S_CANARY_ROLLOUT and WAIT_APPROVAL are validation gates, but K8S_PRIMARY_ROLLOUT is what actually delivers the new version to end-users across all clusters.

Which issue(s) this PR fixes
Fixes #6446

Does this PR introduce a user-facing change

  • How are users affected — Users can now add K8S_PRIMARY_ROLLOUT to their pipeline to promote a validated canary to primary across multiple clusters
  • Is this breaking change — No
  • How to migrate — N/A

Primary rollout with service

Screenshot Capture - 2026-03-19 - 14-39-34 Screenshot Capture - 2026-03-19 - 14-40-14 Screenshot Capture - 2026-03-19 - 14-40-23 Screenshot Capture - 2026-03-19 - 14-40-53 Screenshot Capture - 2026-03-19 - 14-40-57 Screenshot Capture - 2026-03-19 - 14-41-08 Screenshot Capture - 2026-03-19 - 14-41-14 Screenshot Capture - 2026-03-19 - 14-39-25

Primary rollout without service

Screenshot Capture - 2026-03-19 - 14-35-06 Screenshot Capture - 2026-03-19 - 14-35-16 Screenshot Capture - 2026-03-19 - 14-36-01 Screenshot Capture - 2026-03-19 - 14-36-18 Screenshot Capture - 2026-03-19 - 14-36-30 Screenshot Capture - 2026-03-19 - 14-36-40 Screenshot Capture - 2026-03-19 - 14-36-44 Screenshot Capture - 2026-03-19 - 14-34-56

@mohammedfirdouss mohammedfirdouss changed the title [Multi_K8s-Plugin] Multi Primary Rollout [Multi_K8s-Plugin] Primary Rollout Mar 14, 2026
@mohammedfirdouss mohammedfirdouss marked this pull request as ready for review March 17, 2026 09:49
@mohammedfirdouss mohammedfirdouss requested a review from a team as a code owner March 17, 2026 09:49
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.29%. Comparing base (e740e52) to head (9589e3e).

❗ There is a different number of reports uploaded between BASE (e740e52) and HEAD (9589e3e). Click for more details.

HEAD has 12 uploads less than BASE
Flag BASE (e740e52) HEAD (9589e3e)
.-tool-codegen-protoc-gen-auth 1 0
.-tool-actions-plan-preview 1 0
.-pkg-app-pipedv1-plugin-scriptrun 1 0
.-pkg-app-pipedv1-plugin-analysis 1 0
.-pkg-plugin-sdk 1 0
.-pkg-app-pipedv1-plugin-waitapproval 1 0
.-pkg-app-pipedv1-plugin-ecs 1 0
.-pkg-app-pipedv1-plugin-wait 1 0
.-pkg-app-pipedv1-plugin-terraform 1 0
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 1 0
.-pkg-app-pipedv1-plugin-kubernetes 1 0
.-tool-actions-gh-release 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6591      +/-   ##
==========================================
- Coverage   28.94%   23.29%   -5.66%     
==========================================
  Files         577      424     -153     
  Lines       61367    47104   -14263     
==========================================
- Hits        17763    10972    -6791     
+ Misses      42250    35228    -7022     
+ Partials     1354      904     -450     
Flag Coverage Δ
. 23.29% <ø> (+0.02%) ⬆️
.-pkg-app-pipedv1-plugin-analysis ?
.-pkg-app-pipedv1-plugin-ecs ?
.-pkg-app-pipedv1-plugin-kubernetes ?
.-pkg-app-pipedv1-plugin-kubernetes_multicluster ?
.-pkg-app-pipedv1-plugin-scriptrun ?
.-pkg-app-pipedv1-plugin-terraform ?
.-pkg-app-pipedv1-plugin-wait ?
.-pkg-app-pipedv1-plugin-waitapproval ?
.-pkg-plugin-sdk ?
.-tool-actions-gh-release ?
.-tool-actions-plan-preview ?
.-tool-codegen-protoc-gen-auth ?

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mohammedfirdouss
Copy link
Contributor Author

@Warashi Please when you have time, I need your review on the primary rollout.

@Warashi
Copy link
Member

Warashi commented Mar 18, 2026

@mohammedfirdouss
Thank you for reminding me.
Could you please resolve the CI failure first?
I don't have much time on this weekend, but I prioritize reviewing this PR after the CI passes.

Copy link
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

This PR seems to contain changes related to the Canary Clean stage. Please take a look?

@mohammedfirdouss
Copy link
Contributor Author

mohammedfirdouss commented Mar 20, 2026

This PR seems to contain changes related to the Canary Clean stage. Please take a look?

Yes, I just need to rebase that is all.

@Warashi all done

@mohammedfirdouss mohammedfirdouss force-pushed the feat/k8s-multi-primary-rollout branch from 0a73ef1 to 2d7112f Compare March 20, 2026 10:21
Copy link
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

I haven't seen all of the changes, but there seems to be something wrong with modifying Canary’s code.
Please take a look.

P.S.
I have a family trip from this Friday to Sunday, so I cannot review deeply. Sorry for the inconvenience.

Copy link
Member

Choose a reason for hiding this comment

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

I think there's something wrong with this file being modified.
This PR is not for canary stages, and this file is.

@mohammedfirdouss
Copy link
Contributor Author

I haven't seen all of the changes, but there seems to be something wrong with modifying Canary’s code. Please take a look.

P.S. I have a family trip from this Friday to Sunday, so I cannot review deeply. Sorry for the inconvenience.

Ohh, I will check that now. Okay noted, no problem at all.

@mohammedfirdouss mohammedfirdouss force-pushed the feat/k8s-multi-primary-rollout branch from 2d7112f to 15e118c Compare March 20, 2026 14:33
mohammedfirdouss added a commit to mohammedfirdouss/pipecd that referenced this pull request Mar 20, 2026
* Add K8S_PRIMARY_ROLLOUT stage definition and pipeline registration
* Implement executeK8sMultiPrimaryRolloutStage with multi-cluster support
* Add primary rollout tests covering single cluster, multi-cluster, prune, and service creation scenarios
* Add testdata configurations for primary rollout stages
* Add K8sPrimaryRolloutStageOptions config type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mohammedfirdouss mohammedfirdouss force-pushed the feat/k8s-multi-primary-rollout branch 3 times, most recently from f0621cd to c28a5bb Compare March 20, 2026 14:42
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
@mohammedfirdouss
Copy link
Contributor Author

@Warashi hi. Any updates on this? :)

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.

[LFX Mentorship T-1 2026] Kubernetes Multi-Cluster Plugin Enhancement #6446

2 participants