Skip to content

docs: add tutorial for progressive delivery on custom StatefulSet-like workloads#338

Open
abhisheksainimitawa wants to merge 1 commit into
openkruise:masterfrom
abhisheksainimitawa:docs/custom-workload-rollout
Open

docs: add tutorial for progressive delivery on custom StatefulSet-like workloads#338
abhisheksainimitawa wants to merge 1 commit into
openkruise:masterfrom
abhisheksainimitawa:docs/custom-workload-rollout

Conversation

@abhisheksainimitawa

Copy link
Copy Markdown

What

Adds docs/tutorials/custom_workload.md — a step-by-step guide documenting support for progressive delivery on custom CRDs that follow the StatefulSet update model.

Also adds a Docs entry in CHANGELOG.md under v0.6.2.

Closes #242.

Why

The rollouts.kruise.io/workload-type: statefulset label has been supported in the codebase for a while (see pkg/util/constant.go, pkg/webhook/workload/mutating/unified_update_handler.go) but was never documented. Users with custom operators (Elasticsearch, Kafka, custom GameServer CRDs, etc.) that use a StatefulSet-style partition update model have no way to discover this capability.

What the doc covers

Section Content
How it works Webhook intercepts update, sets partition=MaxInt32, Rollout controller advances partition per batch
CRD requirements spec.replicas, spec.template, spec.updateStrategy.rollingUpdate.partition must exist
Step 1 Add rollouts.kruise.io/workload-type: statefulset label to the custom workload
Step 2 Create a Rollout with workloadRef pointing to the custom CRD
Step 3 Trigger rollout by updating Pod template; approve steps via kubectl-kruise
Step 4 Rollback by reverting the template
Troubleshooting Common failure modes with concrete checks

How I verified the content

The doc was written by reading the actual implementation:

  • pkg/util/constant.goWorkloadTypeLabel and StatefulSetType constants
  • pkg/webhook/workload/mutating/unified_update_handler.go — how workload-type triggers webhook interception
  • pkg/util/parse_utils.goIsStatefulSetRollingUpdate and SetStatefulSetPartition (shows the partition mechanism and CRD field requirements)
  • pkg/controller/rollout/rollout_controller.gopatchWorkloadRolloutWebhookLabel (how the webhook is dynamically configured)

Signed-off-by: abhisheksainimitawa abhi9813293405@gmail.com

/cc @furykerry @ls-2018

…e workloads

Kruise Rollout has supported rollouts for any custom CRD that uses the
StatefulSet partition-based update model via the
`rollouts.kruise.io/workload-type: statefulset` label, but this feature
was entirely undocumented (issue openkruise#242).

This commit adds:
- docs/tutorials/custom_workload.md: step-by-step guide covering CRD
  structural requirements, how to label the workload, Rollout spec
  configuration, triggering and approving rollout steps, rollback, and
  troubleshooting tips.
- CHANGELOG.md: note under v0.6.2 Docs section referencing openkruise#242.

Signed-off-by: abhisheksainimitawa <abhi9813293405@gmail.com>
@kruise-bot kruise-bot requested review from furykerry and ls-2018 May 15, 2026 11:54
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign furykerry for approval by writing /assign @furykerry in a comment. For more information see:The Kubernetes Code Review Process.

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

Details 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

@kruise-bot

Copy link
Copy Markdown

Welcome @abhisheksainimitawa! It looks like this is your first PR to openkruise/rollouts 🎉

@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.38%. Comparing base (b2600e9) to head (63f81ee).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #338   +/-   ##
=======================================
  Coverage   51.38%   51.38%           
=======================================
  Files          66       66           
  Lines        8559     8559           
=======================================
  Hits         4398     4398           
  Misses       3575     3575           
  Partials      586      586           
Flag Coverage Δ
unittests 51.38% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add docs about rollout support for customized workload

2 participants