UnitedDeployment
Different domains in one Kubernetes cluster are represented by multiple groups of nodes identified by labels. UnitedDeployment controller provisions one type of workload for each group of with corresponding matching , so that the pods created by individual workload will be scheduled to the target domain.
Each workload managed by UnitedDeployment is called a subset
. Each domain should at least provide the capacity to run the replicas
number of pods. Currently StatefulSet
, Advanced StatefulSet
, CloneSet
and Deployment
are the supported workloads.
API definition: https://github.com/openkruise/kruise/blob/master/apis/apps/v1alpha1/uniteddeployment_types.go
This controller provides spec.topology
to describe the pod distribution specification.
topology.subsets
specifies the desired group of subset
s. A subset added to or removed from this array will be created or deleted by controller during reconcile. Each subset workload is created based on the description of UnitedDeployment . subset
provides the necessary topology information to create a subset workload. Each subset has a unique name. A subset workload is created with the name prefix in format of <UnitedDeployment-name>-<Subset-name>-
. Each subset will also be configured with the nodeSelector
. When provisioning a StatefulSet subset
, the nodeSelector
will be added to the StatefulSet’s podTemplate
, so that the Pods of the StatefulSet will be created with the expected node affinity.
By default, UnitedDeployment’s Pods are evenly distributed across all subsets. There are two scenarios the controller does not follow this policy:
The other scenario is that the indicated subset replicas policy becomes invalid. For example, the UnitedDeployment’s spec.replicas
is decremented to be less than the sum of all subset.replicas
. In this case, the indicated subset.replicas
is ineffective and the controller will automatically scale each subset’s replicas to match the total replicas number. The controller will try its best to apply this adjustment smoothly.
Pod Update Management
When spec.template
is updated, a upgrade progress will be triggered. New template will be patch to each subset workload, which triggers subset controller to update their pods. Furthermore, if subset workload supports partition
, like StatefulSet, AdvancedStatefulSet is also able to provide Manual
update strategy.
Manual
update strategy allows users to control the update progress by indicating the partition
of each subset. The controller will pass the partition
to each subset.