OpenKruise v0.10.0: WorkloadSpread, PodUnavailableBudget & Advanced StatefulSet
OpenKruise v0.10.0 introduces major enhancements such as WorkloadSpread for flexible topology-aware pod distribution, PodUnavailableBudget that extends PDB protection to voluntary disruptions, CloneSet scaling rules based on topology, and Advanced StatefulSet’s maxUnavailable-driven streaming scale-out, all configurable via feature-gates.
Background: OpenKruise is an open-source cloud-native application automation management suite, a CNCF Sandbox project. Version v0.10.0 is the last minor release before the upcoming v1.0.
WorkloadSpread – Flexible Topology-Aware Pod Distribution
WorkloadSpread lets users define fine-grained spreading rules across nodes, zones, or custom topology groups, addressing scenarios such as uneven zone traffic, priority zones for scaling, and separation of baseline versus elastic node pools. It works with Deployment, ReplicaSet and CloneSet.
apiVersion: apps.kruise.io/v1alpha1
kind: WorkloadSpread
metadata:
name: workloadspread-demo
spec:
targetRef:
apiVersion: apps/v1 | apps.kruise.io/v1alpha1
kind: Deployment | CloneSet
name: workload-xxx
subsets:
- name: subset-a
requiredNodeSelectorTerm:
matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- zone-a
maxReplicas: 10 | 30%
- name: subset-b
requiredNodeSelectorTerm:
matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values:
- zone-bWhen the WorkloadSpread resource is created, Kruise injects the defined topology rules during pod scaling without interfering with the underlying Workload’s own scaling or rollout logic. Pod deletion priority is controlled via the Pod Deletion Cost feature.
If the workload type is CloneSet, the feature is already enabled.
If the workload type is Deployment or ReplicaSet, Kubernetes version ≥ 1.21 is required and the PodDeletionCost feature-gate must be turned on in the controller-manager.
Enable the WorkloadSpread feature-gate when installing or upgrading to Kruise v0.10.0.
PodUnavailableBudget (PUB) – Strengthened Voluntary Disruption Protection
Native Pod Disruption Budgets only guard against eviction-triggered pod removals. PUB extends this protection to voluntary actions such as pod deletion, in-place upgrades, and sidecar updates, covering scenarios where PDB alone cannot prevent service impact.
apiVersion: apps.kruise.io/v1alpha1
kind: PodUnavailableBudget
metadata:
name: web-server-pub
namespace: web
spec:
targetRef:
apiVersion: apps/v1 | apps.kruise.io/v1alpha1
kind: Deployment | CloneSet | StatefulSet | ...
name: web-server
maxUnavailable: 60%Two feature-gates control PUB behavior:
PodUnavailableBudgetDeleteGate – protects against pod deletion and eviction.
PodUnavailableBudgetUpdateGate – protects against in-place upgrades and similar updates.
Activate the desired gate(s) during Kruise v0.10.0 installation or upgrade.
CloneSet Scaling Order Based on Topology
CloneSet now respects topology spread constraints when choosing pods to delete during scale-down. The ordering algorithm considers scheduling state, pod phase, readiness, pod-deletion-cost, topology weight, pod age, restart count, and creation time. The “topology weight” rule (item 5) is new in v0.10.0.
If topology spread constraints are defined, CloneSet spreads deletions across the specified topology dimension (e.g., zones).
Otherwise, deletions are spread across nodes to minimize pod stacking.
Advanced StatefulSet – Streaming Scale-Out with maxUnavailable
Advanced StatefulSet introduces a maxUnavailable field in the scale strategy, limiting the number of unavailable pods during a large-scale rollout. This prevents a burst of failing pods when many replicas are created at once.
apiVersion: apps.kruise.io/v1beta1
kind: StatefulSet
spec:
replicas: 100
scaleStrategy:
maxUnavailable: 10% # percentage or absolute numberThe feature works only for StatefulSets with podManagementPolicy: Parallel. Pods are created in batches respecting the maxUnavailable limit, ensuring that new pods become ready before additional ones are launched.
Other Notable Changes
SidecarSet adds imagePullSecrets and injectionStrategy.paused fields.
Advanced StatefulSet supports pre-warming images for in-place upgrades.
Final Notes
v0.10.0 is the last minor release before OpenKruise v1.0, expected later this year. The community will hold a bi-weekly meeting starting 9 September 2023 to demo these features. Links to the GitHub repository, documentation, and Zoom meeting are provided for participants.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
