Repository: apecloud/kubeblocks

Issue:
[BUG] Reconfigure Ops is RUNNING even if parameter is not found
1. create a mysql cluster
2. when cluster is running , reconfig with 
```yaml
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
  name: mysql-reconfigure-invalid2
  namespace: demo
spec:
  type: Reconfiguring
  clusterName: mysql-cluster
  reconfigures:
  - componentName: mysql
    parameters:
    - key: max_connections_abc
      value: 'STRING'
```

where `max_connections_abc` is an invalid paramter.

3. Ops is RUNNING forever
4. Check `Parameter` status
```
Status:
  Message:              parameter max_connections_abc not found in parameters schema
  Observed Generation:  1
  Phase:                Running
Events:                 <none>
```

It reports message that parameter is not found


**Expected Behavior:**
1. If Parameter key not found, Parameter CR should goes to Failed/Abort phase instead of RUNNING

Discussion:

Solution patch:
diff --git a/apis/apps/v1alpha1/rollout_types.go b/apis/apps/v1alpha1/rollout_types.go
index 999fe58c4..52295210b 100644
--- a/apis/apps/v1alpha1/rollout_types.go
+++ b/apis/apps/v1alpha1/rollout_types.go
@@ -75,6 +75,13 @@ type RolloutSpec struct {
 	// +optional
 	Components []RolloutComponent `json:"components,omitempty"`
 
+	// Specifies the target shardings to be rolled out.
+	//
+	// +kubebuilder:validation:MinItems=1
+	// +kubebuilder:validation:MaxItems=128
+	// +optional
+	Shardings []RolloutSharding `json:"shardings,omitempty"`
+
 	// TODO: auto-reclaim the successful rollouts.
 }
 
@@ -104,6 +111,11 @@ type RolloutStatus struct {
 	//
 	// +optional
 	Components []RolloutComponentStatus `json:"components,omitempty"`
+
+	// Records the status information of all shardings within the Rollout.
+	//
+	// +optional
+	Shardings []RolloutShardingStatus `json:"shardings,omitempty"`
 }
 
 type RolloutComponent struct {
@@ -142,6 +154,43 @@ type RolloutComponent struct {
 	InstanceMeta *RolloutInstanceMeta `json:"instanceMeta,omitempty"`
 }
 
+type RolloutSharding struct {
+	// Specifies the name of the sharding.
+	//
+	// +kubebuilder:validation:Required
+	// +kubebuilder:validation:MaxLength=22
+	// +kubebuilder:validation:Pattern:=`^[a-z]([a-z0-9\-]*[a-z0-9])?$`
+	Name string `json:"name"`
+
+	// Specifies the target ShardingDefinition of the sharding.
+	//
+	// +kubebuilder:validation:MaxLength=32
+	// +optional
+	ShardingDef *string `json:"shardingDef,omitempty"`
+
+	// Specifies the target ServiceVersion of the sharding.
+	//
+	// +kubebuilder:validation:MaxLength=32
+	// +optional
+	ServiceVersion *string `json:"serviceVersion,omitempty"`
+
+	// Specifies the target ComponentDefinition of the sharding.
+	//
+	// +kubebuilder:validation:MaxLength=64
+	// +optional
+	CompDef *string `json:"compDef,omitempty"`
+
+	// Specifies the rollout strategy for the sharding.
+	//
+	// +kubebuilder:validation:Required
+	Strategy RolloutStrategy `json:"strategy"`
+
+	// Additional meta for the instances.
+	//
+	// +optional
+	InstanceMeta *RolloutInstanceMeta `json:"instanceMeta,omitempty"`
+}
+
 type RolloutStrategy struct {
 	// In-place rollout strategy.
 	//
@@ -329,3 +378,60 @@ type RolloutComponentStatus struct {
 	// +optional
 	LastScaleDownTimestamp metav1.Time `json:"lastScaleDownTimestamp,omitempty"`
 }
+
+type RolloutShardingStatus struct {
+	// The name of the sharding.
+	//
+	// +kubebuilder:validation:Required
+	Name string `json:"name"`
+
+	// The ShardingDefinition of the sharding before the rollout.
+	//
+	// optional
+	ShardingDef string `json:"shardingDef"`
+
+	// The ServiceVersion of the sharding before the rollout.
+	//
+	// +kubebuilder:validation:Required
+	ServiceVersion string `json:"serviceVersion"`
+
+	// The ComponentDefinition of the sharding before the rollout.
+	//
+	// +kubebuilder:validation:Required
+	CompDef string `json:"compDef"`
+
+	// The replicas the sharding has before the rollout.
+	//
+	// +kubebuilder:validation:Required
+	Replicas int32 `json:"replicas"`
+
+	// The new replicas the sharding has been created successfully.
+	//
+	// +optional
+	NewReplicas int32 `json:"newReplicas"`
+
+	// The replicas the sharding has been rolled out successfully.
+	//
+	// +optional
+	RolledOutReplicas int32 `json:"rolledOutReplicas"`
+
+	// The number of canary replicas the sharding has.
+	//
+	// +optional
+	CanaryReplicas int32 `json:"canaryReplicas"`
+
+	// The instances that are scaled down.
+	//
+	// +optional
+	ScaleDownInstances []string `json:"scaleDownInstances,omitempty"`
+
+	// The last time a sharding replica was scaled up successfully.
+	//
+	// +optional
+	LastScaleUpTimestamp metav1.Time `json:"lastScaleUpTimestamp,omitempty"`
+
+	// The last time a sharding replica was scaled down successfully.
+	//
+	// +optional
+	LastScaleDownTimestamp metav1.Time `json:"lastScaleDownTimestamp,omitempty"`
+}
diff --git a/apis/apps/v1alpha1/zz_generated.deepcopy.go b/apis/apps/v1alpha1/zz_generated.deepcopy.go
index dd0062cec..b6d89599f 100644
--- a/apis/apps/v1alpha1/zz_generated.deepcopy.go
+++ b/apis/apps/v1alpha1/zz_generated.deepcopy.go
@@ -3801,6 +3801,64 @@ func (in *RolloutPromotion) DeepCopy() *RolloutPromotion {
 	return out
 }
 
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RolloutSharding) DeepCopyInto(out *RolloutSharding) {
+	*out = *in
+	if in.ShardingDef != nil {
+		in, out := &in.ShardingDef, &out.ShardingDef
+		*out = new(string)
+		**out = **in
+	}
+	if in.ServiceVersion != nil {
+		in, out := &in.ServiceVersion, &out.ServiceVersion
+		*out = new(string)
+		**out = **in
+	}
+	if in.CompDef != nil {
+		in, out := &in.CompDef, &out.CompDef
+		*out = new(string)
+		**out = **in
+	}
+	in.Strategy.DeepCopyInto(&out.Strategy)
+	if in.InstanceMeta != nil {
+		in, out := &in.InstanceMeta, &out.InstanceMeta
+		*out = new(RolloutInstanceMeta)
+		(*in).DeepCopyInto(*out)
+	}
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutSharding.
+func (in *RolloutSharding) DeepCopy() *RolloutSharding {
+	if in == nil {
+		return nil
+	}
+	out := new(RolloutSharding)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RolloutShardingStatus) DeepCopyInto(out *RolloutShardingStatus) {
+	*out = *in
+	if in.ScaleDownInstances != nil {
+		in, out := &in.ScaleDownInstances, &out.ScaleDownInstances
+		*out = make([]string, len(*in))
+		copy(*out, *in)
+	}
+	in.LastScaleUpTimestamp.DeepCopyInto(&out.LastScaleUpTimestamp)
+	in.LastScaleDownTimestamp.DeepCopyInto(&out.LastScaleDownTimestamp)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutShardingStatus.
+func (in *RolloutShardingStatus) DeepCopy() *RolloutShardingStatus {
+	if in == nil {
+		return nil
+	}
+	out := new(RolloutShardingStatus)
+	in.DeepCopyInto(out)
+	return out
+}
+
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *RolloutSpec) DeepCopyInto(out *RolloutSpec) {
 	*out = *in
@@ -3811,6 +3869,13 @@ func (in *RolloutSpec) DeepCopyInto(out *RolloutSpec) {
 			(*in)[i].DeepCopyInto(&(*out)[i])
 		}
 	}
+	if in.Shardings != nil {
+		in, out := &in.Shardings, &out.Shardings
+		*out = make([]RolloutSharding, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutSpec.
@@ -3840,6 +3905,13 @@ func (in *RolloutStatus) DeepCopyInto(out *RolloutStatus) {
 			(*in)[i].DeepCopyInto(&(*out)[i])
 		}
 	}
+	if in.Shardings != nil {
+		in, out := &in.Shardings, &out.Shardings
+		*out = make([]RolloutShardingStatus, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStatus.
diff --git a/config/crd/bases/apps.kubeblocks.io_rollouts.yaml b/config/crd/bases/apps.kubeblocks.io_rollouts.yaml
index 31bf8e767..dd923a11e 100644
--- a/config/crd/bases/apps.kubeblocks.io_rollouts.yaml
+++ b/config/crd/bases/apps.kubeblocks.io_rollouts.yaml
@@ -3076,6 +3076,3063 @@ spec:
                                           - Ignore: node taints are ignored. All nodes are included.
 
 
+                                          If this value is nil, the behavior is equivalent to the Ignore policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      topologyKey:
+                                        description: |-
+                                          TopologyKey is the key of node labels. Nodes that have a label with this key
+                                          and identical values are considered to be in the same topology.
+                                          We consider each <key, value> as a "bucket", and try to put balanced number
+                                          of pods into each bucket.
+                                          We define a domain as a particular instance of a topology.
+                                          Also, we define an eligible domain as a domain whose nodes meet the requirements of
+                                          nodeAffinityPolicy and nodeTaintsPolicy.
+                                          e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
+                                          And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
+                                          It's a required field.
+                                        type: string
+                                      whenUnsatisfiable:
+                                        description: |-
+                                          WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
+                                          the spread constraint.
+                                          - DoNotSchedule (default) tells the scheduler not to schedule it.
+                                          - ScheduleAnyway tells the scheduler to schedule the pod in any location,
+                                            but giving higher precedence to topologies that would help reduce the
+                                            skew.
+                                          A constraint is considered "Unsatisfiable" for an incoming pod
+                                          if and only if every possible node assignment for that pod would violate
+                                          "MaxSkew" on some topology.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 3/1/1:
+                                          | zone1 | zone2 | zone3 |
+                                          | P P P |   P   |   P   |
+                                          If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
+                                          to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
+                                          MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
+                                          won't make it *more* imbalanced.
+                                          It's a required field.
+                                        type: string
+                                    required:
+                                    - maxSkew
+                                    - topologyKey
+                                    - whenUnsatisfiable
+                                    type: object
+                                  type: array
+                              type: object
+                          type: object
+                      type: object
+                  required:
+                  - name
+                  - strategy
+                  type: object
+                maxItems: 128
+                minItems: 1
+                type: array
+              shardings:
+                description: Specifies the target shardings to be rolled out.
+                items:
+                  properties:
+                    compDef:
+                      description: Specifies the target ComponentDefinition of the
+                        sharding.
+                      maxLength: 64
+                      type: string
+                    instanceMeta:
+                      description: Additional meta for the instances.
+                      properties:
+                        canary:
+                          description: Meta added to the new instances.
+                          properties:
+                            annotations:
+                              additionalProperties:
+                                type: string
+                              type: object
+                            labels:
+                              additionalProperties:
+                                type: string
+                              type: object
+                          type: object
+                      type: object
+                    name:
+                      description: Specifies the name of the sharding.
+                      maxLength: 22
+                      pattern: ^[a-z]([a-z0-9\-]*[a-z0-9])?$
+                      type: string
+                    serviceVersion:
+                      description: Specifies the target ServiceVersion of the sharding.
+                      maxLength: 32
+                      type: string
+                    shardingDef:
+                      description: Specifies the target ShardingDefinition of the
+                        sharding.
+                      maxLength: 32
+                      type: string
+                    strategy:
+                      description: Specifies the rollout strategy for the sharding.
+                      properties:
+                        create:
+                          description: |-
+                            Create rollout strategy.
+
+
+                            If specified, the rollout will be performed by creating new instances.
+                          properties:
+                            canary:
+                              description: Whether to decorate the new instances as
+                                canary instances.
+                              type: boolean
+                            promotion:
+                              description: Specifies the promotion strategy for the
+                                component.
+                              properties:
+                                auto:
+                                  description: Specifies whether to automatically
+                                    promote the new instances.
+                                  type: boolean
+                                condition:
+                                  description: The condition for promoting the new
+                                    instances.
+                                  properties:
+                                    post:
+                                      description: The condition after promoting the
+                                        new instances successfully.
+                                      properties:
+                                        exec:
+                                          description: |-
+                                            Defines the command to run.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            args:
+                                              description: Args represents the arguments
+                                                that are passed to the `command` for
+                                                execution.
+                                              items:
+                                                type: string
+                                              type: array
+                                            command:
+                                              description: |-
+                                                Specifies the command to be executed inside the container.
+                                                The working directory for this command is the container's root directory('/').
+                                                Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
+                                                If the shell is required, it must be explicitly invoked in the command.
+
+
+                                                A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
+                                              items:
+                                                type: string
+                                              type: array
+                                            container:
+                                              description: |-
+                                                Specifies the name of the container within the same pod whose resources will be shared with the action.
+                                                This allows the action to utilize the specified container's resources without executing within it.
+
+
+                                                The name must match one of the containers defined in `componentDefinition.spec.runtime`.
+
+
+                                                The resources that can be shared are included:
+
+
+                                                - volume mounts
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            env:
+                                              description: |-
+                                                Represents a list of environment variables that will be injected into the container.
+                                                These variables enable the container to adapt its behavior based on the environment it's running in.
+
+
+                                                This field cannot be updated.
+                                              items:
+                                                description: EnvVar represents an
+                                                  environment variable present in
+                                                  a Container.
+                                                properties:
+                                                  name:
+                                                    description: Name of the environment
+                                                      variable. Must be a C_IDENTIFIER.
+                                                    type: string
+                                                  value:
+                                                    description: |-
+                                                      Variable references $(VAR_NAME) are expanded
+                                                      using the previously defined environment variables in the container and
+                                                      any service environment variables. If a variable cannot be resolved,
+                                                      the reference in the input string will be unchanged. Double $$ are reduced
+                                                      to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
+                                                      "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
+                                                      Escaped references will never be expanded, regardless of whether the variable
+                                                      exists or not.
+                                                      Defaults to "".
+                                                    type: string
+                                                  valueFrom:
+                                                    description: Source for the environment
+                                                      variable's value. Cannot be
+                                                      used if value is not empty.
+                                                    properties:
+                                                      configMapKeyRef:
+                                                        description: Selects a key
+                                                          of a ConfigMap.
+                                                        properties:
+                                                          key:
+                                                            description: The key to
+                                                              select.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the ConfigMap or its
+                                                              key must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      fieldRef:
+                                                        description: |-
+                                                          Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
+                                                          spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+                                                        properties:
+                                                          apiVersion:
+                                                            description: Version of
+                                                              the schema the FieldPath
+                                                              is written in terms
+                                                              of, defaults to "v1".
+                                                            type: string
+                                                          fieldPath:
+                                                            description: Path of the
+                                                              field to select in the
+                                                              specified API version.
+                                                            type: string
+                                                        required:
+                                                        - fieldPath
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      resourceFieldRef:
+                                                        description: |-
+                                                          Selects a resource of the container: only resources limits and requests
+                                                          (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+                                                        properties:
+                                                          containerName:
+                                                            description: 'Container
+                                                              name: required for volumes,
+                                                              optional for env vars'
+                                                            type: string
+                                                          divisor:
+                                                            anyOf:
+                                                            - type: integer
+                                                            - type: string
+                                                            description: Specifies
+                                                              the output format of
+                                                              the exposed resources,
+                                                              defaults to "1"
+                                                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
+                                                            x-kubernetes-int-or-string: true
+                                                          resource:
+                                                            description: 'Required:
+                                                              resource to select'
+                                                            type: string
+                                                        required:
+                                                        - resource
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      secretKeyRef:
+                                                        description: Selects a key
+                                                          of a secret in the pod's
+                                                          namespace
+                                                        properties:
+                                                          key:
+                                                            description: The key of
+                                                              the secret to select
+                                                              from.  Must be a valid
+                                                              secret key.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the Secret or its key
+                                                              must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                    type: object
+                                                required:
+                                                - name
+                                                type: object
+                                              type: array
+                                            image:
+                                              description: |-
+                                                Specifies the container image to be used for running the Action.
+
+
+                                                When specified, a dedicated container will be created using this image to execute the Action.
+                                                All actions with same image will share the same container.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            matchingKey:
+                                              description: |-
+                                                Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
+                                                The impact of this field depends on the `targetPodSelector` value:
+
+
+                                                - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
+                                                - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
+                                                  will be selected for the Action.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            targetPodSelector:
+                                              description: |-
+                                                Defines the criteria used to select the target Pod(s) for executing the Action.
+                                                This is useful when there is no default target replica identified.
+                                                It allows for precise control over which Pod(s) the Action should run in.
+
+
+                                                If not specified, the Action will be executed in the pod where the Action is triggered, such as the pod
+                                                to be removed or added; or a random pod if the Action is triggered at the component level, such as
+                                                post-provision or pre-terminate of the component.
+
+
+                                                This field cannot be updated.
+                                              enum:
+                                              - Any
+                                              - All
+                                              - Role
+                                              - Ordinal
+                                              type: string
+                                          type: object
+                                        preCondition:
+                                          description: |-
+                                            Specifies the state that the cluster must reach before the Action is executed.
+                                            Currently, this is only applicable to the `postProvision` action.
+
+
+                                            The conditions are as follows:
+
+
+                                            - `Immediately`: Executed right after the Component object is created.
+                                              The readiness of the Component and its resources is not guaranteed at this stage.
+                                            - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
+                                              runtime resources (e.g. Pods) are in a ready state.
+                                            - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
+                                              This process does not affect the readiness state of the Component or the Cluster.
+                                            - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
+                                              This execution does not alter the Component or the Cluster's state of readiness.
+
+
+                                            This field cannot be updated.
+                                          type: string
+                                        retryPolicy:
+                                          description: |-
+                                            Defines the strategy to be taken when retrying the Action after a failure.
+
+
+                                            It specifies the conditions under which the Action should be retried and the limits to apply,
+                                            such as the maximum number of retries and backoff strategy.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            maxRetries:
+                                              default: 0
+                                              description: |-
+                                                Defines the maximum number of retry attempts that should be made for a given Action.
+                                                This value is set to 0 by default, indicating that no retries will be made.
+                                              type: integer
+                                            retryInterval:
+                                              default: 0
+                                              description: |-
+                                                Indicates the duration of time to wait between each retry attempt.
+                                                This value is set to 0 by default, indicating that there will be no delay between retry attempts.
+                                              format: int64
+                                              type: integer
+                                          type: object
+                                        timeoutSeconds:
+                                          default: 0
+                                          description: |-
+                                            Specifies the maximum duration in seconds that the Action is allowed to run.
+
+
+                                            If the Action does not complete within this time frame, it will be terminated.
+
+
+                                            This field cannot be updated.
+                                          format: int32
+                                          type: integer
+                                      type: object
+                                    prev:
+                                      description: |-
+                                        The condition before promoting the new instances.
+
+
+                                        If specified, the new instances will be promoted only when the condition is met.
+                                      properties:
+                                        exec:
+                                          description: |-
+                                            Defines the command to run.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            args:
+                                              description: Args represents the arguments
+                                                that are passed to the `command` for
+                                                execution.
+                                              items:
+                                                type: string
+                                              type: array
+                                            command:
+                                              description: |-
+                                                Specifies the command to be executed inside the container.
+                                                The working directory for this command is the container's root directory('/').
+                                                Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
+                                                If the shell is required, it must be explicitly invoked in the command.
+
+
+                                                A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
+                                              items:
+                                                type: string
+                                              type: array
+                                            container:
+                                              description: |-
+                                                Specifies the name of the container within the same pod whose resources will be shared with the action.
+                                                This allows the action to utilize the specified container's resources without executing within it.
+
+
+                                                The name must match one of the containers defined in `componentDefinition.spec.runtime`.
+
+
+                                                The resources that can be shared are included:
+
+
+                                                - volume mounts
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            env:
+                                              description: |-
+                                                Represents a list of environment variables that will be injected into the container.
+                                                These variables enable the container to adapt its behavior based on the environment it's running in.
+
+
+                                                This field cannot be updated.
+                                              items:
+                                                description: EnvVar represents an
+                                                  environment variable present in
+                                                  a Container.
+                                                properties:
+                                                  name:
+                                                    description: Name of the environment
+                                                      variable. Must be a C_IDENTIFIER.
+                                                    type: string
+                                                  value:
+                                                    description: |-
+                                                      Variable references $(VAR_NAME) are expanded
+                                                      using the previously defined environment variables in the container and
+                                                      any service environment variables. If a variable cannot be resolved,
+                                                      the reference in the input string will be unchanged. Double $$ are reduced
+                                                      to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
+                                                      "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
+                                                      Escaped references will never be expanded, regardless of whether the variable
+                                                      exists or not.
+                                                      Defaults to "".
+                                                    type: string
+                                                  valueFrom:
+                                                    description: Source for the environment
+                                                      variable's value. Cannot be
+                                                      used if value is not empty.
+                                                    properties:
+                                                      configMapKeyRef:
+                                                        description: Selects a key
+                                                          of a ConfigMap.
+                                                        properties:
+                                                          key:
+                                                            description: The key to
+                                                              select.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the ConfigMap or its
+                                                              key must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      fieldRef:
+                                                        description: |-
+                                                          Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
+                                                          spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+                                                        properties:
+                                                          apiVersion:
+                                                            description: Version of
+                                                              the schema the FieldPath
+                                                              is written in terms
+                                                              of, defaults to "v1".
+                                                            type: string
+                                                          fieldPath:
+                                                            description: Path of the
+                                                              field to select in the
+                                                              specified API version.
+                                                            type: string
+                                                        required:
+                                                        - fieldPath
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      resourceFieldRef:
+                                                        description: |-
+                                                          Selects a resource of the container: only resources limits and requests
+                                                          (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+                                                        properties:
+                                                          containerName:
+                                                            description: 'Container
+                                                              name: required for volumes,
+                                                              optional for env vars'
+                                                            type: string
+                                                          divisor:
+                                                            anyOf:
+                                                            - type: integer
+                                                            - type: string
+                                                            description: Specifies
+                                                              the output format of
+                                                              the exposed resources,
+                                                              defaults to "1"
+                                                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
+                                                            x-kubernetes-int-or-string: true
+                                                          resource:
+                                                            description: 'Required:
+                                                              resource to select'
+                                                            type: string
+                                                        required:
+                                                        - resource
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      secretKeyRef:
+                                                        description: Selects a key
+                                                          of a secret in the pod's
+                                                          namespace
+                                                        properties:
+                                                          key:
+                                                            description: The key of
+                                                              the secret to select
+                                                              from.  Must be a valid
+                                                              secret key.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the Secret or its key
+                                                              must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                    type: object
+                                                required:
+                                                - name
+                                                type: object
+                                              type: array
+                                            image:
+                                              description: |-
+                                                Specifies the container image to be used for running the Action.
+
+
+                                                When specified, a dedicated container will be created using this image to execute the Action.
+                                                All actions with same image will share the same container.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            matchingKey:
+                                              description: |-
+                                                Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
+                                                The impact of this field depends on the `targetPodSelector` value:
+
+
+                                                - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
+                                                - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
+                                                  will be selected for the Action.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            targetPodSelector:
+                                              description: |-
+                                                Defines the criteria used to select the target Pod(s) for executing the Action.
+                                                This is useful when there is no default target replica identified.
+                                                It allows for precise control over which Pod(s) the Action should run in.
+
+
+                                                If not specified, the Action will be executed in the pod where the Action is triggered, such as the pod
+                                                to be removed or added; or a random pod if the Action is triggered at the component level, such as
+                                                post-provision or pre-terminate of the component.
+
+
+                                                This field cannot be updated.
+                                              enum:
+                                              - Any
+                                              - All
+                                              - Role
+                                              - Ordinal
+                                              type: string
+                                          type: object
+                                        preCondition:
+                                          description: |-
+                                            Specifies the state that the cluster must reach before the Action is executed.
+                                            Currently, this is only applicable to the `postProvision` action.
+
+
+                                            The conditions are as follows:
+
+
+                                            - `Immediately`: Executed right after the Component object is created.
+                                              The readiness of the Component and its resources is not guaranteed at this stage.
+                                            - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
+                                              runtime resources (e.g. Pods) are in a ready state.
+                                            - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
+                                              This process does not affect the readiness state of the Component or the Cluster.
+                                            - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
+                                              This execution does not alter the Component or the Cluster's state of readiness.
+
+
+                                            This field cannot be updated.
+                                          type: string
+                                        retryPolicy:
+                                          description: |-
+                                            Defines the strategy to be taken when retrying the Action after a failure.
+
+
+                                            It specifies the conditions under which the Action should be retried and the limits to apply,
+                                            such as the maximum number of retries and backoff strategy.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            maxRetries:
+                                              default: 0
+                                              description: |-
+                                                Defines the maximum number of retry attempts that should be made for a given Action.
+                                                This value is set to 0 by default, indicating that no retries will be made.
+                                              type: integer
+                                            retryInterval:
+                                              default: 0
+                                              description: |-
+                                                Indicates the duration of time to wait between each retry attempt.
+                                                This value is set to 0 by default, indicating that there will be no delay between retry attempts.
+                                              format: int64
+                                              type: integer
+                                          type: object
+                                        timeoutSeconds:
+                                          default: 0
+                                          description: |-
+                                            Specifies the maximum duration in seconds that the Action is allowed to run.
+
+
+                                            If the Action does not complete within this time frame, it will be terminated.
+
+
+                                            This field cannot be updated.
+                                          format: int32
+                                          type: integer
+                                      type: object
+                                  type: object
+                                delaySeconds:
+                                  default: 30
+                                  description: The delay seconds before promoting
+                                    the new instances.
+                                  format: int32
+                                  type: integer
+                                scaleDownDelaySeconds:
+                                  default: 30
+                                  description: The delay seconds before scaling down
+                                    the old instances.
+                                  format: int32
+                                  type: integer
+                              type: object
+                            schedulingPolicy:
+                              description: Specifies the scheduling policy for the
+                                new instance.
+                              properties:
+                                affinity:
+                                  description: Specifies a group of affinity scheduling
+                                    rules of the Cluster, including NodeAffinity,
+                                    PodAffinity, and PodAntiAffinity.
+                                  properties:
+                                    nodeAffinity:
+                                      description: Describes node affinity scheduling
+                                        rules for the pod.
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node matches the corresponding matchExpressions; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: |-
+                                              An empty preferred scheduling term matches all objects with implicit weight 0
+                                              (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
+                                            properties:
+                                              preference:
+                                                description: A node selector term,
+                                                  associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              weight:
+                                                description: Weight associated with
+                                                  matching the corresponding nodeSelectorTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - preference
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to an update), the system
+                                            may or may not try to eventually evict the pod from its node.
+                                          properties:
+                                            nodeSelectorTerms:
+                                              description: Required. A list of node
+                                                selector terms. The terms are ORed.
+                                              items:
+                                                description: |-
+                                                  A null or empty node selector term matches no objects. The requirements of
+                                                  them are ANDed.
+                                                  The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              type: array
+                                          required:
+                                          - nodeSelectorTerms
+                                          type: object
+                                          x-kubernetes-map-type: atomic
+                                      type: object
+                                    podAffinity:
+                                      description: Describes pod affinity scheduling
+                                        rules (e.g. co-locate this pod in the same
+                                        node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                    podAntiAffinity:
+                                      description: Describes pod anti-affinity scheduling
+                                        rules (e.g. avoid putting this pod in the
+                                        same node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the anti-affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling anti-affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the anti-affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the anti-affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                  type: object
+                                nodeName:
+                                  description: |-
+                                    NodeName is a request to schedule this Pod onto a specific node. If it is non-empty,
+                                    the scheduler simply schedules this Pod onto that node, assuming that it fits resource
+                                    requirements.
+                                  type: string
+                                nodeSelector:
+                                  additionalProperties:
+                                    type: string
+                                  description: |-
+                                    NodeSelector is a selector which must be true for the Pod to fit on a node.
+                                    Selector which must match a node's labels for the Pod to be scheduled on that node.
+                                    More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+                                  type: object
+                                  x-kubernetes-map-type: atomic
+                                schedulerName:
+                                  description: |-
+                                    If specified, the Pod will be dispatched by specified scheduler.
+                                    If not specified, the Pod will be dispatched by default scheduler.
+                                  type: string
+                                tolerations:
+                                  description: |-
+                                    Allows Pods to be scheduled onto nodes with matching taints.
+                                    Each toleration in the array allows the Pod to tolerate node taints based on
+                                    specified `key`, `value`, `effect`, and `operator`.
+
+
+                                    - The `key`, `value`, and `effect` identify the taint that the toleration matches.
+                                    - The `operator` determines how the toleration matches the taint.
+
+
+                                    Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes.
+                                  items:
+                                    description: |-
+                                      The pod this Toleration is attached to tolerates any taint that matches
+                                      the triple <key,value,effect> using the matching operator <operator>.
+                                    properties:
+                                      effect:
+                                        description: |-
+                                          Effect indicates the taint effect to match. Empty means match all taint effects.
+                                          When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
+                                        type: string
+                                      key:
+                                        description: |-
+                                          Key is the taint key that the toleration applies to. Empty means match all taint keys.
+                                          If the key is empty, operator must be Exists; this combination means to match all values and all keys.
+                                        type: string
+                                      operator:
+                                        description: |-
+                                          Operator represents a key's relationship to the value.
+                                          Valid operators are Exists and Equal. Defaults to Equal.
+                                          Exists is equivalent to wildcard for value, so that a pod can
+                                          tolerate all taints of a particular category.
+                                        type: string
+                                      tolerationSeconds:
+                                        description: |-
+                                          TolerationSeconds represents the period of time the toleration (which must be
+                                          of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
+                                          it is not set, which means tolerate the taint forever (do not evict). Zero and
+                                          negative values will be treated as 0 (evict immediately) by the system.
+                                        format: int64
+                                        type: integer
+                                      value:
+                                        description: |-
+                                          Value is the taint value the toleration matches to.
+                                          If the operator is Exists, the value should be empty, otherwise just a regular string.
+                                        type: string
+                                    type: object
+                                  type: array
+                                topologySpreadConstraints:
+                                  description: |-
+                                    TopologySpreadConstraints describes how a group of Pods ought to spread across topology
+                                    domains. Scheduler will schedule Pods in a way which abides by the constraints.
+                                    All topologySpreadConstraints are ANDed.
+                                  items:
+                                    description: TopologySpreadConstraint specifies
+                                      how to spread matching pods among the given
+                                      topology.
+                                    properties:
+                                      labelSelector:
+                                        description: |-
+                                          LabelSelector is used to find matching pods.
+                                          Pods that match this label selector are counted to determine the number of pods
+                                          in their corresponding topology domain.
+                                        properties:
+                                          matchExpressions:
+                                            description: matchExpressions is a list
+                                              of label selector requirements. The
+                                              requirements are ANDed.
+                                            items:
+                                              description: |-
+                                                A label selector requirement is a selector that contains values, a key, and an operator that
+                                                relates the key and values.
+                                              properties:
+                                                key:
+                                                  description: key is the label key
+                                                    that the selector applies to.
+                                                  type: string
+                                                operator:
+                                                  description: |-
+                                                    operator represents a key's relationship to a set of values.
+                                                    Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                  type: string
+                                                values:
+                                                  description: |-
+                                                    values is an array of string values. If the operator is In or NotIn,
+                                                    the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                    the values array must be empty. This array is replaced during a strategic
+                                                    merge patch.
+                                                  items:
+                                                    type: string
+                                                  type: array
+                                              required:
+                                              - key
+                                              - operator
+                                              type: object
+                                            type: array
+                                          matchLabels:
+                                            additionalProperties:
+                                              type: string
+                                            description: |-
+                                              matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                              map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                              operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                            type: object
+                                        type: object
+                                        x-kubernetes-map-type: atomic
+                                      matchLabelKeys:
+                                        description: |-
+                                          MatchLabelKeys is a set of pod label keys to select the pods over which
+                                          spreading will be calculated. The keys are used to lookup values from the
+                                          incoming pod labels, those key-value labels are ANDed with labelSelector
+                                          to select the group of existing pods over which spreading will be calculated
+                                          for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                          MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                          Keys that don't exist in the incoming pod labels will
+                                          be ignored. A null or empty list means only match against labelSelector.
+
+
+                                          This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        items:
+                                          type: string
+                                        type: array
+                                        x-kubernetes-list-type: atomic
+                                      maxSkew:
+                                        description: |-
+                                          MaxSkew describes the degree to which pods may be unevenly distributed.
+                                          When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
+                                          between the number of matching pods in the target topology and the global minimum.
+                                          The global minimum is the minimum number of matching pods in an eligible domain
+                                          or zero if the number of eligible domains is less than MinDomains.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 2/2/1:
+                                          In this case, the global minimum is 1.
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |   P   |
+                                          - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
+                                          scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
+                                          violate MaxSkew(1).
+                                          - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
+                                          When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
+                                          to topologies that satisfy it.
+                                          It's a required field. Default value is 1 and 0 is not allowed.
+                                        format: int32
+                                        type: integer
+                                      minDomains:
+                                        description: |-
+                                          MinDomains indicates a minimum number of eligible domains.
+                                          When the number of eligible domains with matching topology keys is less than minDomains,
+                                          Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
+                                          And when the number of eligible domains with matching topology keys equals or greater than minDomains,
+                                          this value has no effect on scheduling.
+                                          As a result, when the number of eligible domains is less than minDomains,
+                                          scheduler won't schedule more than maxSkew Pods to those domains.
+                                          If value is nil, the constraint behaves as if MinDomains is equal to 1.
+                                          Valid values are integers greater than 0.
+                                          When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
+
+
+                                          For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
+                                          labelSelector spread as 2/2/2:
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |  P P  |
+                                          The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
+                                          In this situation, new pod with the same labelSelector cannot be scheduled,
+                                          because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
+                                          it will violate MaxSkew.
+
+
+                                          This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        format: int32
+                                        type: integer
+                                      nodeAffinityPolicy:
+                                        description: |-
+                                          NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
+                                          when calculating pod topology spread skew. Options are:
+                                          - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
+                                          - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
+
+
+                                          If this value is nil, the behavior is equivalent to the Honor policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      nodeTaintsPolicy:
+                                        description: |-
+                                          NodeTaintsPolicy indicates how we will treat node taints when calculating
+                                          pod topology spread skew. Options are:
+                                          - Honor: nodes without taints, along with tainted nodes for which the incoming pod
+                                          has a toleration, are included.
+                                          - Ignore: node taints are ignored. All nodes are included.
+
+
+                                          If this value is nil, the behavior is equivalent to the Ignore policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      topologyKey:
+                                        description: |-
+                                          TopologyKey is the key of node labels. Nodes that have a label with this key
+                                          and identical values are considered to be in the same topology.
+                                          We consider each <key, value> as a "bucket", and try to put balanced number
+                                          of pods into each bucket.
+                                          We define a domain as a particular instance of a topology.
+                                          Also, we define an eligible domain as a domain whose nodes meet the requirements of
+                                          nodeAffinityPolicy and nodeTaintsPolicy.
+                                          e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
+                                          And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
+                                          It's a required field.
+                                        type: string
+                                      whenUnsatisfiable:
+                                        description: |-
+                                          WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
+                                          the spread constraint.
+                                          - DoNotSchedule (default) tells the scheduler not to schedule it.
+                                          - ScheduleAnyway tells the scheduler to schedule the pod in any location,
+                                            but giving higher precedence to topologies that would help reduce the
+                                            skew.
+                                          A constraint is considered "Unsatisfiable" for an incoming pod
+                                          if and only if every possible node assignment for that pod would violate
+                                          "MaxSkew" on some topology.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 3/1/1:
+                                          | zone1 | zone2 | zone3 |
+                                          | P P P |   P   |   P   |
+                                          If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
+                                          to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
+                                          MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
+                                          won't make it *more* imbalanced.
+                                          It's a required field.
+                                        type: string
+                                    required:
+                                    - maxSkew
+                                    - topologyKey
+                                    - whenUnsatisfiable
+                                    type: object
+                                  type: array
+                              type: object
+                          type: object
+                        inplace:
+                          description: |-
+                            In-place rollout strategy.
+
+
+                            If specified, the rollout will be performed in-place (delete and then create).
+                          type: object
+                        replace:
+                          description: |-
+                            Replace rollout strategy.
+
+
+                            If specified, the rollout will be performed by replacing the old instances with new instances one by one (create and then delete).
+                          properties:
+                            perInstanceIntervalSeconds:
+                              description: The number of seconds to wait between rolling
+                                out two instances.
+                              format: int32
+                              type: integer
+                            scaleDownDelaySeconds:
+                              description: The number of seconds to wait before scaling
+                                down an old instance, after the new instance becomes
+                                ready.
+                              format: int32
+                              type: integer
+                            schedulingPolicy:
+                              description: Specifies the scheduling policy for the
+                                new instance.
+                              properties:
+                                affinity:
+                                  description: Specifies a group of affinity scheduling
+                                    rules of the Cluster, including NodeAffinity,
+                                    PodAffinity, and PodAntiAffinity.
+                                  properties:
+                                    nodeAffinity:
+                                      description: Describes node affinity scheduling
+                                        rules for the pod.
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node matches the corresponding matchExpressions; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: |-
+                                              An empty preferred scheduling term matches all objects with implicit weight 0
+                                              (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
+                                            properties:
+                                              preference:
+                                                description: A node selector term,
+                                                  associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              weight:
+                                                description: Weight associated with
+                                                  matching the corresponding nodeSelectorTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - preference
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to an update), the system
+                                            may or may not try to eventually evict the pod from its node.
+                                          properties:
+                                            nodeSelectorTerms:
+                                              description: Required. A list of node
+                                                selector terms. The terms are ORed.
+                                              items:
+                                                description: |-
+                                                  A null or empty node selector term matches no objects. The requirements of
+                                                  them are ANDed.
+                                                  The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              type: array
+                                          required:
+                                          - nodeSelectorTerms
+                                          type: object
+                                          x-kubernetes-map-type: atomic
+                                      type: object
+                                    podAffinity:
+                                      description: Describes pod affinity scheduling
+                                        rules (e.g. co-locate this pod in the same
+                                        node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                    podAntiAffinity:
+                                      description: Describes pod anti-affinity scheduling
+                                        rules (e.g. avoid putting this pod in the
+                                        same node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the anti-affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling anti-affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the anti-affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the anti-affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                  type: object
+                                nodeName:
+                                  description: |-
+                                    NodeName is a request to schedule this Pod onto a specific node. If it is non-empty,
+                                    the scheduler simply schedules this Pod onto that node, assuming that it fits resource
+                                    requirements.
+                                  type: string
+                                nodeSelector:
+                                  additionalProperties:
+                                    type: string
+                                  description: |-
+                                    NodeSelector is a selector which must be true for the Pod to fit on a node.
+                                    Selector which must match a node's labels for the Pod to be scheduled on that node.
+                                    More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+                                  type: object
+                                  x-kubernetes-map-type: atomic
+                                schedulerName:
+                                  description: |-
+                                    If specified, the Pod will be dispatched by specified scheduler.
+                                    If not specified, the Pod will be dispatched by default scheduler.
+                                  type: string
+                                tolerations:
+                                  description: |-
+                                    Allows Pods to be scheduled onto nodes with matching taints.
+                                    Each toleration in the array allows the Pod to tolerate node taints based on
+                                    specified `key`, `value`, `effect`, and `operator`.
+
+
+                                    - The `key`, `value`, and `effect` identify the taint that the toleration matches.
+                                    - The `operator` determines how the toleration matches the taint.
+
+
+                                    Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes.
+                                  items:
+                                    description: |-
+                                      The pod this Toleration is attached to tolerates any taint that matches
+                                      the triple <key,value,effect> using the matching operator <operator>.
+                                    properties:
+                                      effect:
+                                        description: |-
+                                          Effect indicates the taint effect to match. Empty means match all taint effects.
+                                          When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
+                                        type: string
+                                      key:
+                                        description: |-
+                                          Key is the taint key that the toleration applies to. Empty means match all taint keys.
+                                          If the key is empty, operator must be Exists; this combination means to match all values and all keys.
+                                        type: string
+                                      operator:
+                                        description: |-
+                                          Operator represents a key's relationship to the value.
+                                          Valid operators are Exists and Equal. Defaults to Equal.
+                                          Exists is equivalent to wildcard for value, so that a pod can
+                                          tolerate all taints of a particular category.
+                                        type: string
+                                      tolerationSeconds:
+                                        description: |-
+                                          TolerationSeconds represents the period of time the toleration (which must be
+                                          of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
+                                          it is not set, which means tolerate the taint forever (do not evict). Zero and
+                                          negative values will be treated as 0 (evict immediately) by the system.
+                                        format: int64
+                                        type: integer
+                                      value:
+                                        description: |-
+                                          Value is the taint value the toleration matches to.
+                                          If the operator is Exists, the value should be empty, otherwise just a regular string.
+                                        type: string
+                                    type: object
+                                  type: array
+                                topologySpreadConstraints:
+                                  description: |-
+                                    TopologySpreadConstraints describes how a group of Pods ought to spread across topology
+                                    domains. Scheduler will schedule Pods in a way which abides by the constraints.
+                                    All topologySpreadConstraints are ANDed.
+                                  items:
+                                    description: TopologySpreadConstraint specifies
+                                      how to spread matching pods among the given
+                                      topology.
+                                    properties:
+                                      labelSelector:
+                                        description: |-
+                                          LabelSelector is used to find matching pods.
+                                          Pods that match this label selector are counted to determine the number of pods
+                                          in their corresponding topology domain.
+                                        properties:
+                                          matchExpressions:
+                                            description: matchExpressions is a list
+                                              of label selector requirements. The
+                                              requirements are ANDed.
+                                            items:
+                                              description: |-
+                                                A label selector requirement is a selector that contains values, a key, and an operator that
+                                                relates the key and values.
+                                              properties:
+                                                key:
+                                                  description: key is the label key
+                                                    that the selector applies to.
+                                                  type: string
+                                                operator:
+                                                  description: |-
+                                                    operator represents a key's relationship to a set of values.
+                                                    Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                  type: string
+                                                values:
+                                                  description: |-
+                                                    values is an array of string values. If the operator is In or NotIn,
+                                                    the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                    the values array must be empty. This array is replaced during a strategic
+                                                    merge patch.
+                                                  items:
+                                                    type: string
+                                                  type: array
+                                              required:
+                                              - key
+                                              - operator
+                                              type: object
+                                            type: array
+                                          matchLabels:
+                                            additionalProperties:
+                                              type: string
+                                            description: |-
+                                              matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                              map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                              operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                            type: object
+                                        type: object
+                                        x-kubernetes-map-type: atomic
+                                      matchLabelKeys:
+                                        description: |-
+                                          MatchLabelKeys is a set of pod label keys to select the pods over which
+                                          spreading will be calculated. The keys are used to lookup values from the
+                                          incoming pod labels, those key-value labels are ANDed with labelSelector
+                                          to select the group of existing pods over which spreading will be calculated
+                                          for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                          MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                          Keys that don't exist in the incoming pod labels will
+                                          be ignored. A null or empty list means only match against labelSelector.
+
+
+                                          This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        items:
+                                          type: string
+                                        type: array
+                                        x-kubernetes-list-type: atomic
+                                      maxSkew:
+                                        description: |-
+                                          MaxSkew describes the degree to which pods may be unevenly distributed.
+                                          When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
+                                          between the number of matching pods in the target topology and the global minimum.
+                                          The global minimum is the minimum number of matching pods in an eligible domain
+                                          or zero if the number of eligible domains is less than MinDomains.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 2/2/1:
+                                          In this case, the global minimum is 1.
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |   P   |
+                                          - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
+                                          scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
+                                          violate MaxSkew(1).
+                                          - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
+                                          When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
+                                          to topologies that satisfy it.
+                                          It's a required field. Default value is 1 and 0 is not allowed.
+                                        format: int32
+                                        type: integer
+                                      minDomains:
+                                        description: |-
+                                          MinDomains indicates a minimum number of eligible domains.
+                                          When the number of eligible domains with matching topology keys is less than minDomains,
+                                          Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
+                                          And when the number of eligible domains with matching topology keys equals or greater than minDomains,
+                                          this value has no effect on scheduling.
+                                          As a result, when the number of eligible domains is less than minDomains,
+                                          scheduler won't schedule more than maxSkew Pods to those domains.
+                                          If value is nil, the constraint behaves as if MinDomains is equal to 1.
+                                          Valid values are integers greater than 0.
+                                          When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
+
+
+                                          For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
+                                          labelSelector spread as 2/2/2:
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |  P P  |
+                                          The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
+                                          In this situation, new pod with the same labelSelector cannot be scheduled,
+                                          because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
+                                          it will violate MaxSkew.
+
+
+                                          This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        format: int32
+                                        type: integer
+                                      nodeAffinityPolicy:
+                                        description: |-
+                                          NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
+                                          when calculating pod topology spread skew. Options are:
+                                          - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
+                                          - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
+
+
+                                          If this value is nil, the behavior is equivalent to the Honor policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      nodeTaintsPolicy:
+                                        description: |-
+                                          NodeTaintsPolicy indicates how we will treat node taints when calculating
+                                          pod topology spread skew. Options are:
+                                          - Honor: nodes without taints, along with tainted nodes for which the incoming pod
+                                          has a toleration, are included.
+                                          - Ignore: node taints are ignored. All nodes are included.
+
+
                                           If this value is nil, the behavior is equivalent to the Ignore policy.
                                           This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
                                         type: string
@@ -3269,6 +6326,68 @@ spec:
                   that has been observed by the controller.
                 format: int64
                 type: integer
+              shardings:
+                description: Records the status information of all shardings within
+                  the Rollout.
+                items:
+                  properties:
+                    canaryReplicas:
+                      description: The number of canary replicas the sharding has.
+                      format: int32
+                      type: integer
+                    compDef:
+                      description: The ComponentDefinition of the sharding before
+                        the rollout.
+                      type: string
+                    lastScaleDownTimestamp:
+                      description: The last time a sharding replica was scaled down
+                        successfully.
+                      format: date-time
+                      type: string
+                    lastScaleUpTimestamp:
+                      description: The last time a sharding replica was scaled up
+                        successfully.
+                      format: date-time
+                      type: string
+                    name:
+                      description: The name of the sharding.
+                      type: string
+                    newReplicas:
+                      description: The new replicas the sharding has been created
+                        successfully.
+                      format: int32
+                      type: integer
+                    replicas:
+                      description: The replicas the sharding has before the rollout.
+                      format: int32
+                      type: integer
+                    rolledOutReplicas:
+                      description: The replicas the sharding has been rolled out successfully.
+                      format: int32
+                      type: integer
+                    scaleDownInstances:
+                      description: The instances that are scaled down.
+                      items:
+                        type: string
+                      type: array
+                    serviceVersion:
+                      description: The ServiceVersion of the sharding before the rollout.
+                      type: string
+                    shardingDef:
+                      description: |-
+                        The ShardingDefinition of the sharding before the rollout.
+
+
+                        optional
+                      type: string
+                  required:
+                  - compDef
+                  - name
+                  - replicas
+                  - serviceVersion
+                  - shardingDef
+                  type: object
+                type: array
               state:
                 description: The current state of the Rollout.
                 enum:
diff --git a/controllers/apps/cluster/transformer_cluster_normalization.go b/controllers/apps/cluster/transformer_cluster_normalization.go
index d7171832e..53bd6e306 100644
--- a/controllers/apps/cluster/transformer_cluster_normalization.go
+++ b/controllers/apps/cluster/transformer_cluster_normalization.go
@@ -252,11 +252,19 @@ func (t *clusterNormalizationTransformer) resolveDefinitions4Sharding(transCtx *
 			spec.ServiceVersion = ptr.Deref(tpl.ServiceVersion, "")
 		}
 		for _, inst := range tpl.Instances {
-			spec.Instances = append(spec.Instances, appsv1.InstanceTemplate{
-				Name:           inst.Name,
-				CompDef:        inst.CompDef,
-				ServiceVersion: inst.ServiceVersion,
+			idx := slices.IndexFunc(spec.Instances, func(item appsv1.InstanceTemplate) bool {
+				return item.Name == inst.Name
 			})
+			if idx >= 0 {
+				spec.Instances[idx].CompDef = inst.CompDef
+				spec.Instances[idx].ServiceVersion = inst.ServiceVersion
+			} else {
+				spec.Instances = append(spec.Instances, appsv1.InstanceTemplate{
+					Name:           inst.Name,
+					CompDef:        inst.CompDef,
+					ServiceVersion: inst.ServiceVersion,
+				})
+			}
 		}
 		return shardingDefName, spec
 	}
@@ -269,9 +277,12 @@ func (t *clusterNormalizationTransformer) resolveDefinitions4Sharding(transCtx *
 		// set the componentDef and serviceVersion of template as resolved
 		tpl.CompDef = ptr.To(spec.ComponentDef)
 		tpl.ServiceVersion = ptr.To(spec.ServiceVersion)
-		for i := range spec.Instances {
-			tpl.Instances[i].CompDef = spec.Instances[i].CompDef
-			tpl.Instances[i].ServiceVersion = spec.Instances[i].ServiceVersion
+		for i, inst := range tpl.Instances {
+			idx := slices.IndexFunc(spec.Instances, func(item appsv1.InstanceTemplate) bool {
+				return item.Name == inst.Name
+			})
+			tpl.Instances[i].CompDef = spec.Instances[idx].CompDef
+			tpl.Instances[i].ServiceVersion = spec.Instances[idx].ServiceVersion
 		}
 	}
 
@@ -422,7 +433,7 @@ func (t *clusterNormalizationTransformer) resolveDefinitions4ComponentWithObj(tr
 		if len(tpl.ServiceVersion) == 0 && len(tpl.CompDef) == 0 {
 			continue
 		}
-		compDef, serviceVersion, err = t.resolveCompDefinitionNServiceVersionWithTemplate(transCtx, compSpec, comp, &tpl)
+		compDef, serviceVersion, err = t.resolveCompDefinitionNServiceVersionWithTemplate(transCtx, comp, &tpl)
 		if err != nil {
 			return nil, err
 		}
@@ -447,7 +458,7 @@ func (t *clusterNormalizationTransformer) resolveCompDefinitionNServiceVersionWi
 }
 
 func (t *clusterNormalizationTransformer) resolveCompDefinitionNServiceVersionWithTemplate(transCtx *clusterTransformContext,
-	compSpec *appsv1.ClusterComponentSpec, comp *appsv1.Component, protoTpl *appsv1.InstanceTemplate) (*appsv1.ComponentDefinition, string, error) {
+	comp *appsv1.Component, protoTpl *appsv1.InstanceTemplate) (*appsv1.ComponentDefinition, string, error) {
 	var (
 		ctx        = transCtx.Context
 		cli        = transCtx.Client
@@ -461,15 +472,8 @@ func (t *clusterNormalizationTransformer) resolveCompDefinitionNServiceVersionWi
 			}
 		}
 	}
-
-	serviceVersion := compSpec.ServiceVersion
-	if len(protoTpl.ServiceVersion) > 0 {
-		serviceVersion = protoTpl.ServiceVersion
-	}
-	compDefName := compSpec.ComponentDef
-	if len(protoTpl.CompDef) > 0 {
-		compDefName = protoTpl.CompDef
-	}
+	serviceVersion := protoTpl.ServiceVersion
+	compDefName := protoTpl.CompDef
 	if comp == nil || runningTpl == nil || t.checkTemplateUpgrade(serviceVersion, compDefName, runningTpl) {
 		return resolveCompDefinitionNServiceVersion(ctx, cli, compDefName, serviceVersion)
 	}
diff --git a/controllers/apps/rollout/rollout_plan_builder.go b/controllers/apps/rollout/rollout_plan_builder.go
index f0138f561..4d5320c4a 100644
--- a/controllers/apps/rollout/rollout_plan_builder.go
+++ b/controllers/apps/rollout/rollout_plan_builder.go
@@ -66,6 +66,7 @@ type rolloutTransformContext struct {
 	ClusterComps     map[string]*appsv1.ClusterComponentSpec
 	ClusterShardings map[string]*appsv1.ClusterSharding
 	Components       map[string]*appsv1.Component
+	ShardingComps    map[string][]*appsv1.Component
 }
 
 func (c *rolloutTransformContext) GetContext() context.Context {
diff --git a/controllers/apps/rollout/transformer_rollout_inplace.go b/controllers/apps/rollout/transformer_rollout_inplace.go
index 384ca2a70..31ac5bd98 100644
--- a/controllers/apps/rollout/transformer_rollout_inplace.go
+++ b/controllers/apps/rollout/transformer_rollout_inplace.go
@@ -48,8 +48,7 @@ func (t *rolloutInplaceTransformer) rollout(transCtx *rolloutTransformContext) e
 	if err := t.components(transCtx); err != nil {
 		return err
 	}
-	// TODO: sharding
-	return nil
+	return t.shardings(transCtx)
 }
 
 func (t *rolloutInplaceTransformer) components(transCtx *rolloutTransformContext) error {
@@ -90,9 +89,80 @@ func (t *rolloutInplaceTransformer) component(transCtx *rolloutTransformContext,
 
 	if comp.ServiceVersion != nil {
 		spec.ServiceVersion = *comp.ServiceVersion
+		for i := range spec.Instances {
+			if len(spec.Instances[i].ServiceVersion) > 0 || len(spec.Instances[i].CompDef) > 0 {
+				spec.Instances[i].ServiceVersion = *comp.ServiceVersion
+			}
+		}
 	}
 	if comp.CompDef != nil {
 		spec.ComponentDef = *comp.CompDef
+		for i := range spec.Instances {
+			if len(spec.Instances[i].ServiceVersion) > 0 || len(spec.Instances[i].CompDef) > 0 {
+				spec.Instances[i].CompDef = *comp.CompDef
+			}
+		}
+	}
+	return nil
+}
+
+func (t *rolloutInplaceTransformer) shardings(transCtx *rolloutTransformContext) error {
+	rollout := transCtx.Rollout
+	for _, sharding := range rollout.Spec.Shardings {
+		if sharding.Strategy.Inplace != nil {
+			if err := t.sharding(transCtx, sharding); err != nil {
+				return err
+			}
+		}
+	}
+	return nil
+}
+
+func (t *rolloutInplaceTransformer) sharding(transCtx *rolloutTransformContext, sharding appsv1alpha1.RolloutSharding) error {
+	spec := transCtx.ClusterShardings[sharding.Name]
+	shardingDef, serviceVersion, compDef := shardingDefNServiceVersionNCompDef(transCtx.Rollout, sharding, spec)
+	if shardingDef != spec.ShardingDef || serviceVersion != spec.Template.ServiceVersion || compDef != spec.Template.ComponentDef {
+		return nil
+	}
+	// TODO: how about the target sharding definition, service version and component definition are same with the original ones?
+
+	if !checkClusterNShardingRunning(transCtx, sharding.Name) {
+		return controllerutil.NewDelayedRequeueError(componentNotReadyRequeueDuration, fmt.Sprintf("the sharding %s is not ready", sharding.Name))
+	}
+
+	if sharding.ShardingDef != nil {
+		spec.ShardingDef = *sharding.ShardingDef
+		for i, tpl := range spec.ShardTemplates {
+			if tpl.ShardingDef != nil {
+				spec.ShardTemplates[i].ShardingDef = sharding.ShardingDef
+			}
+		}
+	}
+	if sharding.ServiceVersion != nil {
+		spec.Template.ServiceVersion = *sharding.ServiceVersion
+		for i := range spec.Template.Instances {
+			if len(spec.Template.Instances[i].ServiceVersion) > 0 || len(spec.Template.Instances[i].CompDef) > 0 {
+				spec.Template.Instances[i].ServiceVersion = *sharding.ServiceVersion
+			}
+		}
+		for i, tpl := range spec.ShardTemplates {
+			if tpl.ServiceVersion != nil || tpl.CompDef != nil {
+				spec.ShardTemplates[i].ServiceVersion = sharding.ServiceVersion
+			}
+		}
+	}
+	if sharding.CompDef != nil {
+		spec.Template.ComponentDef = *sharding.CompDef
+		for i := range spec.Template.Instances {
+			if len(spec.Template.Instances[i].ServiceVersion) > 0 || len(spec.Template.Instances[i].CompDef) > 0 {
+				spec.Template.Instances[i].CompDef = *sharding.CompDef
+			}
+		}
+		for i, tpl := range spec.ShardTemplates {
+			if tpl.ServiceVersion != nil || tpl.CompDef != nil {
+				spec.ShardTemplates[i].CompDef = sharding.CompDef
+			}
+		}
 	}
 	return nil
 }
@@ -109,3 +179,17 @@ func serviceVersionNCompDef(rollout *appsv1alpha1.Rollout, comp appsv1alpha1.Rol
 	}
 	return serviceVer, compDef
 }
+
+func shardingDefNServiceVersionNCompDef(rollout *appsv1alpha1.Rollout,
+	sharding appsv1alpha1.RolloutSharding, spec *appsv1.ClusterSharding) (string, string, string) {
+	shardingDef, serviceVer, compDef := spec.ShardingDef, spec.Template.ServiceVersion, spec.Template.ComponentDef
+	for _, status := range rollout.Status.Shardings {
+		if status.Name == sharding.Name {
+			shardingDef = status.ShardingDef
+			serviceVer = status.ServiceVersion
+			compDef = status.CompDef
+			break
+		}
+	}
+	return shardingDef, serviceVer, compDef
+}
diff --git a/controllers/apps/rollout/transformer_rollout_load.go b/controllers/apps/rollout/transformer_rollout_load.go
index 083a402a1..8c64fb284 100644
--- a/controllers/apps/rollout/transformer_rollout_load.go
+++ b/controllers/apps/rollout/transformer_rollout_load.go
@@ -57,7 +57,7 @@ func (t *rolloutLoadTransformer) Transform(ctx graph.TransformContext, dag *grap
 	transCtx.ClusterOrig = transCtx.Cluster.DeepCopy()
 	transCtx.ClusterComps, transCtx.ClusterShardings = t.clusterCompNSharding(transCtx.Cluster)
 
-	transCtx.Components, err = t.getNCheckComponents(transCtx.Context, transCtx.Client, rollout)
+	transCtx.Components, transCtx.ShardingComps, err = t.getNCheckComponents(transCtx.Context, transCtx.Client, rollout)
 	if err != nil {
 		return err
 	}
@@ -89,19 +89,28 @@ func (t *rolloutLoadTransformer) clusterCompNSharding(cluster *appsv1.Cluster) (
 	return comps, shardings
 }
 
-func (t *rolloutLoadTransformer) getNCheckComponents(ctx context.Context, cli client.Reader, rollout *appsv1alpha1.Rollout) (map[string]*appsv1.Component, error) {
-	if len(rollout.Spec.Components) == 0 {
-		return nil, nil
+func (t *rolloutLoadTransformer) getNCheckComponents(ctx context.Context, cli client.Reader,
+	rollout *appsv1alpha1.Rollout) (map[string]*appsv1.Component, map[string][]*appsv1.Component, error) {
+	if len(rollout.Spec.Components) == 0 && len(rollout.Spec.Shardings) == 0 {
+		return nil, nil, nil
 	}
-	components := make(map[string]*appsv1.Component)
+	comps := make(map[string]*appsv1.Component)
 	for _, comp := range rollout.Spec.Components {
 		obj, err := t.getNCheckComponent(ctx, cli, rollout, comp.Name)
 		if err != nil {
-			return nil, err
+			return nil, nil, err
 		}
-		components[comp.Name] = obj
+		comps[comp.Name] = obj
 	}
-	return components, nil
+	shardingComps := make(map[string][]*appsv1.Component)
+	for _, sharding := range rollout.Spec.Shardings {
+		objs, err := t.getNCheckShardingComps(ctx, cli, rollout, sharding.Name)
+		if err != nil {
+			return nil, nil, err
+		}
+		shardingComps[sharding.Name] = objs
+	}
+	return comps, shardingComps, nil
 }
 
 func (t *rolloutLoadTransformer) getNCheckComponent(ctx context.Context, cli client.Reader, rollout *appsv1alpha1.Rollout, compName string) (*appsv1.Component, error) {
@@ -117,6 +126,25 @@ func (t *rolloutLoadTransformer) getNCheckComponent(ctx context.Context, cli cli
 	return comp, nil
 }
 
+func (t *rolloutLoadTransformer) getNCheckShardingComps(ctx context.Context, cli client.Reader, rollout *appsv1alpha1.Rollout, shardingName string) ([]*appsv1.Component, error) {
+	compList := &appsv1.ComponentList{}
+	opts := []client.ListOption{
+		client.InNamespace(rollout.Namespace),
+		client.MatchingLabels(constant.GetClusterLabels(rollout.Spec.ClusterName, map[string]string{
+			constant.KBAppShardingNameLabelKey: shardingName,
+		})),
+	}
+	if err := cli.List(ctx, compList, opts...); err != nil {
+		return nil, err
+	}
+	shardingComps := make([]*appsv1.Component, 0)
+	for i := range compList.Items {
+		shardingComps = append(shardingComps, &compList.Items[i])
+	}
+	// TODO: check component status
+	return shardingComps, nil
+}
+
 func checkClusterNCompRunning(transCtx *rolloutTransformContext, compName string) bool {
 	cluster := transCtx.ClusterOrig
 	compStatus := cluster.Status.Components[compName]
@@ -129,3 +157,22 @@ func checkClusterNCompRunning(transCtx *rolloutTransformContext, compName string
 	}
 	return compObj.Generation == compObj.Status.ObservedGeneration && compObj.Status.Phase == appsv1.RunningComponentPhase
 }
+
+func checkClusterNShardingRunning(transCtx *rolloutTransformContext, shardingName string) bool {
+	cluster := transCtx.ClusterOrig
+	status := cluster.Status.Shardings[shardingName]
+	if cluster.Generation != cluster.Status.ObservedGeneration || status.Phase != appsv1.RunningComponentPhase {
+		return false
+	}
+	compObjs, ok := transCtx.ShardingComps[shardingName]
+	if !ok {
+		return false
+	}
+	for _, compObj := range compObjs {
+		if compObj.Generation != compObj.Status.ObservedGeneration || compObj.Status.Phase != appsv1.RunningComponentPhase {
+			return false
+		}
+	}
+	spec := transCtx.ClusterShardings[shardingName]
+	return len(compObjs) == int(spec.Shards)
+}
diff --git a/controllers/apps/rollout/transformer_rollout_replace.go b/controllers/apps/rollout/transformer_rollout_replace.go
index 026dcbbdf..581d7afce 100644
--- a/controllers/apps/rollout/transformer_rollout_replace.go
+++ b/controllers/apps/rollout/transformer_rollout_replace.go
@@ -21,6 +21,7 @@ package rollout
 
 import (
 	"fmt"
+	"maps"
 	"slices"
 	"strings"
 	"time"
@@ -56,8 +57,7 @@ func (t *rolloutReplaceTransformer) rollout(transCtx *rolloutTransformContext) e
 	if err := t.components(transCtx); err != nil {
 		return err
 	}
-	// TODO: sharding
-	return nil
+	return t.shardings(transCtx)
 }
 
 func (t *rolloutReplaceTransformer) components(transCtx *rolloutTransformContext) error {
@@ -75,25 +75,17 @@ func (t *rolloutReplaceTransformer) components(transCtx *rolloutTransformContext
 func (t *rolloutReplaceTransformer) component(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) error {
 	spec := transCtx.ClusterComps[comp.Name]
-	replicas, _, err := t.replicas(rollout, comp, spec)
+	replicas, _, err := replaceCompReplicas(rollout, comp, spec)
 	if err != nil {
 		return err
 	}
-	return t.rolling(transCtx, rollout, comp, spec, replicas)
-}
-
-func (t *rolloutReplaceTransformer) replicas(rollout *appsv1alpha1.Rollout,
-	comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec) (int32, int32, error) {
-	return replaceReplicas(rollout, comp, spec)
-}
-
-func (t *rolloutReplaceTransformer) rolling(transCtx *rolloutTransformContext,
-	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec, replicas int32) error {
-	tpl, exist, err := replaceInstanceTemplate(transCtx, comp, spec)
+	tpls, exist, err := replaceCompInstanceTemplates(rollout, comp, spec)
 	if err != nil {
 		return err
 	}
-	if *tpl.Replicas == replicas && spec.Replicas == replicas {
+
+	newReplicas := replaceInstanceTemplateReplicas(tpls)
+	if newReplicas == replicas && spec.Replicas == replicas {
 		return nil
 	}
 
@@ -103,21 +95,33 @@ func (t *rolloutReplaceTransformer) rolling(transCtx *rolloutTransformContext,
 
 	// update cluster spec after the cluster and component are ready
 	if !exist {
-		spec.Instances = append(spec.Instances, *tpl)
+		for _, tpl := range tpls {
+			spec.Instances = append(spec.Instances, *tpl)
+		}
 		spec.FlatInstanceOrdinal = true
-		tpl = &spec.Instances[len(spec.Instances)-1]
+		// retrieve the templates again after the spec is updated
+		tpls = replaceCompInstanceTemplatesFromSpec(rollout, spec)
+	}
+
+	instance, instTpl, err := t.pickCompInstanceToRollout(transCtx, spec)
+	if err != nil {
+		return err
+	}
+	tpl := tpls[""]
+	if instTpl != nil {
+		tpl = tpls[instTpl.Name]
 	}
 
 	if spec.Replicas == replicas {
-		return t.up(transCtx, rollout, comp, spec, tpl)
+		return t.compUp(rollout, comp, spec, newReplicas, tpl)
 	} else {
-		return t.down(transCtx, rollout, comp, spec, tpl)
+		return t.compDown(rollout, comp, spec, newReplicas, instance, instTpl)
 	}
 }
 
-func (t *rolloutReplaceTransformer) up(transCtx *rolloutTransformContext,
-	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec, tpl *appsv1.InstanceTemplate) error {
-	if err := t.checkDelaySeconds(rollout, comp, *tpl.Replicas, false); err != nil {
+func (t *rolloutReplaceTransformer) compUp(rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent,
+	spec *appsv1.ClusterComponentSpec, newReplicas int32, tpl *appsv1.InstanceTemplate) error {
+	if err := t.checkCompDelaySeconds(rollout, comp, newReplicas, false); err != nil {
 		return err
 	}
 	tpl.Replicas = ptr.To(*tpl.Replicas + 1)
@@ -125,14 +129,9 @@ func (t *rolloutReplaceTransformer) up(transCtx *rolloutTransformContext,
 	return nil
 }
 
-func (t *rolloutReplaceTransformer) down(transCtx *rolloutTransformContext,
-	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec, tpl *appsv1.InstanceTemplate) error {
-	if err := t.checkDelaySeconds(rollout, comp, *tpl.Replicas, true); err != nil {
-		return err
-	}
-
-	instance, instTpl, err := t.pickInstanceToScaleDown(transCtx, spec, tpl)
-	if err != nil {
+func (t *rolloutReplaceTransformer) compDown(rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent,
+	spec *appsv1.ClusterComponentSpec, newReplicas int32, instance string, instTpl *appsv1.InstanceTemplate) error {
+	if err := t.checkCompDelaySeconds(rollout, comp, newReplicas, true); err != nil {
 		return err
 	}
 
@@ -160,7 +159,7 @@ func (t *rolloutReplaceTransformer) down(transCtx *rolloutTransformContext,
 	return nil
 }
 
-func (t *rolloutReplaceTransformer) checkDelaySeconds(rollout *appsv1alpha1.Rollout,
+func (t *rolloutReplaceTransformer) checkCompDelaySeconds(rollout *appsv1alpha1.Rollout,
 	comp appsv1alpha1.RolloutComponent, newReplicas int32, scaleDown bool) error {
 	delaySeconds := comp.Strategy.Replace.PerInstanceIntervalSeconds
 	if scaleDown {
@@ -206,8 +205,8 @@ func (t *rolloutReplaceTransformer) checkDelaySeconds(rollout *appsv1alpha1.Roll
 	return nil
 }
 
-func (t *rolloutReplaceTransformer) pickInstanceToScaleDown(transCtx *rolloutTransformContext,
-	spec *appsv1.ClusterComponentSpec, tpl *appsv1.InstanceTemplate) (string, *appsv1.InstanceTemplate, error) {
+func (t *rolloutReplaceTransformer) pickCompInstanceToRollout(transCtx *rolloutTransformContext,
+	spec *appsv1.ClusterComponentSpec) (string, *appsv1.InstanceTemplate, error) {
 	matchingLabels := constant.GetCompLabels(transCtx.Cluster.Name, spec.Name)
 	matchingLabels[constant.KBAppReleasePhaseKey] = constant.ReleasePhaseStable
 	pods := &corev1.PodList{}
@@ -222,9 +221,11 @@ func (t *rolloutReplaceTransformer) pickInstanceToScaleDown(transCtx *rolloutTra
 	slices.SortFunc(pods.Items, func(a, b corev1.Pod) int {
 		return strings.Compare(a.Name, b.Name) * -1
 	})
+
 	var targetPod *corev1.Pod
+	prefix := replaceInstanceTemplateNamePrefix(transCtx.Rollout)
 	for i, pod := range pods.Items {
-		if pod.DeletionTimestamp == nil && pod.Labels[constant.KBAppInstanceTemplateLabelKey] != tpl.Name {
+		if pod.DeletionTimestamp == nil && !strings.HasPrefix(pod.Labels[constant.KBAppInstanceTemplateLabelKey], prefix) {
 			targetPod = &pods.Items[i]
 			break
 		}
@@ -245,7 +246,192 @@ func (t *rolloutReplaceTransformer) pickInstanceToScaleDown(transCtx *rolloutTra
 	return "", nil, fmt.Errorf("the instance template %s has not been found", tplName)
 }
 
-func replaceReplicas(rollout *appsv1alpha1.Rollout,
+func (t *rolloutReplaceTransformer) shardings(transCtx *rolloutTransformContext) error {
+	rollout := transCtx.Rollout
+	for _, sharding := range rollout.Spec.Shardings {
+		if sharding.Strategy.Replace != nil {
+			if err := t.sharding(transCtx, rollout, sharding); err != nil {
+				return err
+			}
+		}
+	}
+	return nil
+}
+
+func (t *rolloutReplaceTransformer) sharding(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) error {
+	spec := transCtx.ClusterShardings[sharding.Name]
+	replicas := replaceShardingReplicas(rollout, sharding, spec)
+	tpls, exist, err := replaceShardingInstanceTemplates(rollout, sharding, spec)
+	if err != nil {
+		return err
+	}
+
+	newReplicas := replaceInstanceTemplateReplicas(tpls)
+	if newReplicas == replicas && spec.Template.Replicas == replicas {
+		return nil
+	}
+
+	if !checkClusterNShardingRunning(transCtx, sharding.Name) {
+		return controllerutil.NewDelayedRequeueError(componentNotReadyRequeueDuration, fmt.Sprintf("the sharding %s is not ready", sharding.Name))
+	}
+
+	// update cluster spec after the cluster and sharding are ready
+	if !exist {
+		for _, tpl := range tpls {
+			spec.Template.Instances = append(spec.Template.Instances, *tpl)
+		}
+		spec.Template.FlatInstanceOrdinal = true
+		// retrieve the templates again after the spec is updated
+		tpls = replaceShardingInstanceTemplatesFromSpec(rollout, spec)
+	}
+
+	instance, instTpl, err := t.pickShardingInstancesToRollout(transCtx, spec)
+	if err != nil {
+		return err
+	}
+	tpl := tpls[""]
+	if instTpl != nil {
+		tpl = tpls[instTpl.Name]
+	}
+
+	if spec.Template.Replicas == replicas {
+		return t.shardingUp(rollout, sharding, spec, newReplicas, tpl)
+	} else {
+		return t.shardingDown(rollout, sharding, spec, newReplicas, instance, instTpl)
+	}
+}
+
+func (t *rolloutReplaceTransformer) shardingUp(rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding,
+	spec *appsv1.ClusterSharding, newReplicas int32, tpl *appsv1.InstanceTemplate) error {
+	if err := t.checkShardingDelaySeconds(rollout, sharding, newReplicas, false); err != nil {
+		return err
+	}
+	tpl.Replicas = ptr.To(*tpl.Replicas + 1)
+	spec.Template.Replicas += 1
+	return nil
+}
+
+func (t *rolloutReplaceTransformer) shardingDown(rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding,
+	spec *appsv1.ClusterSharding, newReplicas int32, instance string, instTpl *appsv1.InstanceTemplate) error {
+	if err := t.checkShardingDelaySeconds(rollout, sharding, newReplicas, true); err != nil {
+		return err
+	}
+
+	spec.Template.Replicas -= 1
+	if instTpl != nil {
+		if instTpl.Replicas == nil || *instTpl.Replicas == 0 {
+			return fmt.Errorf("the instance template %s still has running instances, but its replicas is already 0", instTpl.Name)
+		}
+		instTpl.Replicas = ptr.To(*instTpl.Replicas - 1)
+	}
+	if len(instance) > 0 {
+		spec.Template.OfflineInstances = append(spec.Template.OfflineInstances, instance)
+	}
+
+	// add the scale down instances to the rollout status
+	if len(instance) > 0 {
+		for i, status := range rollout.Status.Shardings {
+			if status.Name == spec.Name {
+				rollout.Status.Shardings[i].ScaleDownInstances = append(rollout.Status.Shardings[i].ScaleDownInstances, instance)
+				break
+			}
+		}
+	}
+
+	return nil
+}
+
+func (t *rolloutReplaceTransformer) checkShardingDelaySeconds(rollout *appsv1alpha1.Rollout,
+	sharding appsv1alpha1.RolloutSharding, newReplicas int32, scaleDown bool) error {
+	delaySeconds := sharding.Strategy.Replace.PerInstanceIntervalSeconds
+	if scaleDown {
+		delaySeconds = sharding.Strategy.Replace.ScaleDownDelaySeconds
+	}
+	if delaySeconds == nil || *delaySeconds == 0 {
+		return nil
+	}
+	if *delaySeconds < 0 {
+		return controllerutil.NewDelayedRequeueError(infiniteDelayRequeueDuration, "infinite delay")
+	}
+
+	var lastSucceedTimestamp metav1.Time
+	for _, status := range rollout.Status.Shardings {
+		if status.Name == sharding.Name {
+			if scaleDown {
+				if status.NewReplicas == newReplicas {
+					lastSucceedTimestamp = status.LastScaleUpTimestamp
+				} else {
+					return controllerutil.NewDelayedRequeueError(time.Second, "stale up status")
+				}
+			} else {
+				if status.RolledOutReplicas == newReplicas {
+					lastSucceedTimestamp = status.LastScaleDownTimestamp
+				} else {
+					return controllerutil.NewDelayedRequeueError(time.Second, "stale down status")
+				}
+			}
+			break
+		}
+	}
+	if lastSucceedTimestamp.IsZero() {
+		return nil
+	}
+
+	diff := time.Until(lastSucceedTimestamp.Add(time.Duration(*delaySeconds) * time.Second))
+	if diff > 0 {
+		if scaleDown {
+			return controllerutil.NewDelayedRequeueError(diff, fmt.Sprintf("delay to scale down for %s seconds", diff.String()))
+		}
+		return controllerutil.NewDelayedRequeueError(diff, fmt.Sprintf("delay to rollout next instance for %s seconds", diff.String()))
+	}
+	return nil
+}
+
+func (t *rolloutReplaceTransformer) pickShardingInstancesToRollout(transCtx *rolloutTransformContext,
+	spec *appsv1.ClusterSharding) (string, *appsv1.InstanceTemplate, error) {
+	matchingLabels := constant.GetClusterLabels(transCtx.Cluster.Name, map[string]string{
+		constant.KBAppShardingNameLabelKey: spec.Name,
+	})
+	matchingLabels[constant.KBAppReleasePhaseKey] = constant.ReleasePhaseStable
+	pods := &corev1.PodList{}
+	listOpts := []client.ListOption{
+		client.InNamespace(transCtx.Cluster.Namespace),
+		client.MatchingLabels(matchingLabels),
+	}
+	if err := transCtx.Client.List(transCtx.Context, pods, listOpts...); err != nil {
+		return "", nil, err
+	}
+
+	slices.SortFunc(pods.Items, func(a, b corev1.Pod) int {
+		return strings.Compare(a.Name, b.Name) * -1
+	})
+
+	var targetPod *corev1.Pod
+	prefix := replaceInstanceTemplateNamePrefix(transCtx.Rollout)
+	for i, pod := range pods.Items {
+		if pod.DeletionTimestamp == nil && !strings.HasPrefix(pod.Labels[constant.KBAppInstanceTemplateLabelKey], prefix) {
+			targetPod = &pods.Items[i]
+			break
+		}
+	}
+
+	if targetPod == nil {
+		return "", nil, nil
+	}
+	tplName, ok := targetPod.Labels[constant.KBAppInstanceTemplateLabelKey]
+	if !ok || len(tplName) == 0 {
+		return targetPod.Name, nil, nil
+	}
+	for i, tpl := range spec.Template.Instances {
+		if tpl.Name == tplName {
+			return targetPod.Name, &spec.Template.Instances[i], nil
+		}
+	}
+	return "", nil, fmt.Errorf("the instance template %s has not been found", tplName)
+}
+
+func replaceCompReplicas(rollout *appsv1alpha1.Rollout,
 	comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec) (int32, int32, error) {
 	// the original replicas
 	replicas := spec.Replicas
@@ -280,30 +466,70 @@ func replaceReplicas(rollout *appsv1alpha1.Rollout,
 	return replicas, target, nil
 }
 
-func replaceInstanceTemplate(transCtx *rolloutTransformContext,
-	comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec) (*appsv1.InstanceTemplate, bool, error) {
-	name := string(transCtx.Rollout.UID[:8])
-	for i, tpl := range spec.Instances {
-		if tpl.Name == name {
-			return &spec.Instances[i], true, nil
+func replaceShardingReplicas(rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding, spec *appsv1.ClusterSharding) int32 {
+	// the original replicas
+	replicas := spec.Template.Replicas
+	for _, status := range rollout.Status.Shardings {
+		if status.Name == sharding.Name {
+			replicas = status.Replicas
+			break
 		}
 	}
+	return replicas
+}
+
+func replaceCompInstanceTemplates(rollout *appsv1alpha1.Rollout,
+	comp appsv1alpha1.RolloutComponent, spec *appsv1.ClusterComponentSpec) (map[string]*appsv1.InstanceTemplate, bool, error) {
+	tpls := replaceCompInstanceTemplatesFromSpec(rollout, spec)
+	if len(tpls) > 0 {
+		return tpls, true, nil
+	}
+
 	if len(spec.Instances) > 0 && !spec.FlatInstanceOrdinal {
 		return nil, false, fmt.Errorf("not support the replace strategy with the flatInstanceOrdinal is false")
 	}
-	tpl := &appsv1.InstanceTemplate{
-		Name:     name,
-		Replicas: ptr.To[int32](0),
+
+	prefix := replaceInstanceTemplateNamePrefix(rollout)
+	tpls[""] = replaceCompInstanceTemplate(comp, prefix, nil)
+	for _, tpl := range spec.Instances {
+		if ptr.Deref(tpl.Replicas, 0) > 0 {
+			tpls[tpl.Name] = replaceCompInstanceTemplate(comp, fmt.Sprintf("%s-%s", prefix, tpl.Name), &tpl)
+		}
+	}
+	return tpls, false, nil
+}
+
+func replaceCompInstanceTemplatesFromSpec(rollout *appsv1alpha1.Rollout, spec *appsv1.ClusterComponentSpec) map[string]*appsv1.InstanceTemplate {
+	prefix := replaceInstanceTemplateNamePrefix(rollout)
+	tpls := make(map[string]*appsv1.InstanceTemplate)
+	for i, tpl := range spec.Instances {
+		if strings.HasPrefix(tpl.Name, prefix) {
+			if tpl.Name == prefix {
+				tpls[""] = &spec.Instances[i]
+			} else {
+				tpls[strings.TrimPrefix(tpl.Name, fmt.Sprintf("%s-", prefix))] = &spec.Instances[i]
+			}
+		}
+	}
+	return tpls
+}
+
+func replaceCompInstanceTemplate(comp appsv1alpha1.RolloutComponent, newTplName string, tpl *appsv1.InstanceTemplate) *appsv1.InstanceTemplate {
+	newTpl := &appsv1.InstanceTemplate{}
+	if tpl != nil {
+		newTpl = tpl.DeepCopy()
 	}
+	newTpl.Name = newTplName
+	newTpl.Replicas = ptr.To[int32](0)
 	if comp.ServiceVersion != nil {
-		tpl.ServiceVersion = *comp.ServiceVersion
+		newTpl.ServiceVersion = *comp.ServiceVersion
 	}
 	if comp.CompDef != nil {
-		tpl.CompDef = *comp.CompDef
+		newTpl.CompDef = *comp.CompDef
 	}
 	if comp.Strategy.Replace.SchedulingPolicy != nil {
 		policy := comp.Strategy.Replace.SchedulingPolicy
-		tpl.SchedulingPolicy = &appsv1.SchedulingPolicy{
+		newTpl.SchedulingPolicy = &appsv1.SchedulingPolicy{
 			SchedulerName:             policy.SchedulerName,
 			NodeSelector:              policy.NodeSelector,
 			NodeName:                  policy.NodeName,
@@ -313,8 +539,87 @@ func replaceInstanceTemplate(transCtx *rolloutTransformContext,
 		}
 	}
 	if comp.InstanceMeta != nil && comp.InstanceMeta.Canary != nil {
-		tpl.Labels = comp.InstanceMeta.Canary.Labels
-		tpl.Annotations = comp.InstanceMeta.Canary.Annotations
+		maps.Copy(newTpl.Labels, comp.InstanceMeta.Canary.Labels)
+		maps.Copy(newTpl.Annotations, comp.InstanceMeta.Canary.Annotations)
+	}
+	return newTpl
+}
+
+func replaceShardingInstanceTemplates(rollout *appsv1alpha1.Rollout,
+	sharding appsv1alpha1.RolloutSharding, spec *appsv1.ClusterSharding) (map[string]*appsv1.InstanceTemplate, bool, error) {
+	tpls := replaceShardingInstanceTemplatesFromSpec(rollout, spec)
+	if len(tpls) > 0 {
+		return tpls, true, nil
+	}
+
+	if len(spec.Template.Instances) > 0 && !spec.Template.FlatInstanceOrdinal {
+		return nil, false, fmt.Errorf("not support the replace strategy with the flatInstanceOrdinal is false")
+	}
+
+	prefix := replaceInstanceTemplateNamePrefix(rollout)
+	tpls[""] = replaceShardingInstanceTemplate(sharding, prefix, nil)
+	for _, tpl := range spec.Template.Instances {
+		if ptr.Deref(tpl.Replicas, 0) > 0 {
+			tpls[tpl.Name] = replaceShardingInstanceTemplate(sharding, fmt.Sprintf("%s-%s", prefix, tpl.Name), &tpl)
+		}
+	}
+	return tpls, false, nil
+}
+
+func replaceShardingInstanceTemplatesFromSpec(rollout *appsv1alpha1.Rollout, spec *appsv1.ClusterSharding) map[string]*appsv1.InstanceTemplate {
+	prefix := replaceInstanceTemplateNamePrefix(rollout)
+	tpls := make(map[string]*appsv1.InstanceTemplate)
+	for i, tpl := range spec.Template.Instances {
+		if strings.HasPrefix(tpl.Name, prefix) {
+			if tpl.Name == prefix {
+				tpls[""] = &spec.Template.Instances[i]
+			} else {
+				tpls[strings.TrimPrefix(tpl.Name, fmt.Sprintf("%s-", prefix))] = &spec.Template.Instances[i]
+			}
+		}
+	}
+	return tpls
+}
+
+func replaceShardingInstanceTemplate(sharding appsv1alpha1.RolloutSharding, newTplName string, tpl *appsv1.InstanceTemplate) *appsv1.InstanceTemplate {
+	newTpl := &appsv1.InstanceTemplate{}
+	if tpl != nil {
+		newTpl = tpl.DeepCopy()
+	}
+	newTpl.Name = newTplName
+	newTpl.Replicas = ptr.To[int32](0)
+	if sharding.ServiceVersion != nil {
+		newTpl.ServiceVersion = *sharding.ServiceVersion
+	}
+	if sharding.CompDef != nil {
+		newTpl.CompDef = *sharding.CompDef
+	}
+	if sharding.Strategy.Replace.SchedulingPolicy != nil {
+		policy := sharding.Strategy.Replace.SchedulingPolicy
+		newTpl.SchedulingPolicy = &appsv1.SchedulingPolicy{
+			SchedulerName:             policy.SchedulerName,
+			NodeSelector:              policy.NodeSelector,
+			NodeName:                  policy.NodeName,
+			Affinity:                  policy.Affinity,
+			Tolerations:               policy.Tolerations,
+			TopologySpreadConstraints: policy.TopologySpreadConstraints,
+		}
+	}
+	if sharding.InstanceMeta != nil && sharding.InstanceMeta.Canary != nil {
+		maps.Copy(newTpl.Labels, sharding.InstanceMeta.Canary.Labels)
+		maps.Copy(newTpl.Annotations, sharding.InstanceMeta.Canary.Annotations)
+	}
+	return newTpl
+}
+
+func replaceInstanceTemplateNamePrefix(rollout *appsv1alpha1.Rollout) string {
+	return string(rollout.UID[:8])
+}
+
+func replaceInstanceTemplateReplicas(tpls map[string]*appsv1.InstanceTemplate) int32 {
+	cnt := int32(0)
+	for _, tpl := range tpls {
+		cnt += *tpl.Replicas
 	}
-	return tpl, false, nil
+	return cnt
 }
diff --git a/controllers/apps/rollout/transformer_rollout_setup.go b/controllers/apps/rollout/transformer_rollout_setup.go
index 934e59061..fa4bcd4d5 100644
--- a/controllers/apps/rollout/transformer_rollout_setup.go
+++ b/controllers/apps/rollout/transformer_rollout_setup.go
@@ -47,10 +47,8 @@ func (t *rolloutSetupTransformer) Transform(ctx graph.TransformContext, dag *gra
 	)
 
 	// pre-check
-	for _, comp := range rollout.Spec.Components {
-		if err := t.precheck(comp); err != nil {
-			return err
-		}
+	if err := t.precheck(rollout); err != nil {
+		return err
 	}
 
 	// check and add the rollout label to the cluster
@@ -58,32 +56,59 @@ func (t *rolloutSetupTransformer) Transform(ctx graph.TransformContext, dag *gra
 		return err
 	}
 
-	// init the rollout component status
+	// init the rollout status
 	return t.initRolloutStatus(transCtx, dag, rollout)
 }
 
-func (t *rolloutSetupTransformer) precheck(comp appsv1alpha1.RolloutComponent) error {
-	// target serviceVersion & componentDef
-	if comp.ServiceVersion == nil && comp.CompDef == nil {
-		return fmt.Errorf("neither serviceVersion nor compDef is defined for component %s", comp.Name)
+func (t *rolloutSetupTransformer) precheck(rollout *appsv1alpha1.Rollout) error {
+	if err := t.compPrecheck(rollout); err != nil {
+		return err
 	}
+	return t.shardingPrecheck(rollout)
+}
 
-	// rollout strategy
+func (t *rolloutSetupTransformer) compPrecheck(rollout *appsv1alpha1.Rollout) error {
+	for _, comp := range rollout.Spec.Components {
+		// target serviceVersion & componentDef
+		if comp.ServiceVersion == nil && comp.CompDef == nil {
+			return fmt.Errorf("neither serviceVersion nor compDef is defined for component %s", comp.Name)
+		}
+		if err := t.checkRolloutStrategy("component", comp.Name, comp.Strategy); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (t *rolloutSetupTransformer) shardingPrecheck(rollout *appsv1alpha1.Rollout) error {
+	for _, sharding := range rollout.Spec.Shardings {
+		// target shardingDef & serviceVersion & componentDef
+		if sharding.ShardingDef == nil && sharding.ServiceVersion == nil && sharding.CompDef == nil {
+			return fmt.Errorf("neither shardingDef, serviceVersion nor compDef is defined for sharding %s", sharding.Name)
+		}
+		if err := t.checkRolloutStrategy("sharding", sharding.Name, sharding.Strategy); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+func (t *rolloutSetupTransformer) checkRolloutStrategy(kind, name string, strategy appsv1alpha1.RolloutStrategy) error {
 	cnt := 0
-	if comp.Strategy.Inplace != nil {
+	if strategy.Inplace != nil {
 		cnt++
 	}
-	if comp.Strategy.Replace != nil {
+	if strategy.Replace != nil {
 		cnt++
 	}
-	if comp.Strategy.Create != nil {
+	if strategy.Create != nil {
 		cnt++
 	}
 	if cnt == 0 {
-		return fmt.Errorf("the rollout strategy of component %s is not defined", comp.Name)
+		return fmt.Errorf("the rollout strategy of %s %s is not defined", kind, name)
 	}
 	if cnt > 1 {
-		return fmt.Errorf("more than one rollout strategy is defined for component %s", comp.Name)
+		return fmt.Errorf("more than one rollout strategy is defined for %s %s", kind, name)
 	}
 	return nil
 }
@@ -123,6 +148,11 @@ func (t *rolloutSetupTransformer) initRolloutStatus(transCtx *rolloutTransformCo
 			return err
 		}
 	}
+	for _, sharding := range rollout.Spec.Shardings {
+		if err := t.initShardingStatus(transCtx, rollout, sharding); err != nil {
+			return err
+		}
+	}
 	if !reflect.DeepEqual(transCtx.RolloutOrig.Status, rollout.Status) {
 		graphCli.Status(dag, transCtx.RolloutOrig, rollout)
 		return graph.ErrPrematureStop
@@ -149,3 +179,24 @@ func (t *rolloutSetupTransformer) initCompStatus(transCtx *rolloutTransformConte
 	})
 	return nil
 }
+
+func (t *rolloutSetupTransformer) initShardingStatus(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) error {
+	spec := transCtx.ClusterShardings[sharding.Name]
+	if spec == nil {
+		return fmt.Errorf("the sharding %s is not found in cluster", sharding.Name)
+	}
+	for _, status := range rollout.Status.Shardings {
+		if status.Name == sharding.Name {
+			return nil // has been initialized
+		}
+	}
+	rollout.Status.Shardings = append(rollout.Status.Shardings, appsv1alpha1.RolloutShardingStatus{
+		Name:           sharding.Name,
+		ShardingDef:    spec.ShardingDef,
+		ServiceVersion: spec.Template.ServiceVersion,
+		CompDef:        spec.Template.ComponentDef,
+		Replicas:       spec.Template.Replicas,
+	})
+	return nil
+}
diff --git a/controllers/apps/rollout/transformer_rollout_status.go b/controllers/apps/rollout/transformer_rollout_status.go
index 119c59080..3c0ef610f 100644
--- a/controllers/apps/rollout/transformer_rollout_status.go
+++ b/controllers/apps/rollout/transformer_rollout_status.go
@@ -20,6 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 package rollout
 
 import (
+	"slices"
+	"strings"
+
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"sigs.k8s.io/controller-runtime/pkg/client"
@@ -43,30 +46,24 @@ func (t *rolloutStatusTransformer) Transform(ctx graph.TransformContext, dag *gr
 	}
 
 	rollout := transCtx.Rollout
-	state, err := t.components(transCtx, rollout)
+	states1, err := t.components(transCtx, rollout)
+	if err != nil {
+		return err
+	}
+	states2, err := t.shardings(transCtx, rollout)
 	if err != nil {
 		return err
 	}
-	// TODO: sharding
 
 	rollout.Status.ObservedGeneration = rollout.Generation
-	rollout.Status.State = state
+	rollout.Status.State = t.compose(states1, states2)
 
 	// TODO: error message, conditions
 
 	return nil
 }
 
-func (t *rolloutStatusTransformer) components(transCtx *rolloutTransformContext, rollout *appsv1alpha1.Rollout) (appsv1alpha1.RolloutState, error) {
-	states := make([]appsv1alpha1.RolloutState, 0)
-	for _, comp := range rollout.Spec.Components {
-		state, err := t.component(transCtx, rollout, comp)
-		if err != nil {
-			return "", err
-		}
-		states = append(states, state)
-	}
-
+func (t *rolloutStatusTransformer) compose(states1, states2 []appsv1alpha1.RolloutState) appsv1alpha1.RolloutState {
 	var (
 		hasError   = false
 		hasRolling = false
@@ -74,7 +71,7 @@ func (t *rolloutStatusTransformer) components(transCtx *rolloutTransformContext,
 		hasPending = false
 		allSucceed = true
 	)
-	for _, state := range states {
+	for _, state := range append(states1, states2...) {
 		switch state {
 		case appsv1alpha1.RollingRolloutState:
 			hasRolling = true
@@ -93,35 +90,47 @@ func (t *rolloutStatusTransformer) components(transCtx *rolloutTransformContext,
 	}
 	switch {
 	case hasError:
-		return appsv1alpha1.ErrorRolloutState, nil
+		return appsv1alpha1.ErrorRolloutState
 	case hasRolling:
-		return appsv1alpha1.RollingRolloutState, nil
+		return appsv1alpha1.RollingRolloutState
 	case allSucceed:
-		return appsv1alpha1.SucceedRolloutState, nil
+		return appsv1alpha1.SucceedRolloutState
 	case hasSucceed:
-		return appsv1alpha1.RollingRolloutState, nil
+		return appsv1alpha1.RollingRolloutState
 	case hasPending:
-		return appsv1alpha1.PendingRolloutState, nil
+		return appsv1alpha1.PendingRolloutState
 	default:
-		return "", nil
+		return ""
 	}
 }
 
+func (t *rolloutStatusTransformer) components(transCtx *rolloutTransformContext, rollout *appsv1alpha1.Rollout) ([]appsv1alpha1.RolloutState, error) {
+	states := make([]appsv1alpha1.RolloutState, 0)
+	for _, comp := range rollout.Spec.Components {
+		state, err := t.component(transCtx, rollout, comp)
+		if err != nil {
+			return nil, err
+		}
+		states = append(states, state)
+	}
+	return states, nil
+}
+
 func (t *rolloutStatusTransformer) component(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) (appsv1alpha1.RolloutState, error) {
 	if comp.Strategy.Inplace != nil {
-		return t.inplace(transCtx, rollout, comp)
+		return t.compInplace(transCtx, rollout, comp)
 	}
 	if comp.Strategy.Replace != nil {
-		return t.replace(transCtx, rollout, comp)
+		return t.compReplace(transCtx, rollout, comp)
 	}
 	if comp.Strategy.Create != nil {
-		return t.create(transCtx, rollout, comp)
+		return t.compCreate(transCtx, rollout, comp)
 	}
 	return "", nil
 }
 
-func (t *rolloutStatusTransformer) inplace(transCtx *rolloutTransformContext,
+func (t *rolloutStatusTransformer) compInplace(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) (appsv1alpha1.RolloutState, error) {
 	spec := t.compSpec(transCtx, comp.Name)
 	serviceVersion, compDef := serviceVersionNCompDef(rollout, comp, spec)
@@ -134,17 +143,13 @@ func (t *rolloutStatusTransformer) inplace(transCtx *rolloutTransformContext,
 	return appsv1alpha1.RollingRolloutState, nil
 }
 
-func (t *rolloutStatusTransformer) replace(transCtx *rolloutTransformContext,
+func (t *rolloutStatusTransformer) compReplace(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) (appsv1alpha1.RolloutState, error) {
-	var rollingTpl *appsv1.InstanceTemplate
 	spec := t.compSpec(transCtx, comp.Name)
-	tplName := string(rollout.UID[:8])
-	for i, tpl := range spec.Instances {
-		if tpl.Name == tplName {
-			rollingTpl = &spec.Instances[i]
-		}
-	}
-	if rollingTpl == nil {
+	prefix := replaceInstanceTemplateNamePrefix(rollout)
+	if slices.IndexFunc(spec.Instances, func(tpl appsv1.InstanceTemplate) bool {
+		return strings.HasPrefix(tpl.Name, prefix)
+	}) < 0 {
 		return appsv1alpha1.PendingRolloutState, nil
 	}
 
@@ -160,7 +165,7 @@ func (t *rolloutStatusTransformer) replace(transCtx *rolloutTransformContext,
 	allPodCnt := int32(len(pods.Items))
 	newPodCnt := int32(generics.CountFunc(pods.Items, func(pod corev1.Pod) bool {
 		if pod.Labels != nil {
-			return pod.Labels[constant.KBAppInstanceTemplateLabelKey] == tplName
+			return strings.HasPrefix(pod.Labels[constant.KBAppInstanceTemplateLabelKey], prefix)
 		}
 		return false
 	}))
@@ -184,7 +189,12 @@ func (t *rolloutStatusTransformer) replace(transCtx *rolloutTransformContext,
 		}
 	}
 
-	if !checkClusterNCompRunning(transCtx, comp.Name) || spec.Replicas != *rollingTpl.Replicas {
+	tpls, _, err := replaceCompInstanceTemplates(rollout, comp, spec)
+	if err != nil {
+		return "", err
+	}
+	newReplicas := replaceInstanceTemplateReplicas(tpls)
+	if !checkClusterNCompRunning(transCtx, comp.Name) || spec.Replicas != newReplicas {
 		return appsv1alpha1.RollingRolloutState, nil
 	}
 	if allPodCnt != spec.Replicas {
@@ -193,7 +203,7 @@ func (t *rolloutStatusTransformer) replace(transCtx *rolloutTransformContext,
 	return appsv1alpha1.SucceedRolloutState, nil
 }
 
-func (t *rolloutStatusTransformer) create(transCtx *rolloutTransformContext,
+func (t *rolloutStatusTransformer) compCreate(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) (appsv1alpha1.RolloutState, error) {
 	// TODO: impl
 	return "", createStrategyNotSupportedError
@@ -210,6 +220,124 @@ func (t *rolloutStatusTransformer) compSpec(transCtx *rolloutTransformContext, c
 	return nil
 }
 
+func (t *rolloutStatusTransformer) shardings(transCtx *rolloutTransformContext, rollout *appsv1alpha1.Rollout) ([]appsv1alpha1.RolloutState, error) {
+	states := make([]appsv1alpha1.RolloutState, 0)
+	for _, sharding := range rollout.Spec.Shardings {
+		state, err := t.sharding(transCtx, rollout, sharding)
+		if err != nil {
+			return nil, err
+		}
+		states = append(states, state)
+	}
+	return states, nil
+}
+
+func (t *rolloutStatusTransformer) sharding(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) (appsv1alpha1.RolloutState, error) {
+	if sharding.Strategy.Inplace != nil {
+		return t.shardingInplace(transCtx, rollout, sharding)
+	}
+	if sharding.Strategy.Replace != nil {
+		return t.shardingReplace(transCtx, rollout, sharding)
+	}
+	if sharding.Strategy.Create != nil {
+		return t.shardingCreate(transCtx, rollout, sharding)
+	}
+	return "", nil
+}
+
+func (t *rolloutStatusTransformer) shardingInplace(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) (appsv1alpha1.RolloutState, error) {
+	spec := t.shardingSpec(transCtx, sharding.Name)
+	shardingDef, serviceVersion, compDef := shardingDefNServiceVersionNCompDef(rollout, sharding, spec)
+	if shardingDef == spec.ShardingDef && serviceVersion == spec.Template.ServiceVersion && compDef == spec.Template.ComponentDef {
+		return appsv1alpha1.PendingRolloutState, nil
+	}
+	if checkClusterNShardingRunning(transCtx, sharding.Name) {
+		return appsv1alpha1.SucceedRolloutState, nil
+	}
+	return appsv1alpha1.RollingRolloutState, nil
+}
+
+func (t *rolloutStatusTransformer) shardingReplace(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) (appsv1alpha1.RolloutState, error) {
+	spec := t.shardingSpec(transCtx, sharding.Name)
+	prefix := replaceInstanceTemplateNamePrefix(rollout)
+	if slices.IndexFunc(spec.Template.Instances, func(tpl appsv1.InstanceTemplate) bool {
+		return strings.HasPrefix(tpl.Name, prefix)
+	}) < 0 {
+		return appsv1alpha1.PendingRolloutState, nil
+	}
+
+	pods := &corev1.PodList{}
+	listOpts := []client.ListOption{
+		client.InNamespace(rollout.Namespace),
+		client.MatchingLabels(constant.GetClusterLabels(rollout.Spec.ClusterName, map[string]string{
+			constant.KBAppShardingNameLabelKey: sharding.Name,
+		})),
+	}
+	if err := transCtx.Client.List(transCtx.Context, pods, listOpts...); err != nil {
+		return "", err
+	}
+
+	allPodCnt := int32(len(pods.Items))
+	newPodCnt := int32(generics.CountFunc(pods.Items, func(pod corev1.Pod) bool {
+		if pod.Labels != nil {
+			return strings.HasPrefix(pod.Labels[constant.KBAppInstanceTemplateLabelKey], prefix)
+		}
+		return false
+	}))
+	for i, status := range rollout.Status.Shardings {
+		if status.Name == sharding.Name {
+			if checkClusterNShardingRunning(transCtx, sharding.Name) {
+				newReplicas, rolledOutReplicas := newPodCnt, newPodCnt-(allPodCnt-status.Replicas)
+				if rolledOutReplicas == newReplicas {
+					if status.RolledOutReplicas < rolledOutReplicas {
+						rollout.Status.Shardings[i].LastScaleDownTimestamp = metav1.Now()
+					}
+				} else {
+					if status.NewReplicas < newReplicas {
+						rollout.Status.Shardings[i].LastScaleUpTimestamp = metav1.Now()
+					}
+				}
+				rollout.Status.Shardings[i].NewReplicas = newReplicas
+				rollout.Status.Shardings[i].RolledOutReplicas = rolledOutReplicas
+			}
+			break
+		}
+	}
+
+	tpls, _, err := replaceShardingInstanceTemplates(rollout, sharding, spec)
+	if err != nil {
+		return "", err
+	}
+	newReplicas := replaceInstanceTemplateReplicas(tpls)
+	if !checkClusterNShardingRunning(transCtx, sharding.Name) || spec.Template.Replicas != newReplicas {
+		return appsv1alpha1.RollingRolloutState, nil
+	}
+	if allPodCnt != spec.Template.Replicas {
+		return appsv1alpha1.RollingRolloutState, nil // scaling down
+	}
+	return appsv1alpha1.SucceedRolloutState, nil
+}
+
+func (t *rolloutStatusTransformer) shardingCreate(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) (appsv1alpha1.RolloutState, error) {
+	// TODO: impl
+	return "", createStrategyNotSupportedError
+}
+
+func (t *rolloutStatusTransformer) shardingSpec(transCtx *rolloutTransformContext, shardingName string) *appsv1.ClusterSharding {
+	// use the original cluster spec
+	cluster := transCtx.ClusterOrig
+	for i, sharding := range cluster.Spec.Shardings {
+		if sharding.Name == shardingName {
+			return &cluster.Spec.Shardings[i]
+		}
+	}
+	return nil
+}
+
 func isRolloutSucceed(rollout *appsv1alpha1.Rollout) bool {
 	return rollout.Status.State == appsv1alpha1.SucceedRolloutState
 }
diff --git a/controllers/apps/rollout/transformer_rollout_teardown.go b/controllers/apps/rollout/transformer_rollout_teardown.go
index 4018ad12e..3cf1df544 100644
--- a/controllers/apps/rollout/transformer_rollout_teardown.go
+++ b/controllers/apps/rollout/transformer_rollout_teardown.go
@@ -43,25 +43,24 @@ func (t *rolloutTearDownTransformer) tearDown(transCtx *rolloutTransformContext)
 	if err := t.components(transCtx); err != nil {
 		return err
 	}
-	// TODO: sharding
-	return nil
+	return t.shardings(transCtx)
 }
 
 func (t *rolloutTearDownTransformer) components(transCtx *rolloutTransformContext) error {
 	rollout := transCtx.Rollout
 	for _, comp := range rollout.Spec.Components {
 		if comp.Strategy.Inplace != nil {
-			if err := t.inplace(transCtx, rollout, comp); err != nil {
+			if err := t.compInplace(transCtx, rollout, comp); err != nil {
 				return err
 			}
 		}
 		if comp.Strategy.Replace != nil {
-			if err := t.replace(transCtx, rollout, comp); err != nil {
+			if err := t.compReplace(transCtx, rollout, comp); err != nil {
 				return err
 			}
 		}
 		if comp.Strategy.Create != nil {
-			if err := t.create(transCtx, rollout, comp); err != nil {
+			if err := t.compCreate(transCtx, rollout, comp); err != nil {
 				return err
 			}
 		}
@@ -69,23 +68,25 @@ func (t *rolloutTearDownTransformer) components(transCtx *rolloutTransformContex
 	return nil
 }
 
-func (t *rolloutTearDownTransformer) inplace(transCtx *rolloutTransformContext,
+func (t *rolloutTearDownTransformer) compInplace(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) error {
 	return nil // do nothing
 }
 
-func (t *rolloutTearDownTransformer) replace(transCtx *rolloutTransformContext,
+func (t *rolloutTearDownTransformer) compReplace(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) error {
 	spec := transCtx.ClusterComps[comp.Name]
-	replicas, _, err := replaceReplicas(rollout, comp, spec)
+	replicas, _, err := replaceCompReplicas(rollout, comp, spec)
 	if err != nil {
 		return err
 	}
-	tpl, _, err := replaceInstanceTemplate(transCtx, comp, spec)
+	tpls, _, err := replaceCompInstanceTemplates(rollout, comp, spec)
 	if err != nil {
 		return err
 	}
-	if *tpl.Replicas == replicas && spec.Replicas == replicas && checkClusterNCompRunning(transCtx, comp.Name) {
+	newReplicas := replaceInstanceTemplateReplicas(tpls)
+	if newReplicas == replicas && spec.Replicas == replicas && checkClusterNCompRunning(transCtx, comp.Name) {
+		tpl := tpls[""] // use the default template
 		spec.ServiceVersion = tpl.ServiceVersion
 		spec.ComponentDef = tpl.CompDef
 		spec.OfflineInstances = slices.DeleteFunc(spec.OfflineInstances, func(instance string) bool {
@@ -100,8 +101,66 @@ func (t *rolloutTearDownTransformer) replace(transCtx *rolloutTransformContext,
 	return nil
 }
 
-func (t *rolloutTearDownTransformer) create(transCtx *rolloutTransformContext,
+func (t *rolloutTearDownTransformer) compCreate(transCtx *rolloutTransformContext,
 	rollout *appsv1alpha1.Rollout, comp appsv1alpha1.RolloutComponent) error {
 	// TODO: impl
 	return createStrategyNotSupportedError
 }
+
+func (t *rolloutTearDownTransformer) shardings(transCtx *rolloutTransformContext) error {
+	rollout := transCtx.Rollout
+	for _, sharding := range rollout.Spec.Shardings {
+		if sharding.Strategy.Inplace != nil {
+			if err := t.shardingInplace(transCtx, rollout, sharding); err != nil {
+				return err
+			}
+		}
+		if sharding.Strategy.Replace != nil {
+			if err := t.shardingReplace(transCtx, rollout, sharding); err != nil {
+				return err
+			}
+		}
+		if sharding.Strategy.Create != nil {
+			if err := t.shardingCreate(transCtx, rollout, sharding); err != nil {
+				return err
+			}
+		}
+	}
+	return nil
+}
+
+func (t *rolloutTearDownTransformer) shardingInplace(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) error {
+	return nil // do nothing
+}
+
+func (t *rolloutTearDownTransformer) shardingReplace(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) error {
+	spec := transCtx.ClusterShardings[sharding.Name]
+	replicas := replaceShardingReplicas(rollout, sharding, spec)
+	tpls, _, err := replaceShardingInstanceTemplates(rollout, sharding, spec)
+	if err != nil {
+		return err
+	}
+	newReplicas := replaceInstanceTemplateReplicas(tpls)
+	if newReplicas == replicas && spec.Template.Replicas == replicas && checkClusterNShardingRunning(transCtx, sharding.Name) {
+		tpl := tpls[""] // use the default template
+		spec.Template.ServiceVersion = tpl.ServiceVersion
+		spec.Template.ComponentDef = tpl.CompDef
+		spec.Template.OfflineInstances = slices.DeleteFunc(spec.Template.OfflineInstances, func(instance string) bool {
+			for _, status := range rollout.Status.Shardings {
+				if status.Name == sharding.Name {
+					return slices.Contains(status.ScaleDownInstances, instance)
+				}
+			}
+			return false
+		})
+	}
+	return nil
+}
+
+func (t *rolloutTearDownTransformer) shardingCreate(transCtx *rolloutTransformContext,
+	rollout *appsv1alpha1.Rollout, sharding appsv1alpha1.RolloutSharding) error {
+	// TODO: impl
+	return createStrategyNotSupportedError
+}
diff --git a/controllers/parameters/parameter_util.go b/controllers/parameters/parameter_util.go
index 119680593..8d8e4c10d 100644
--- a/controllers/parameters/parameter_util.go
+++ b/controllers/parameters/parameter_util.go
@@ -164,12 +164,12 @@ func classifyParameters(updatedParameters parametersv1alpha1.ComponentParameters
 			rctx.ConfigRender,
 		)
 		if err != nil {
-			return err
+			return intctrlutil.NewFatalError(err.Error())
 		}
 		for tpl, m := range classParameters {
 			configDescs := intctrlutil.GetComponentConfigDescriptions(&rctx.ConfigRender.Spec, tpl)
 			if len(configDescs) == 0 {
-				return fmt.Errorf("not found config description from pdcr: %s", tpl)
+				return intctrlutil.NewFatalError(fmt.Sprintf("not found config description from pdcr: %s", tpl))
 			}
 			if err := validateComponentParameter(toArray(rctx.ParametersDefs), configDescs, m); err != nil {
 				return intctrlutil.NewFatalError(err.Error())
diff --git a/deploy/helm/crds/apps.kubeblocks.io_rollouts.yaml b/deploy/helm/crds/apps.kubeblocks.io_rollouts.yaml
index 31bf8e767..dd923a11e 100644
--- a/deploy/helm/crds/apps.kubeblocks.io_rollouts.yaml
+++ b/deploy/helm/crds/apps.kubeblocks.io_rollouts.yaml
@@ -3076,6 +3076,3063 @@ spec:
                                           - Ignore: node taints are ignored. All nodes are included.
 
 
+                                          If this value is nil, the behavior is equivalent to the Ignore policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      topologyKey:
+                                        description: |-
+                                          TopologyKey is the key of node labels. Nodes that have a label with this key
+                                          and identical values are considered to be in the same topology.
+                                          We consider each <key, value> as a "bucket", and try to put balanced number
+                                          of pods into each bucket.
+                                          We define a domain as a particular instance of a topology.
+                                          Also, we define an eligible domain as a domain whose nodes meet the requirements of
+                                          nodeAffinityPolicy and nodeTaintsPolicy.
+                                          e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
+                                          And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
+                                          It's a required field.
+                                        type: string
+                                      whenUnsatisfiable:
+                                        description: |-
+                                          WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
+                                          the spread constraint.
+                                          - DoNotSchedule (default) tells the scheduler not to schedule it.
+                                          - ScheduleAnyway tells the scheduler to schedule the pod in any location,
+                                            but giving higher precedence to topologies that would help reduce the
+                                            skew.
+                                          A constraint is considered "Unsatisfiable" for an incoming pod
+                                          if and only if every possible node assignment for that pod would violate
+                                          "MaxSkew" on some topology.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 3/1/1:
+                                          | zone1 | zone2 | zone3 |
+                                          | P P P |   P   |   P   |
+                                          If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
+                                          to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
+                                          MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
+                                          won't make it *more* imbalanced.
+                                          It's a required field.
+                                        type: string
+                                    required:
+                                    - maxSkew
+                                    - topologyKey
+                                    - whenUnsatisfiable
+                                    type: object
+                                  type: array
+                              type: object
+                          type: object
+                      type: object
+                  required:
+                  - name
+                  - strategy
+                  type: object
+                maxItems: 128
+                minItems: 1
+                type: array
+              shardings:
+                description: Specifies the target shardings to be rolled out.
+                items:
+                  properties:
+                    compDef:
+                      description: Specifies the target ComponentDefinition of the
+                        sharding.
+                      maxLength: 64
+                      type: string
+                    instanceMeta:
+                      description: Additional meta for the instances.
+                      properties:
+                        canary:
+                          description: Meta added to the new instances.
+                          properties:
+                            annotations:
+                              additionalProperties:
+                                type: string
+                              type: object
+                            labels:
+                              additionalProperties:
+                                type: string
+                              type: object
+                          type: object
+                      type: object
+                    name:
+                      description: Specifies the name of the sharding.
+                      maxLength: 22
+                      pattern: ^[a-z]([a-z0-9\-]*[a-z0-9])?$
+                      type: string
+                    serviceVersion:
+                      description: Specifies the target ServiceVersion of the sharding.
+                      maxLength: 32
+                      type: string
+                    shardingDef:
+                      description: Specifies the target ShardingDefinition of the
+                        sharding.
+                      maxLength: 32
+                      type: string
+                    strategy:
+                      description: Specifies the rollout strategy for the sharding.
+                      properties:
+                        create:
+                          description: |-
+                            Create rollout strategy.
+
+
+                            If specified, the rollout will be performed by creating new instances.
+                          properties:
+                            canary:
+                              description: Whether to decorate the new instances as
+                                canary instances.
+                              type: boolean
+                            promotion:
+                              description: Specifies the promotion strategy for the
+                                component.
+                              properties:
+                                auto:
+                                  description: Specifies whether to automatically
+                                    promote the new instances.
+                                  type: boolean
+                                condition:
+                                  description: The condition for promoting the new
+                                    instances.
+                                  properties:
+                                    post:
+                                      description: The condition after promoting the
+                                        new instances successfully.
+                                      properties:
+                                        exec:
+                                          description: |-
+                                            Defines the command to run.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            args:
+                                              description: Args represents the arguments
+                                                that are passed to the `command` for
+                                                execution.
+                                              items:
+                                                type: string
+                                              type: array
+                                            command:
+                                              description: |-
+                                                Specifies the command to be executed inside the container.
+                                                The working directory for this command is the container's root directory('/').
+                                                Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
+                                                If the shell is required, it must be explicitly invoked in the command.
+
+
+                                                A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
+                                              items:
+                                                type: string
+                                              type: array
+                                            container:
+                                              description: |-
+                                                Specifies the name of the container within the same pod whose resources will be shared with the action.
+                                                This allows the action to utilize the specified container's resources without executing within it.
+
+
+                                                The name must match one of the containers defined in `componentDefinition.spec.runtime`.
+
+
+                                                The resources that can be shared are included:
+
+
+                                                - volume mounts
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            env:
+                                              description: |-
+                                                Represents a list of environment variables that will be injected into the container.
+                                                These variables enable the container to adapt its behavior based on the environment it's running in.
+
+
+                                                This field cannot be updated.
+                                              items:
+                                                description: EnvVar represents an
+                                                  environment variable present in
+                                                  a Container.
+                                                properties:
+                                                  name:
+                                                    description: Name of the environment
+                                                      variable. Must be a C_IDENTIFIER.
+                                                    type: string
+                                                  value:
+                                                    description: |-
+                                                      Variable references $(VAR_NAME) are expanded
+                                                      using the previously defined environment variables in the container and
+                                                      any service environment variables. If a variable cannot be resolved,
+                                                      the reference in the input string will be unchanged. Double $$ are reduced
+                                                      to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
+                                                      "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
+                                                      Escaped references will never be expanded, regardless of whether the variable
+                                                      exists or not.
+                                                      Defaults to "".
+                                                    type: string
+                                                  valueFrom:
+                                                    description: Source for the environment
+                                                      variable's value. Cannot be
+                                                      used if value is not empty.
+                                                    properties:
+                                                      configMapKeyRef:
+                                                        description: Selects a key
+                                                          of a ConfigMap.
+                                                        properties:
+                                                          key:
+                                                            description: The key to
+                                                              select.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the ConfigMap or its
+                                                              key must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      fieldRef:
+                                                        description: |-
+                                                          Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
+                                                          spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+                                                        properties:
+                                                          apiVersion:
+                                                            description: Version of
+                                                              the schema the FieldPath
+                                                              is written in terms
+                                                              of, defaults to "v1".
+                                                            type: string
+                                                          fieldPath:
+                                                            description: Path of the
+                                                              field to select in the
+                                                              specified API version.
+                                                            type: string
+                                                        required:
+                                                        - fieldPath
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      resourceFieldRef:
+                                                        description: |-
+                                                          Selects a resource of the container: only resources limits and requests
+                                                          (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+                                                        properties:
+                                                          containerName:
+                                                            description: 'Container
+                                                              name: required for volumes,
+                                                              optional for env vars'
+                                                            type: string
+                                                          divisor:
+                                                            anyOf:
+                                                            - type: integer
+                                                            - type: string
+                                                            description: Specifies
+                                                              the output format of
+                                                              the exposed resources,
+                                                              defaults to "1"
+                                                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
+                                                            x-kubernetes-int-or-string: true
+                                                          resource:
+                                                            description: 'Required:
+                                                              resource to select'
+                                                            type: string
+                                                        required:
+                                                        - resource
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      secretKeyRef:
+                                                        description: Selects a key
+                                                          of a secret in the pod's
+                                                          namespace
+                                                        properties:
+                                                          key:
+                                                            description: The key of
+                                                              the secret to select
+                                                              from.  Must be a valid
+                                                              secret key.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the Secret or its key
+                                                              must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                    type: object
+                                                required:
+                                                - name
+                                                type: object
+                                              type: array
+                                            image:
+                                              description: |-
+                                                Specifies the container image to be used for running the Action.
+
+
+                                                When specified, a dedicated container will be created using this image to execute the Action.
+                                                All actions with same image will share the same container.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            matchingKey:
+                                              description: |-
+                                                Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
+                                                The impact of this field depends on the `targetPodSelector` value:
+
+
+                                                - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
+                                                - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
+                                                  will be selected for the Action.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            targetPodSelector:
+                                              description: |-
+                                                Defines the criteria used to select the target Pod(s) for executing the Action.
+                                                This is useful when there is no default target replica identified.
+                                                It allows for precise control over which Pod(s) the Action should run in.
+
+
+                                                If not specified, the Action will be executed in the pod where the Action is triggered, such as the pod
+                                                to be removed or added; or a random pod if the Action is triggered at the component level, such as
+                                                post-provision or pre-terminate of the component.
+
+
+                                                This field cannot be updated.
+                                              enum:
+                                              - Any
+                                              - All
+                                              - Role
+                                              - Ordinal
+                                              type: string
+                                          type: object
+                                        preCondition:
+                                          description: |-
+                                            Specifies the state that the cluster must reach before the Action is executed.
+                                            Currently, this is only applicable to the `postProvision` action.
+
+
+                                            The conditions are as follows:
+
+
+                                            - `Immediately`: Executed right after the Component object is created.
+                                              The readiness of the Component and its resources is not guaranteed at this stage.
+                                            - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
+                                              runtime resources (e.g. Pods) are in a ready state.
+                                            - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
+                                              This process does not affect the readiness state of the Component or the Cluster.
+                                            - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
+                                              This execution does not alter the Component or the Cluster's state of readiness.
+
+
+                                            This field cannot be updated.
+                                          type: string
+                                        retryPolicy:
+                                          description: |-
+                                            Defines the strategy to be taken when retrying the Action after a failure.
+
+
+                                            It specifies the conditions under which the Action should be retried and the limits to apply,
+                                            such as the maximum number of retries and backoff strategy.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            maxRetries:
+                                              default: 0
+                                              description: |-
+                                                Defines the maximum number of retry attempts that should be made for a given Action.
+                                                This value is set to 0 by default, indicating that no retries will be made.
+                                              type: integer
+                                            retryInterval:
+                                              default: 0
+                                              description: |-
+                                                Indicates the duration of time to wait between each retry attempt.
+                                                This value is set to 0 by default, indicating that there will be no delay between retry attempts.
+                                              format: int64
+                                              type: integer
+                                          type: object
+                                        timeoutSeconds:
+                                          default: 0
+                                          description: |-
+                                            Specifies the maximum duration in seconds that the Action is allowed to run.
+
+
+                                            If the Action does not complete within this time frame, it will be terminated.
+
+
+                                            This field cannot be updated.
+                                          format: int32
+                                          type: integer
+                                      type: object
+                                    prev:
+                                      description: |-
+                                        The condition before promoting the new instances.
+
+
+                                        If specified, the new instances will be promoted only when the condition is met.
+                                      properties:
+                                        exec:
+                                          description: |-
+                                            Defines the command to run.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            args:
+                                              description: Args represents the arguments
+                                                that are passed to the `command` for
+                                                execution.
+                                              items:
+                                                type: string
+                                              type: array
+                                            command:
+                                              description: |-
+                                                Specifies the command to be executed inside the container.
+                                                The working directory for this command is the container's root directory('/').
+                                                Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
+                                                If the shell is required, it must be explicitly invoked in the command.
+
+
+                                                A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
+                                              items:
+                                                type: string
+                                              type: array
+                                            container:
+                                              description: |-
+                                                Specifies the name of the container within the same pod whose resources will be shared with the action.
+                                                This allows the action to utilize the specified container's resources without executing within it.
+
+
+                                                The name must match one of the containers defined in `componentDefinition.spec.runtime`.
+
+
+                                                The resources that can be shared are included:
+
+
+                                                - volume mounts
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            env:
+                                              description: |-
+                                                Represents a list of environment variables that will be injected into the container.
+                                                These variables enable the container to adapt its behavior based on the environment it's running in.
+
+
+                                                This field cannot be updated.
+                                              items:
+                                                description: EnvVar represents an
+                                                  environment variable present in
+                                                  a Container.
+                                                properties:
+                                                  name:
+                                                    description: Name of the environment
+                                                      variable. Must be a C_IDENTIFIER.
+                                                    type: string
+                                                  value:
+                                                    description: |-
+                                                      Variable references $(VAR_NAME) are expanded
+                                                      using the previously defined environment variables in the container and
+                                                      any service environment variables. If a variable cannot be resolved,
+                                                      the reference in the input string will be unchanged. Double $$ are reduced
+                                                      to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
+                                                      "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
+                                                      Escaped references will never be expanded, regardless of whether the variable
+                                                      exists or not.
+                                                      Defaults to "".
+                                                    type: string
+                                                  valueFrom:
+                                                    description: Source for the environment
+                                                      variable's value. Cannot be
+                                                      used if value is not empty.
+                                                    properties:
+                                                      configMapKeyRef:
+                                                        description: Selects a key
+                                                          of a ConfigMap.
+                                                        properties:
+                                                          key:
+                                                            description: The key to
+                                                              select.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the ConfigMap or its
+                                                              key must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      fieldRef:
+                                                        description: |-
+                                                          Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
+                                                          spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+                                                        properties:
+                                                          apiVersion:
+                                                            description: Version of
+                                                              the schema the FieldPath
+                                                              is written in terms
+                                                              of, defaults to "v1".
+                                                            type: string
+                                                          fieldPath:
+                                                            description: Path of the
+                                                              field to select in the
+                                                              specified API version.
+                                                            type: string
+                                                        required:
+                                                        - fieldPath
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      resourceFieldRef:
+                                                        description: |-
+                                                          Selects a resource of the container: only resources limits and requests
+                                                          (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+                                                        properties:
+                                                          containerName:
+                                                            description: 'Container
+                                                              name: required for volumes,
+                                                              optional for env vars'
+                                                            type: string
+                                                          divisor:
+                                                            anyOf:
+                                                            - type: integer
+                                                            - type: string
+                                                            description: Specifies
+                                                              the output format of
+                                                              the exposed resources,
+                                                              defaults to "1"
+                                                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
+                                                            x-kubernetes-int-or-string: true
+                                                          resource:
+                                                            description: 'Required:
+                                                              resource to select'
+                                                            type: string
+                                                        required:
+                                                        - resource
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                      secretKeyRef:
+                                                        description: Selects a key
+                                                          of a secret in the pod's
+                                                          namespace
+                                                        properties:
+                                                          key:
+                                                            description: The key of
+                                                              the secret to select
+                                                              from.  Must be a valid
+                                                              secret key.
+                                                            type: string
+                                                          name:
+                                                            description: |-
+                                                              Name of the referent.
+                                                              More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+                                                              TODO: Add other useful fields. apiVersion, kind, uid?
+                                                            type: string
+                                                          optional:
+                                                            description: Specify whether
+                                                              the Secret or its key
+                                                              must be defined
+                                                            type: boolean
+                                                        required:
+                                                        - key
+                                                        type: object
+                                                        x-kubernetes-map-type: atomic
+                                                    type: object
+                                                required:
+                                                - name
+                                                type: object
+                                              type: array
+                                            image:
+                                              description: |-
+                                                Specifies the container image to be used for running the Action.
+
+
+                                                When specified, a dedicated container will be created using this image to execute the Action.
+                                                All actions with same image will share the same container.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            matchingKey:
+                                              description: |-
+                                                Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
+                                                The impact of this field depends on the `targetPodSelector` value:
+
+
+                                                - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
+                                                - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
+                                                  will be selected for the Action.
+
+
+                                                This field cannot be updated.
+                                              type: string
+                                            targetPodSelector:
+                                              description: |-
+                                                Defines the criteria used to select the target Pod(s) for executing the Action.
+                                                This is useful when there is no default target replica identified.
+                                                It allows for precise control over which Pod(s) the Action should run in.
+
+
+                                                If not specified, the Action will be executed in the pod where the Action is triggered, such as the pod
+                                                to be removed or added; or a random pod if the Action is triggered at the component level, such as
+                                                post-provision or pre-terminate of the component.
+
+
+                                                This field cannot be updated.
+                                              enum:
+                                              - Any
+                                              - All
+                                              - Role
+                                              - Ordinal
+                                              type: string
+                                          type: object
+                                        preCondition:
+                                          description: |-
+                                            Specifies the state that the cluster must reach before the Action is executed.
+                                            Currently, this is only applicable to the `postProvision` action.
+
+
+                                            The conditions are as follows:
+
+
+                                            - `Immediately`: Executed right after the Component object is created.
+                                              The readiness of the Component and its resources is not guaranteed at this stage.
+                                            - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
+                                              runtime resources (e.g. Pods) are in a ready state.
+                                            - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
+                                              This process does not affect the readiness state of the Component or the Cluster.
+                                            - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
+                                              This execution does not alter the Component or the Cluster's state of readiness.
+
+
+                                            This field cannot be updated.
+                                          type: string
+                                        retryPolicy:
+                                          description: |-
+                                            Defines the strategy to be taken when retrying the Action after a failure.
+
+
+                                            It specifies the conditions under which the Action should be retried and the limits to apply,
+                                            such as the maximum number of retries and backoff strategy.
+
+
+                                            This field cannot be updated.
+                                          properties:
+                                            maxRetries:
+                                              default: 0
+                                              description: |-
+                                                Defines the maximum number of retry attempts that should be made for a given Action.
+                                                This value is set to 0 by default, indicating that no retries will be made.
+                                              type: integer
+                                            retryInterval:
+                                              default: 0
+                                              description: |-
+                                                Indicates the duration of time to wait between each retry attempt.
+                                                This value is set to 0 by default, indicating that there will be no delay between retry attempts.
+                                              format: int64
+                                              type: integer
+                                          type: object
+                                        timeoutSeconds:
+                                          default: 0
+                                          description: |-
+                                            Specifies the maximum duration in seconds that the Action is allowed to run.
+
+
+                                            If the Action does not complete within this time frame, it will be terminated.
+
+
+                                            This field cannot be updated.
+                                          format: int32
+                                          type: integer
+                                      type: object
+                                  type: object
+                                delaySeconds:
+                                  default: 30
+                                  description: The delay seconds before promoting
+                                    the new instances.
+                                  format: int32
+                                  type: integer
+                                scaleDownDelaySeconds:
+                                  default: 30
+                                  description: The delay seconds before scaling down
+                                    the old instances.
+                                  format: int32
+                                  type: integer
+                              type: object
+                            schedulingPolicy:
+                              description: Specifies the scheduling policy for the
+                                new instance.
+                              properties:
+                                affinity:
+                                  description: Specifies a group of affinity scheduling
+                                    rules of the Cluster, including NodeAffinity,
+                                    PodAffinity, and PodAntiAffinity.
+                                  properties:
+                                    nodeAffinity:
+                                      description: Describes node affinity scheduling
+                                        rules for the pod.
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node matches the corresponding matchExpressions; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: |-
+                                              An empty preferred scheduling term matches all objects with implicit weight 0
+                                              (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
+                                            properties:
+                                              preference:
+                                                description: A node selector term,
+                                                  associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              weight:
+                                                description: Weight associated with
+                                                  matching the corresponding nodeSelectorTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - preference
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to an update), the system
+                                            may or may not try to eventually evict the pod from its node.
+                                          properties:
+                                            nodeSelectorTerms:
+                                              description: Required. A list of node
+                                                selector terms. The terms are ORed.
+                                              items:
+                                                description: |-
+                                                  A null or empty node selector term matches no objects. The requirements of
+                                                  them are ANDed.
+                                                  The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              type: array
+                                          required:
+                                          - nodeSelectorTerms
+                                          type: object
+                                          x-kubernetes-map-type: atomic
+                                      type: object
+                                    podAffinity:
+                                      description: Describes pod affinity scheduling
+                                        rules (e.g. co-locate this pod in the same
+                                        node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                    podAntiAffinity:
+                                      description: Describes pod anti-affinity scheduling
+                                        rules (e.g. avoid putting this pod in the
+                                        same node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the anti-affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling anti-affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the anti-affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the anti-affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                  type: object
+                                nodeName:
+                                  description: |-
+                                    NodeName is a request to schedule this Pod onto a specific node. If it is non-empty,
+                                    the scheduler simply schedules this Pod onto that node, assuming that it fits resource
+                                    requirements.
+                                  type: string
+                                nodeSelector:
+                                  additionalProperties:
+                                    type: string
+                                  description: |-
+                                    NodeSelector is a selector which must be true for the Pod to fit on a node.
+                                    Selector which must match a node's labels for the Pod to be scheduled on that node.
+                                    More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+                                  type: object
+                                  x-kubernetes-map-type: atomic
+                                schedulerName:
+                                  description: |-
+                                    If specified, the Pod will be dispatched by specified scheduler.
+                                    If not specified, the Pod will be dispatched by default scheduler.
+                                  type: string
+                                tolerations:
+                                  description: |-
+                                    Allows Pods to be scheduled onto nodes with matching taints.
+                                    Each toleration in the array allows the Pod to tolerate node taints based on
+                                    specified `key`, `value`, `effect`, and `operator`.
+
+
+                                    - The `key`, `value`, and `effect` identify the taint that the toleration matches.
+                                    - The `operator` determines how the toleration matches the taint.
+
+
+                                    Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes.
+                                  items:
+                                    description: |-
+                                      The pod this Toleration is attached to tolerates any taint that matches
+                                      the triple <key,value,effect> using the matching operator <operator>.
+                                    properties:
+                                      effect:
+                                        description: |-
+                                          Effect indicates the taint effect to match. Empty means match all taint effects.
+                                          When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
+                                        type: string
+                                      key:
+                                        description: |-
+                                          Key is the taint key that the toleration applies to. Empty means match all taint keys.
+                                          If the key is empty, operator must be Exists; this combination means to match all values and all keys.
+                                        type: string
+                                      operator:
+                                        description: |-
+                                          Operator represents a key's relationship to the value.
+                                          Valid operators are Exists and Equal. Defaults to Equal.
+                                          Exists is equivalent to wildcard for value, so that a pod can
+                                          tolerate all taints of a particular category.
+                                        type: string
+                                      tolerationSeconds:
+                                        description: |-
+                                          TolerationSeconds represents the period of time the toleration (which must be
+                                          of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
+                                          it is not set, which means tolerate the taint forever (do not evict). Zero and
+                                          negative values will be treated as 0 (evict immediately) by the system.
+                                        format: int64
+                                        type: integer
+                                      value:
+                                        description: |-
+                                          Value is the taint value the toleration matches to.
+                                          If the operator is Exists, the value should be empty, otherwise just a regular string.
+                                        type: string
+                                    type: object
+                                  type: array
+                                topologySpreadConstraints:
+                                  description: |-
+                                    TopologySpreadConstraints describes how a group of Pods ought to spread across topology
+                                    domains. Scheduler will schedule Pods in a way which abides by the constraints.
+                                    All topologySpreadConstraints are ANDed.
+                                  items:
+                                    description: TopologySpreadConstraint specifies
+                                      how to spread matching pods among the given
+                                      topology.
+                                    properties:
+                                      labelSelector:
+                                        description: |-
+                                          LabelSelector is used to find matching pods.
+                                          Pods that match this label selector are counted to determine the number of pods
+                                          in their corresponding topology domain.
+                                        properties:
+                                          matchExpressions:
+                                            description: matchExpressions is a list
+                                              of label selector requirements. The
+                                              requirements are ANDed.
+                                            items:
+                                              description: |-
+                                                A label selector requirement is a selector that contains values, a key, and an operator that
+                                                relates the key and values.
+                                              properties:
+                                                key:
+                                                  description: key is the label key
+                                                    that the selector applies to.
+                                                  type: string
+                                                operator:
+                                                  description: |-
+                                                    operator represents a key's relationship to a set of values.
+                                                    Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                  type: string
+                                                values:
+                                                  description: |-
+                                                    values is an array of string values. If the operator is In or NotIn,
+                                                    the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                    the values array must be empty. This array is replaced during a strategic
+                                                    merge patch.
+                                                  items:
+                                                    type: string
+                                                  type: array
+                                              required:
+                                              - key
+                                              - operator
+                                              type: object
+                                            type: array
+                                          matchLabels:
+                                            additionalProperties:
+                                              type: string
+                                            description: |-
+                                              matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                              map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                              operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                            type: object
+                                        type: object
+                                        x-kubernetes-map-type: atomic
+                                      matchLabelKeys:
+                                        description: |-
+                                          MatchLabelKeys is a set of pod label keys to select the pods over which
+                                          spreading will be calculated. The keys are used to lookup values from the
+                                          incoming pod labels, those key-value labels are ANDed with labelSelector
+                                          to select the group of existing pods over which spreading will be calculated
+                                          for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                          MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                          Keys that don't exist in the incoming pod labels will
+                                          be ignored. A null or empty list means only match against labelSelector.
+
+
+                                          This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        items:
+                                          type: string
+                                        type: array
+                                        x-kubernetes-list-type: atomic
+                                      maxSkew:
+                                        description: |-
+                                          MaxSkew describes the degree to which pods may be unevenly distributed.
+                                          When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
+                                          between the number of matching pods in the target topology and the global minimum.
+                                          The global minimum is the minimum number of matching pods in an eligible domain
+                                          or zero if the number of eligible domains is less than MinDomains.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 2/2/1:
+                                          In this case, the global minimum is 1.
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |   P   |
+                                          - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
+                                          scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
+                                          violate MaxSkew(1).
+                                          - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
+                                          When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
+                                          to topologies that satisfy it.
+                                          It's a required field. Default value is 1 and 0 is not allowed.
+                                        format: int32
+                                        type: integer
+                                      minDomains:
+                                        description: |-
+                                          MinDomains indicates a minimum number of eligible domains.
+                                          When the number of eligible domains with matching topology keys is less than minDomains,
+                                          Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
+                                          And when the number of eligible domains with matching topology keys equals or greater than minDomains,
+                                          this value has no effect on scheduling.
+                                          As a result, when the number of eligible domains is less than minDomains,
+                                          scheduler won't schedule more than maxSkew Pods to those domains.
+                                          If value is nil, the constraint behaves as if MinDomains is equal to 1.
+                                          Valid values are integers greater than 0.
+                                          When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
+
+
+                                          For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
+                                          labelSelector spread as 2/2/2:
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |  P P  |
+                                          The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
+                                          In this situation, new pod with the same labelSelector cannot be scheduled,
+                                          because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
+                                          it will violate MaxSkew.
+
+
+                                          This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        format: int32
+                                        type: integer
+                                      nodeAffinityPolicy:
+                                        description: |-
+                                          NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
+                                          when calculating pod topology spread skew. Options are:
+                                          - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
+                                          - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
+
+
+                                          If this value is nil, the behavior is equivalent to the Honor policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      nodeTaintsPolicy:
+                                        description: |-
+                                          NodeTaintsPolicy indicates how we will treat node taints when calculating
+                                          pod topology spread skew. Options are:
+                                          - Honor: nodes without taints, along with tainted nodes for which the incoming pod
+                                          has a toleration, are included.
+                                          - Ignore: node taints are ignored. All nodes are included.
+
+
+                                          If this value is nil, the behavior is equivalent to the Ignore policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      topologyKey:
+                                        description: |-
+                                          TopologyKey is the key of node labels. Nodes that have a label with this key
+                                          and identical values are considered to be in the same topology.
+                                          We consider each <key, value> as a "bucket", and try to put balanced number
+                                          of pods into each bucket.
+                                          We define a domain as a particular instance of a topology.
+                                          Also, we define an eligible domain as a domain whose nodes meet the requirements of
+                                          nodeAffinityPolicy and nodeTaintsPolicy.
+                                          e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
+                                          And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
+                                          It's a required field.
+                                        type: string
+                                      whenUnsatisfiable:
+                                        description: |-
+                                          WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
+                                          the spread constraint.
+                                          - DoNotSchedule (default) tells the scheduler not to schedule it.
+                                          - ScheduleAnyway tells the scheduler to schedule the pod in any location,
+                                            but giving higher precedence to topologies that would help reduce the
+                                            skew.
+                                          A constraint is considered "Unsatisfiable" for an incoming pod
+                                          if and only if every possible node assignment for that pod would violate
+                                          "MaxSkew" on some topology.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 3/1/1:
+                                          | zone1 | zone2 | zone3 |
+                                          | P P P |   P   |   P   |
+                                          If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
+                                          to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
+                                          MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
+                                          won't make it *more* imbalanced.
+                                          It's a required field.
+                                        type: string
+                                    required:
+                                    - maxSkew
+                                    - topologyKey
+                                    - whenUnsatisfiable
+                                    type: object
+                                  type: array
+                              type: object
+                          type: object
+                        inplace:
+                          description: |-
+                            In-place rollout strategy.
+
+
+                            If specified, the rollout will be performed in-place (delete and then create).
+                          type: object
+                        replace:
+                          description: |-
+                            Replace rollout strategy.
+
+
+                            If specified, the rollout will be performed by replacing the old instances with new instances one by one (create and then delete).
+                          properties:
+                            perInstanceIntervalSeconds:
+                              description: The number of seconds to wait between rolling
+                                out two instances.
+                              format: int32
+                              type: integer
+                            scaleDownDelaySeconds:
+                              description: The number of seconds to wait before scaling
+                                down an old instance, after the new instance becomes
+                                ready.
+                              format: int32
+                              type: integer
+                            schedulingPolicy:
+                              description: Specifies the scheduling policy for the
+                                new instance.
+                              properties:
+                                affinity:
+                                  description: Specifies a group of affinity scheduling
+                                    rules of the Cluster, including NodeAffinity,
+                                    PodAffinity, and PodAntiAffinity.
+                                  properties:
+                                    nodeAffinity:
+                                      description: Describes node affinity scheduling
+                                        rules for the pod.
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node matches the corresponding matchExpressions; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: |-
+                                              An empty preferred scheduling term matches all objects with implicit weight 0
+                                              (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
+                                            properties:
+                                              preference:
+                                                description: A node selector term,
+                                                  associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              weight:
+                                                description: Weight associated with
+                                                  matching the corresponding nodeSelectorTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - preference
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to an update), the system
+                                            may or may not try to eventually evict the pod from its node.
+                                          properties:
+                                            nodeSelectorTerms:
+                                              description: Required. A list of node
+                                                selector terms. The terms are ORed.
+                                              items:
+                                                description: |-
+                                                  A null or empty node selector term matches no objects. The requirements of
+                                                  them are ANDed.
+                                                  The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: A list of node selector
+                                                      requirements by node's labels.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchFields:
+                                                    description: A list of node selector
+                                                      requirements by node's fields.
+                                                    items:
+                                                      description: |-
+                                                        A node selector requirement is a selector that contains values, a key, and an operator
+                                                        that relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: The label key
+                                                            that the selector applies
+                                                            to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            Represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            An array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. If the operator is Gt or Lt, the values
+                                                            array must have a single element, which will be interpreted as an integer.
+                                                            This array is replaced during a strategic merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              type: array
+                                          required:
+                                          - nodeSelectorTerms
+                                          type: object
+                                          x-kubernetes-map-type: atomic
+                                      type: object
+                                    podAffinity:
+                                      description: Describes pod affinity scheduling
+                                        rules (e.g. co-locate this pod in the same
+                                        node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                    podAntiAffinity:
+                                      description: Describes pod anti-affinity scheduling
+                                        rules (e.g. avoid putting this pod in the
+                                        same node, zone, etc. as some other pod(s)).
+                                      properties:
+                                        preferredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            The scheduler will prefer to schedule pods to nodes that satisfy
+                                            the anti-affinity expressions specified by this field, but it may choose
+                                            a node that violates one or more of the expressions. The node that is
+                                            most preferred is the one with the greatest sum of weights, i.e.
+                                            for each node that meets all of the scheduling requirements (resource
+                                            request, requiredDuringScheduling anti-affinity expressions, etc.),
+                                            compute a sum by iterating through the elements of this field and adding
+                                            "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
+                                            node(s) with the highest sum are the most preferred.
+                                          items:
+                                            description: The weights of all of the
+                                              matched WeightedPodAffinityTerm fields
+                                              are added per-node to find the most
+                                              preferred node(s)
+                                            properties:
+                                              podAffinityTerm:
+                                                description: Required. A pod affinity
+                                                  term, associated with the corresponding
+                                                  weight.
+                                                properties:
+                                                  labelSelector:
+                                                    description: |-
+                                                      A label query over a set of resources, in this case pods.
+                                                      If it's null, this PodAffinityTerm matches with no Pods.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  matchLabelKeys:
+                                                    description: |-
+                                                      MatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                      Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  mismatchLabelKeys:
+                                                    description: |-
+                                                      MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                      be taken into consideration. The keys are used to lookup values from the
+                                                      incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                      to select the group of existing pods which pods will be taken into consideration
+                                                      for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                      pod labels will be ignored. The default value is empty.
+                                                      The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                      Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                      This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                    x-kubernetes-list-type: atomic
+                                                  namespaceSelector:
+                                                    description: |-
+                                                      A label query over the set of namespaces that the term applies to.
+                                                      The term is applied to the union of the namespaces selected by this field
+                                                      and the ones listed in the namespaces field.
+                                                      null selector and null or empty namespaces list means "this pod's namespace".
+                                                      An empty selector ({}) matches all namespaces.
+                                                    properties:
+                                                      matchExpressions:
+                                                        description: matchExpressions
+                                                          is a list of label selector
+                                                          requirements. The requirements
+                                                          are ANDed.
+                                                        items:
+                                                          description: |-
+                                                            A label selector requirement is a selector that contains values, a key, and an operator that
+                                                            relates the key and values.
+                                                          properties:
+                                                            key:
+                                                              description: key is
+                                                                the label key that
+                                                                the selector applies
+                                                                to.
+                                                              type: string
+                                                            operator:
+                                                              description: |-
+                                                                operator represents a key's relationship to a set of values.
+                                                                Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                              type: string
+                                                            values:
+                                                              description: |-
+                                                                values is an array of string values. If the operator is In or NotIn,
+                                                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                                the values array must be empty. This array is replaced during a strategic
+                                                                merge patch.
+                                                              items:
+                                                                type: string
+                                                              type: array
+                                                          required:
+                                                          - key
+                                                          - operator
+                                                          type: object
+                                                        type: array
+                                                      matchLabels:
+                                                        additionalProperties:
+                                                          type: string
+                                                        description: |-
+                                                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                          map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                          operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                        type: object
+                                                    type: object
+                                                    x-kubernetes-map-type: atomic
+                                                  namespaces:
+                                                    description: |-
+                                                      namespaces specifies a static list of namespace names that the term applies to.
+                                                      The term is applied to the union of the namespaces listed in this field
+                                                      and the ones selected by namespaceSelector.
+                                                      null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                    items:
+                                                      type: string
+                                                    type: array
+                                                  topologyKey:
+                                                    description: |-
+                                                      This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                      the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                      whose value of the label with key topologyKey matches that of any node on which any of the
+                                                      selected pods is running.
+                                                      Empty topologyKey is not allowed.
+                                                    type: string
+                                                required:
+                                                - topologyKey
+                                                type: object
+                                              weight:
+                                                description: |-
+                                                  weight associated with matching the corresponding podAffinityTerm,
+                                                  in the range 1-100.
+                                                format: int32
+                                                type: integer
+                                            required:
+                                            - podAffinityTerm
+                                            - weight
+                                            type: object
+                                          type: array
+                                        requiredDuringSchedulingIgnoredDuringExecution:
+                                          description: |-
+                                            If the anti-affinity requirements specified by this field are not met at
+                                            scheduling time, the pod will not be scheduled onto the node.
+                                            If the anti-affinity requirements specified by this field cease to be met
+                                            at some point during pod execution (e.g. due to a pod label update), the
+                                            system may or may not try to eventually evict the pod from its node.
+                                            When there are multiple elements, the lists of nodes corresponding to each
+                                            podAffinityTerm are intersected, i.e. all terms must be satisfied.
+                                          items:
+                                            description: |-
+                                              Defines a set of pods (namely those matching the labelSelector
+                                              relative to the given namespace(s)) that this pod should be
+                                              co-located (affinity) or not co-located (anti-affinity) with,
+                                              where co-located is defined as running on a node whose value of
+                                              the label with key <topologyKey> matches that of any node on which
+                                              a pod of the set of pods is running
+                                            properties:
+                                              labelSelector:
+                                                description: |-
+                                                  A label query over a set of resources, in this case pods.
+                                                  If it's null, this PodAffinityTerm matches with no Pods.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              matchLabelKeys:
+                                                description: |-
+                                                  MatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                                  Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              mismatchLabelKeys:
+                                                description: |-
+                                                  MismatchLabelKeys is a set of pod label keys to select which pods will
+                                                  be taken into consideration. The keys are used to lookup values from the
+                                                  incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
+                                                  to select the group of existing pods which pods will be taken into consideration
+                                                  for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
+                                                  pod labels will be ignored. The default value is empty.
+                                                  The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
+                                                  Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
+                                                  This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
+                                                items:
+                                                  type: string
+                                                type: array
+                                                x-kubernetes-list-type: atomic
+                                              namespaceSelector:
+                                                description: |-
+                                                  A label query over the set of namespaces that the term applies to.
+                                                  The term is applied to the union of the namespaces selected by this field
+                                                  and the ones listed in the namespaces field.
+                                                  null selector and null or empty namespaces list means "this pod's namespace".
+                                                  An empty selector ({}) matches all namespaces.
+                                                properties:
+                                                  matchExpressions:
+                                                    description: matchExpressions
+                                                      is a list of label selector
+                                                      requirements. The requirements
+                                                      are ANDed.
+                                                    items:
+                                                      description: |-
+                                                        A label selector requirement is a selector that contains values, a key, and an operator that
+                                                        relates the key and values.
+                                                      properties:
+                                                        key:
+                                                          description: key is the
+                                                            label key that the selector
+                                                            applies to.
+                                                          type: string
+                                                        operator:
+                                                          description: |-
+                                                            operator represents a key's relationship to a set of values.
+                                                            Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                          type: string
+                                                        values:
+                                                          description: |-
+                                                            values is an array of string values. If the operator is In or NotIn,
+                                                            the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                            the values array must be empty. This array is replaced during a strategic
+                                                            merge patch.
+                                                          items:
+                                                            type: string
+                                                          type: array
+                                                      required:
+                                                      - key
+                                                      - operator
+                                                      type: object
+                                                    type: array
+                                                  matchLabels:
+                                                    additionalProperties:
+                                                      type: string
+                                                    description: |-
+                                                      matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                                      map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                                      operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                                    type: object
+                                                type: object
+                                                x-kubernetes-map-type: atomic
+                                              namespaces:
+                                                description: |-
+                                                  namespaces specifies a static list of namespace names that the term applies to.
+                                                  The term is applied to the union of the namespaces listed in this field
+                                                  and the ones selected by namespaceSelector.
+                                                  null or empty namespaces list and null namespaceSelector means "this pod's namespace".
+                                                items:
+                                                  type: string
+                                                type: array
+                                              topologyKey:
+                                                description: |-
+                                                  This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
+                                                  the labelSelector in the specified namespaces, where co-located is defined as running on a node
+                                                  whose value of the label with key topologyKey matches that of any node on which any of the
+                                                  selected pods is running.
+                                                  Empty topologyKey is not allowed.
+                                                type: string
+                                            required:
+                                            - topologyKey
+                                            type: object
+                                          type: array
+                                      type: object
+                                  type: object
+                                nodeName:
+                                  description: |-
+                                    NodeName is a request to schedule this Pod onto a specific node. If it is non-empty,
+                                    the scheduler simply schedules this Pod onto that node, assuming that it fits resource
+                                    requirements.
+                                  type: string
+                                nodeSelector:
+                                  additionalProperties:
+                                    type: string
+                                  description: |-
+                                    NodeSelector is a selector which must be true for the Pod to fit on a node.
+                                    Selector which must match a node's labels for the Pod to be scheduled on that node.
+                                    More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+                                  type: object
+                                  x-kubernetes-map-type: atomic
+                                schedulerName:
+                                  description: |-
+                                    If specified, the Pod will be dispatched by specified scheduler.
+                                    If not specified, the Pod will be dispatched by default scheduler.
+                                  type: string
+                                tolerations:
+                                  description: |-
+                                    Allows Pods to be scheduled onto nodes with matching taints.
+                                    Each toleration in the array allows the Pod to tolerate node taints based on
+                                    specified `key`, `value`, `effect`, and `operator`.
+
+
+                                    - The `key`, `value`, and `effect` identify the taint that the toleration matches.
+                                    - The `operator` determines how the toleration matches the taint.
+
+
+                                    Pods with matching tolerations are allowed to be scheduled on tainted nodes, typically reserved for specific purposes.
+                                  items:
+                                    description: |-
+                                      The pod this Toleration is attached to tolerates any taint that matches
+                                      the triple <key,value,effect> using the matching operator <operator>.
+                                    properties:
+                                      effect:
+                                        description: |-
+                                          Effect indicates the taint effect to match. Empty means match all taint effects.
+                                          When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
+                                        type: string
+                                      key:
+                                        description: |-
+                                          Key is the taint key that the toleration applies to. Empty means match all taint keys.
+                                          If the key is empty, operator must be Exists; this combination means to match all values and all keys.
+                                        type: string
+                                      operator:
+                                        description: |-
+                                          Operator represents a key's relationship to the value.
+                                          Valid operators are Exists and Equal. Defaults to Equal.
+                                          Exists is equivalent to wildcard for value, so that a pod can
+                                          tolerate all taints of a particular category.
+                                        type: string
+                                      tolerationSeconds:
+                                        description: |-
+                                          TolerationSeconds represents the period of time the toleration (which must be
+                                          of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
+                                          it is not set, which means tolerate the taint forever (do not evict). Zero and
+                                          negative values will be treated as 0 (evict immediately) by the system.
+                                        format: int64
+                                        type: integer
+                                      value:
+                                        description: |-
+                                          Value is the taint value the toleration matches to.
+                                          If the operator is Exists, the value should be empty, otherwise just a regular string.
+                                        type: string
+                                    type: object
+                                  type: array
+                                topologySpreadConstraints:
+                                  description: |-
+                                    TopologySpreadConstraints describes how a group of Pods ought to spread across topology
+                                    domains. Scheduler will schedule Pods in a way which abides by the constraints.
+                                    All topologySpreadConstraints are ANDed.
+                                  items:
+                                    description: TopologySpreadConstraint specifies
+                                      how to spread matching pods among the given
+                                      topology.
+                                    properties:
+                                      labelSelector:
+                                        description: |-
+                                          LabelSelector is used to find matching pods.
+                                          Pods that match this label selector are counted to determine the number of pods
+                                          in their corresponding topology domain.
+                                        properties:
+                                          matchExpressions:
+                                            description: matchExpressions is a list
+                                              of label selector requirements. The
+                                              requirements are ANDed.
+                                            items:
+                                              description: |-
+                                                A label selector requirement is a selector that contains values, a key, and an operator that
+                                                relates the key and values.
+                                              properties:
+                                                key:
+                                                  description: key is the label key
+                                                    that the selector applies to.
+                                                  type: string
+                                                operator:
+                                                  description: |-
+                                                    operator represents a key's relationship to a set of values.
+                                                    Valid operators are In, NotIn, Exists and DoesNotExist.
+                                                  type: string
+                                                values:
+                                                  description: |-
+                                                    values is an array of string values. If the operator is In or NotIn,
+                                                    the values array must be non-empty. If the operator is Exists or DoesNotExist,
+                                                    the values array must be empty. This array is replaced during a strategic
+                                                    merge patch.
+                                                  items:
+                                                    type: string
+                                                  type: array
+                                              required:
+                                              - key
+                                              - operator
+                                              type: object
+                                            type: array
+                                          matchLabels:
+                                            additionalProperties:
+                                              type: string
+                                            description: |-
+                                              matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+                                              map is equivalent to an element of matchExpressions, whose key field is "key", the
+                                              operator is "In", and the values array contains only "value". The requirements are ANDed.
+                                            type: object
+                                        type: object
+                                        x-kubernetes-map-type: atomic
+                                      matchLabelKeys:
+                                        description: |-
+                                          MatchLabelKeys is a set of pod label keys to select the pods over which
+                                          spreading will be calculated. The keys are used to lookup values from the
+                                          incoming pod labels, those key-value labels are ANDed with labelSelector
+                                          to select the group of existing pods over which spreading will be calculated
+                                          for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
+                                          MatchLabelKeys cannot be set when LabelSelector isn't set.
+                                          Keys that don't exist in the incoming pod labels will
+                                          be ignored. A null or empty list means only match against labelSelector.
+
+
+                                          This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        items:
+                                          type: string
+                                        type: array
+                                        x-kubernetes-list-type: atomic
+                                      maxSkew:
+                                        description: |-
+                                          MaxSkew describes the degree to which pods may be unevenly distributed.
+                                          When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
+                                          between the number of matching pods in the target topology and the global minimum.
+                                          The global minimum is the minimum number of matching pods in an eligible domain
+                                          or zero if the number of eligible domains is less than MinDomains.
+                                          For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
+                                          labelSelector spread as 2/2/1:
+                                          In this case, the global minimum is 1.
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |   P   |
+                                          - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
+                                          scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
+                                          violate MaxSkew(1).
+                                          - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
+                                          When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
+                                          to topologies that satisfy it.
+                                          It's a required field. Default value is 1 and 0 is not allowed.
+                                        format: int32
+                                        type: integer
+                                      minDomains:
+                                        description: |-
+                                          MinDomains indicates a minimum number of eligible domains.
+                                          When the number of eligible domains with matching topology keys is less than minDomains,
+                                          Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
+                                          And when the number of eligible domains with matching topology keys equals or greater than minDomains,
+                                          this value has no effect on scheduling.
+                                          As a result, when the number of eligible domains is less than minDomains,
+                                          scheduler won't schedule more than maxSkew Pods to those domains.
+                                          If value is nil, the constraint behaves as if MinDomains is equal to 1.
+                                          Valid values are integers greater than 0.
+                                          When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
+
+
+                                          For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
+                                          labelSelector spread as 2/2/2:
+                                          | zone1 | zone2 | zone3 |
+                                          |  P P  |  P P  |  P P  |
+                                          The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
+                                          In this situation, new pod with the same labelSelector cannot be scheduled,
+                                          because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
+                                          it will violate MaxSkew.
+
+
+                                          This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
+                                        format: int32
+                                        type: integer
+                                      nodeAffinityPolicy:
+                                        description: |-
+                                          NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
+                                          when calculating pod topology spread skew. Options are:
+                                          - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
+                                          - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
+
+
+                                          If this value is nil, the behavior is equivalent to the Honor policy.
+                                          This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
+                                        type: string
+                                      nodeTaintsPolicy:
+                                        description: |-
+                                          NodeTaintsPolicy indicates how we will treat node taints when calculating
+                                          pod topology spread skew. Options are:
+                                          - Honor: nodes without taints, along with tainted nodes for which the incoming pod
+                                          has a toleration, are included.
+                                          - Ignore: node taints are ignored. All nodes are included.
+
+
                                           If this value is nil, the behavior is equivalent to the Ignore policy.
                                           This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
                                         type: string
@@ -3269,6 +6326,68 @@ spec:
                   that has been observed by the controller.
                 format: int64
                 type: integer
+              shardings:
+                description: Records the status information of all shardings within
+                  the Rollout.
+                items:
+                  properties:
+                    canaryReplicas:
+                      description: The number of canary replicas the sharding has.
+                      format: int32
+                      type: integer
+                    compDef:
+                      description: The ComponentDefinition of the sharding before
+                        the rollout.
+                      type: string
+                    lastScaleDownTimestamp:
+                      description: The last time a sharding replica was scaled down
+                        successfully.
+                      format: date-time
+                      type: string
+                    lastScaleUpTimestamp:
+                      description: The last time a sharding replica was scaled up
+                        successfully.
+                      format: date-time
+                      type: string
+                    name:
+                      description: The name of the sharding.
+                      type: string
+                    newReplicas:
+                      description: The new replicas the sharding has been created
+                        successfully.
+                      format: int32
+                      type: integer
+                    replicas:
+                      description: The replicas the sharding has before the rollout.
+                      format: int32
+                      type: integer
+                    rolledOutReplicas:
+                      description: The replicas the sharding has been rolled out successfully.
+                      format: int32
+                      type: integer
+                    scaleDownInstances:
+                      description: The instances that are scaled down.
+                      items:
+                        type: string
+                      type: array
+                    serviceVersion:
+                      description: The ServiceVersion of the sharding before the rollout.
+                      type: string
+                    shardingDef:
+                      description: |-
+                        The ShardingDefinition of the sharding before the rollout.
+
+
+                        optional
+                      type: string
+                  required:
+                  - compDef
+                  - name
+                  - replicas
+                  - serviceVersion
+                  - shardingDef
+                  type: object
+                type: array
               state:
                 description: The current state of the Rollout.
                 enum:
diff --git a/docs/developer_docs/api-reference/cluster.md b/docs/developer_docs/api-reference/cluster.md
index 6c6a22ff3..ff10336ea 100644
--- a/docs/developer_docs/api-reference/cluster.md
+++ b/docs/developer_docs/api-reference/cluster.md
@@ -15150,6 +15150,20 @@ string
 <p>Specifies the target components to be rolled out.</p>
 </td>
 </tr>
+<tr>
+<td>
+<code>shardings</code><br/>
+<em>
+<a href="#apps.kubeblocks.io/v1alpha1.RolloutSharding">
+[]RolloutSharding
+</a>
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Specifies the target shardings to be rolled out.</p>
+</td>
+</tr>
 </tbody>
 </table>
 </td>
@@ -25990,7 +26004,7 @@ Kubernetes meta/v1.Time
 <h3 id="apps.kubeblocks.io/v1alpha1.RolloutInstanceMeta">RolloutInstanceMeta
 </h3>
 <p>
-(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.RolloutComponent">RolloutComponent</a>)
+(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.RolloutComponent">RolloutComponent</a>, <a href="#apps.kubeblocks.io/v1alpha1.RolloutSharding">RolloutSharding</a>)
 </p>
 <div>
 </div>
@@ -26131,6 +26145,246 @@ int32
 </tr>
 </tbody>
 </table>
+<h3 id="apps.kubeblocks.io/v1alpha1.RolloutSharding">RolloutSharding
+</h3>
+<p>
+(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.RolloutSpec">RolloutSpec</a>)
+</p>
+<div>
+</div>
+<table>
+<thead>
+<tr>
+<th>Field</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>
+<code>name</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<p>Specifies the name of the sharding.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>shardingDef</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Specifies the target ShardingDefinition of the sharding.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>serviceVersion</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Specifies the target ServiceVersion of the sharding.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>compDef</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Specifies the target ComponentDefinition of the sharding.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>strategy</code><br/>
+<em>
+<a href="#apps.kubeblocks.io/v1alpha1.RolloutStrategy">
+RolloutStrategy
+</a>
+</em>
+</td>
+<td>
+<p>Specifies the rollout strategy for the sharding.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>instanceMeta</code><br/>
+<em>
+<a href="#apps.kubeblocks.io/v1alpha1.RolloutInstanceMeta">
+RolloutInstanceMeta
+</a>
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Additional meta for the instances.</p>
+</td>
+</tr>
+</tbody>
+</table>
+<h3 id="apps.kubeblocks.io/v1alpha1.RolloutShardingStatus">RolloutShardingStatus
+</h3>
+<p>
+(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.RolloutStatus">RolloutStatus</a>)
+</p>
+<div>
+</div>
+<table>
+<thead>
+<tr>
+<th>Field</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>
+<code>name</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<p>The name of the sharding.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>shardingDef</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<p>The ShardingDefinition of the sharding before the rollout.</p>
+<p>optional</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>serviceVersion</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<p>The ServiceVersion of the sharding before the rollout.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>compDef</code><br/>
+<em>
+string
+</em>
+</td>
+<td>
+<p>The ComponentDefinition of the sharding before the rollout.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>replicas</code><br/>
+<em>
+int32
+</em>
+</td>
+<td>
+<p>The replicas the sharding has before the rollout.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>newReplicas</code><br/>
+<em>
+int32
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>The new replicas the sharding has been created successfully.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>rolledOutReplicas</code><br/>
+<em>
+int32
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>The replicas the sharding has been rolled out successfully.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>canaryReplicas</code><br/>
+<em>
+int32
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>The number of canary replicas the sharding has.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>scaleDownInstances</code><br/>
+<em>
+[]string
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>The instances that are scaled down.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>lastScaleUpTimestamp</code><br/>
+<em>
+<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta">
+Kubernetes meta/v1.Time
+</a>
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>The last time a sharding replica was scaled up successfully.</p>
+</td>
+</tr>
+<tr>
+<td>
+<code>lastScaleDownTimestamp</code><br/>
+<em>
+<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta">
+Kubernetes meta/v1.Time
+</a>
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>The last time a sharding replica was scaled down successfully.</p>
+</td>
+</tr>
+</tbody>
+</table>
 <h3 id="apps.kubeblocks.io/v1alpha1.RolloutSpec">RolloutSpec
 </h3>
 <p>
@@ -26172,6 +26426,20 @@ string
 <p>Specifies the target components to be rolled out.</p>
 </td>
 </tr>
+<tr>
+<td>
+<code>shardings</code><br/>
+<em>
+<a href="#apps.kubeblocks.io/v1alpha1.RolloutSharding">
+[]RolloutSharding
+</a>
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Specifies the target shardings to be rolled out.</p>
+</td>
+</tr>
 </tbody>
 </table>
 <h3 id="apps.kubeblocks.io/v1alpha1.RolloutState">RolloutState
@@ -26281,12 +26549,26 @@ string
 <p>Records the status information of all components within the Rollout.</p>
 </td>
 </tr>
+<tr>
+<td>
+<code>shardings</code><br/>
+<em>
+<a href="#apps.kubeblocks.io/v1alpha1.RolloutShardingStatus">
+[]RolloutShardingStatus
+</a>
+</em>
+</td>
+<td>
+<em>(Optional)</em>
+<p>Records the status information of all shardings within the Rollout.</p>
+</td>
+</tr>
 </tbody>
 </table>
 <h3 id="apps.kubeblocks.io/v1alpha1.RolloutStrategy">RolloutStrategy
 </h3>
 <p>
-(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.RolloutComponent">RolloutComponent</a>)
+(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.RolloutComponent">RolloutComponent</a>, <a href="#apps.kubeblocks.io/v1alpha1.RolloutSharding">RolloutSharding</a>)
 </p>
 <div>
 </div>



Test patch:
diff --git a/controllers/apps/rollout/rollout_controller_test.go b/controllers/apps/rollout/rollout_controller_test.go
index 2cfe0438d..c77924a6a 100644
--- a/controllers/apps/rollout/rollout_controller_test.go
+++ b/controllers/apps/rollout/rollout_controller_test.go
@@ -29,6 +29,8 @@ import (
 
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/util/rand"
+	"k8s.io/utils/ptr"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	appsv1 "github.com/apecloud/kubeblocks/apis/apps/v1"
@@ -40,13 +42,16 @@ import (
 
 var _ = Describe("rollout controller", func() {
 	const (
-		compDefName     = "test-compdef"
-		clusterName     = "test-cluster"
-		compName        = "comp"
-		serviceVersion1 = "1.0.1"
-		serviceVersion2 = "1.0.2"
-		rolloutName     = "test-rollout"
-		replicas        = int32(3)
+		compDefName          = "test-compdef"
+		clusterName          = "test-cluster"
+		shardingName         = "sharding"
+		compName             = "comp"
+		instanceTemplateName = "aaa"
+		serviceVersion1      = "1.0.1"
+		serviceVersion2      = "1.0.2"
+		rolloutName          = "test-rollout"
+		replicas             = int32(3)
+		seed                 = 1670750000
 	)
 
 	var (
@@ -54,6 +59,9 @@ var _ = Describe("rollout controller", func() {
 		compObj                         *appsv1.Component
 		rolloutObj                      *appsv1alpha1.Rollout
 		clusterKey, compKey, rolloutKey client.ObjectKey
+
+		// first 10 ids
+		shardIDs = []string{"bvj", "g7c", "gpz", "w8b", "dng", "rhk", "rzn", "ql8", "929", "99n"}
 	)
 
 	createClusterNCompObj := func() {
@@ -71,7 +79,104 @@ var _ = Describe("rollout controller", func() {
 		compObjName := constant.GenerateClusterComponentName(clusterKey.Name, compName)
 		compObj = testapps.NewComponentFactory(testCtx.DefaultNamespace, compObjName, compDefName).
 			AddLabelsInMap(constant.GetCompLabelsWithDef(clusterKey.Name, compName, compDefName)).
+			SetServiceVersion(serviceVersion1).
+			SetReplicas(replicas).
+			Create(&testCtx).
+			GetObject()
+		compKey = client.ObjectKeyFromObject(compObj)
+	}
+
+	createClusterNCompObjWithInstanceTemplate := func() {
+		By("creating a cluster object")
+		clusterObj = testapps.NewClusterFactory(testCtx.DefaultNamespace, clusterName, "").
+			WithRandomName().
+			AddComponent(compName, compDefName).
+			SetServiceVersion(serviceVersion1).
+			SetReplicas(replicas).
+			AddInstances(compName, appsv1.InstanceTemplate{
+				Name:           instanceTemplateName,
+				ServiceVersion: serviceVersion1,
+				Replicas:       ptr.To[int32](1),
+			}).
+			SetFlatInstanceOrdinal(true).
+			Create(&testCtx).
+			GetObject()
+		clusterKey = client.ObjectKeyFromObject(clusterObj)
+
+		By("creating a component object")
+		compObjName := constant.GenerateClusterComponentName(clusterKey.Name, compName)
+		compObj = testapps.NewComponentFactory(testCtx.DefaultNamespace, compObjName, compDefName).
+			AddLabelsInMap(constant.GetCompLabelsWithDef(clusterKey.Name, compName, compDefName)).
+			SetServiceVersion(serviceVersion1).
+			SetReplicas(replicas).
+			AddInstances(appsv1.InstanceTemplate{
+				Name:           instanceTemplateName,
+				ServiceVersion: serviceVersion1,
+				CompDef:        compObjName,
+				Replicas:       ptr.To[int32](1),
+			}).
+			SetFlatInstanceOrdinal(true).
+			Create(&testCtx).
+			GetObject()
+		compKey = client.ObjectKeyFromObject(compObj)
+	}
+
+	createClusterNShardingObj := func() {
+		By("creating a cluster object")
+		clusterObj = testapps.NewClusterFactory(testCtx.DefaultNamespace, clusterName, "").
+			WithRandomName().
+			AddSharding(shardingName, "", compDefName).
+			SetShardingServiceVersion(serviceVersion1).
+			SetShardingReplicas(replicas).
+			Create(&testCtx).
+			GetObject()
+		clusterKey = client.ObjectKeyFromObject(clusterObj)
+
+		By("creating a component object")
+		compObjName := constant.GenerateClusterComponentName(clusterKey.Name, fmt.Sprintf("%s-%s", compName, shardIDs[0]))
+		compObj = testapps.NewComponentFactory(testCtx.DefaultNamespace, compObjName, compDefName).
+			AddLabelsInMap(constant.GetCompLabelsWithDef(clusterKey.Name, compName, compDefName, map[string]string{
+				constant.KBAppShardingNameLabelKey: shardingName,
+			})).
+			SetServiceVersion(serviceVersion1).
+			SetReplicas(replicas).
+			Create(&testCtx).
+			GetObject()
+		compKey = client.ObjectKeyFromObject(compObj)
+	}
+
+	createClusterNShardingObjWithInstanceTemplate := func() {
+		By("creating a cluster object")
+		clusterObj = testapps.NewClusterFactory(testCtx.DefaultNamespace, clusterName, "").
+			WithRandomName().
+			AddSharding(shardingName, "", compDefName).
+			SetShardingServiceVersion(serviceVersion1).
+			SetShardingReplicas(replicas).
+			AddShardingInstances(appsv1.InstanceTemplate{
+				Name:           instanceTemplateName,
+				ServiceVersion: serviceVersion1,
+				Replicas:       ptr.To[int32](1),
+			}).
+			SetShardingFlatInstanceOrdinal(true).
+			Create(&testCtx).
+			GetObject()
+		clusterKey = client.ObjectKeyFromObject(clusterObj)
+
+		By("creating a component object")
+		compObjName := constant.GenerateClusterComponentName(clusterKey.Name, fmt.Sprintf("%s-%s", compName, shardIDs[0]))
+		compObj = testapps.NewComponentFactory(testCtx.DefaultNamespace, compObjName, compDefName).
+			AddLabelsInMap(constant.GetCompLabelsWithDef(clusterKey.Name, compName, compDefName, map[string]string{
+				constant.KBAppShardingNameLabelKey: shardingName,
+			})).
+			SetServiceVersion(serviceVersion1).
 			SetReplicas(replicas).
+			AddInstances(appsv1.InstanceTemplate{
+				Name:           instanceTemplateName,
+				ServiceVersion: serviceVersion1,
+				CompDef:        compObjName,
+				Replicas:       ptr.To[int32](1),
+			}).
+			SetFlatInstanceOrdinal(true).
 			Create(&testCtx).
 			GetObject()
 		compKey = client.ObjectKeyFromObject(compObj)
@@ -93,13 +198,29 @@ var _ = Describe("rollout controller", func() {
 		})()).Should(Succeed())
 	}
 
+	mockClusterNShardingRunning := func() {
+		By("mock cluster & component as running")
+		Expect(testapps.GetAndChangeObjStatus(&testCtx, compKey, func(comp *appsv1.Component) {
+			comp.Status.ObservedGeneration = comp.Generation
+			comp.Status.Phase = appsv1.RunningComponentPhase
+		})()).Should(Succeed())
+		Expect(testapps.GetAndChangeObjStatus(&testCtx, clusterKey, func(cluster *appsv1.Cluster) {
+			cluster.Status.ObservedGeneration = cluster.Generation
+			cluster.Status.Shardings = map[string]appsv1.ClusterComponentStatus{
+				shardingName: {
+					Phase: appsv1.RunningComponentPhase,
+				},
+			}
+		})()).Should(Succeed())
+	}
+
 	mockCreatePods := func(ordinals []int32, tplName string) []*corev1.Pod {
 		pods := make([]*corev1.Pod, 0)
 		for _, ordinal := range ordinals {
 			pod := &corev1.Pod{
 				ObjectMeta: metav1.ObjectMeta{
 					Namespace: testCtx.DefaultNamespace,
-					Name:      fmt.Sprintf("%s-%d", constant.GenerateWorkloadNamePattern(clusterKey.Name, compName), ordinal),
+					Name:      fmt.Sprintf("%s-%d", compKey.Name, ordinal),
 					Labels: map[string]string{
 						constant.AppManagedByLabelKey:          constant.AppName,
 						constant.AppInstanceLabelKey:           clusterKey.Name,
@@ -126,6 +247,40 @@ var _ = Describe("rollout controller", func() {
 		return pods
 	}
 
+	mockCreatePods4Sharding := func(ordinals []int32, tplName string) []*corev1.Pod {
+		pods := make([]*corev1.Pod, 0)
+		for _, ordinal := range ordinals {
+			pod := &corev1.Pod{
+				ObjectMeta: metav1.ObjectMeta{
+					Namespace: testCtx.DefaultNamespace,
+					Name:      fmt.Sprintf("%s-%d", compKey.Name, ordinal),
+					Labels: map[string]string{
+						constant.AppManagedByLabelKey:          constant.AppName,
+						constant.AppInstanceLabelKey:           clusterKey.Name,
+						constant.KBAppComponentLabelKey:        fmt.Sprintf("%s-%s", compName, shardIDs[0]),
+						constant.KBAppShardingNameLabelKey:     shardingName,
+						constant.KBAppReleasePhaseKey:          constant.ReleasePhaseStable,
+						constant.KBAppInstanceTemplateLabelKey: tplName,
+					},
+				},
+				Spec: corev1.PodSpec{
+					Containers: []corev1.Container{
+						{
+							Name:  "rollout",
+							Image: "rollout",
+						},
+					},
+				},
+			}
+			Expect(testCtx.CheckedCreateObj(testCtx.Ctx, pod)).Should(Succeed())
+			pods = append(pods, pod)
+		}
+		slices.SortFunc(pods, func(a, b *corev1.Pod) int {
+			return strings.Compare(a.Name, b.Name) * -1
+		})
+		return pods
+	}
+
 	createRolloutObj := func(processor func(*testapps.MockRolloutFactory)) {
 		By("creating a rollout object")
 		f := testapps.NewRolloutFactory(testCtx.DefaultNamespace, rolloutName).
@@ -139,6 +294,19 @@ var _ = Describe("rollout controller", func() {
 		rolloutKey = client.ObjectKeyFromObject(rolloutObj)
 	}
 
+	createRolloutObj4Sharding := func(processor func(*testapps.MockRolloutFactory)) {
+		By("creating a rollout object")
+		f := testapps.NewRolloutFactory(testCtx.DefaultNamespace, rolloutName).
+			WithRandomName().
+			SetClusterName(clusterKey.Name).
+			AddSharding(shardingName)
+		if processor != nil {
+			processor(f)
+		}
+		rolloutObj = f.Create(&testCtx).GetObject()
+		rolloutKey = client.ObjectKeyFromObject(rolloutObj)
+	}
+
 	cleanEnv := func() {
 		// must wait till resources deleted and no longer existed before the testcases start,
 		// otherwise if later it needs to create some new resource objects with the same name,
@@ -154,6 +322,7 @@ var _ = Describe("rollout controller", func() {
 		testapps.ClearResourcesWithRemoveFinalizerOption(&testCtx, intctrlutil.RolloutSignature, true, inNS, ml)
 		testapps.ClearResourcesWithRemoveFinalizerOption(&testCtx, intctrlutil.ClusterSignature, true, inNS, ml)
 		testapps.ClearResourcesWithRemoveFinalizerOption(&testCtx, intctrlutil.ComponentSignature, true, inNS, ml)
+		testapps.ClearResourcesWithRemoveFinalizerOption(&testCtx, intctrlutil.PodSignature, true, inNS, ml)
 	}
 
 	BeforeEach(func() {
@@ -168,11 +337,11 @@ var _ = Describe("rollout controller", func() {
 		BeforeEach(func() {
 			createClusterNCompObj()
 			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(appsv1alpha1.RolloutStrategy{
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(appsv1alpha1.RolloutStrategy{
 						Replace: &appsv1alpha1.RolloutStrategyReplace{},
 					}).
-					SetReplicas(replicas)
+					SetCompReplicas(replicas)
 			})
 		})
 
@@ -210,17 +379,7 @@ var _ = Describe("rollout controller", func() {
 			})).Should(Succeed())
 		})
 
-		It("replicas in status", func() {
-			By("checking the replicas in rollout status")
-			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
-				comps := rollout.Status.Components
-				g.Expect(comps).Should(HaveLen(1))
-				g.Expect(comps[0].Name).Should(Equal(compName))
-				g.Expect(comps[0].Replicas).Should(Equal(replicas))
-			})).Should(Succeed())
-		})
-
-		It("concurrent rollout", func() {
+		It("rollout label - concurrent", func() {
 			By("checking the rollout label in cluster")
 			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
 				labels := cluster.GetLabels()
@@ -234,11 +393,11 @@ var _ = Describe("rollout controller", func() {
 
 			By("creating a new rollout object")
 			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(appsv1alpha1.RolloutStrategy{
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(appsv1alpha1.RolloutStrategy{
 						Replace: &appsv1alpha1.RolloutStrategyReplace{},
 					}).
-					SetReplicas(replicas)
+					SetCompReplicas(replicas)
 			})
 
 			By("checking the rollout state of new object")
@@ -246,6 +405,16 @@ var _ = Describe("rollout controller", func() {
 				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.ErrorRolloutState))
 			})).Should(Succeed())
 		})
+
+		It("rollout status", func() {
+			By("checking the replicas in rollout status")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				comps := rollout.Status.Components
+				g.Expect(comps).Should(HaveLen(1))
+				g.Expect(comps[0].Name).Should(Equal(compName))
+				g.Expect(comps[0].Replicas).Should(Equal(replicas))
+			})).Should(Succeed())
+		})
 	})
 
 	Context("inplace", func() {
@@ -261,9 +430,9 @@ var _ = Describe("rollout controller", func() {
 
 		It("rolling", func() {
 			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(defaultInplaceStrategy).
-					SetReplicas(replicas)
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultInplaceStrategy).
+					SetCompReplicas(replicas)
 			})
 
 			By("checking the rollout state")
@@ -287,9 +456,9 @@ var _ = Describe("rollout controller", func() {
 
 		It("succeed", func() {
 			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(defaultInplaceStrategy).
-					SetReplicas(replicas)
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultInplaceStrategy).
+					SetCompReplicas(replicas)
 			})
 
 			mockClusterNCompRunning()
@@ -308,22 +477,22 @@ var _ = Describe("rollout controller", func() {
 		})
 	})
 
-	Context("replace", func() {
+	Context("inplace - instance template", func() {
 		var (
-			defaultReplaceStrategy = appsv1alpha1.RolloutStrategy{
-				Replace: &appsv1alpha1.RolloutStrategyReplace{},
+			defaultInplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Inplace: &appsv1alpha1.RolloutStrategyInplace{},
 			}
 		)
 
 		BeforeEach(func() {
-			createClusterNCompObj()
+			createClusterNCompObjWithInstanceTemplate()
 		})
 
 		It("rolling", func() {
 			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(defaultReplaceStrategy).
-					SetReplicas(replicas)
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultInplaceStrategy).
+					SetCompReplicas(replicas)
 			})
 
 			By("checking the rollout state")
@@ -334,17 +503,10 @@ var _ = Describe("rollout controller", func() {
 
 			mockClusterNCompRunning()
 
-			By("checking the cluster spec & status been updated")
+			By("checking the cluster spec been updated")
 			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
-				spec := cluster.Spec.ComponentSpecs[0]
-				g.Expect(spec.Replicas).Should(Equal(replicas + 1))
-				g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
-				g.Expect(spec.Instances).Should(HaveLen(1))
-				g.Expect(spec.Instances[0].Name).Should(Equal(string(rolloutObj.UID[:8])))
-				g.Expect(spec.Instances[0].ServiceVersion).Should(Equal(serviceVersion2))
-				g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(1)))
-				g.Expect(spec.FlatInstanceOrdinal).Should(BeTrue())
-				g.Expect(cluster.Generation).Should(Equal(cluster.Status.ObservedGeneration + 1))
+				g.Expect(cluster.Spec.ComponentSpecs[0].ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(cluster.Spec.ComponentSpecs[0].Instances[0].ServiceVersion).Should(Equal(serviceVersion2))
 			})).Should(Succeed())
 
 			By("checking the rollout state as rolling")
@@ -353,113 +515,300 @@ var _ = Describe("rollout controller", func() {
 			})).Should(Succeed())
 		})
 
-		It("scale down", func() {
+		It("succeed", func() {
 			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(defaultReplaceStrategy).
-					SetReplicas(replicas)
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultInplaceStrategy).
+					SetCompReplicas(replicas)
 			})
 
-			mockClusterNCompRunning() // to up
+			mockClusterNCompRunning()
 
 			By("checking the rollout state as rolling")
 			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
 				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
 			})).Should(Succeed())
 
-			By("creating pods for the component")
-			pods := mockCreatePods([]int32{0, 1, 2}, "")
-
-			mockClusterNCompRunning() // to down
+			mockClusterNCompRunning()
 
-			By("checking the rollout state as rolling, and one instance is scaled down")
+			By("checking the rollout state as succeed")
 			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
-				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
-				g.Expect(rollout.Status.Components).Should(HaveLen(1))
-				g.Expect(rollout.Status.Components[0].ScaleDownInstances).Should(HaveLen(1))
-				g.Expect(rollout.Status.Components[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
-			})).Should(Succeed())
-
-			By("checking the cluster spec after scale down")
-			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
-				spec := cluster.Spec.ComponentSpecs[0]
-				g.Expect(spec.Replicas).Should(Equal(replicas))
-				g.Expect(spec.OfflineInstances).Should(HaveLen(1))
-				g.Expect(spec.OfflineInstances[0]).Should(Equal(pods[0].Name))
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
 			})).Should(Succeed())
 		})
+	})
 
-		It("succeed", func() {
-			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(defaultReplaceStrategy).
-					SetReplicas(replicas)
-			})
+	Context("inplace - sharding", func() {
+		var (
+			defaultInplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Inplace: &appsv1alpha1.RolloutStrategyInplace{},
+			}
+		)
 
-			By("creating pods for the component")
-			pods := mockCreatePods([]int32{0, 1, 2}, "")
+		BeforeEach(func() {
+			rand.Seed(seed)
+			createClusterNShardingObj()
+		})
 
-			for i := int32(0); i < replicas; i++ {
-				mockClusterNCompRunning() // to up
+		It("rolling", func() {
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultInplaceStrategy)
+			})
 
-				By("checking the cluster spec after roll up")
-				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
-					spec := cluster.Spec.ComponentSpecs[0]
-					g.Expect(spec.Replicas).Should(Equal(replicas + 1))
-					g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
-					g.Expect(*spec.Instances[0].Replicas).Should(Equal(i + 1))
-				})).Should(Succeed())
+			By("checking the rollout state")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.PendingRolloutState))
+				// TODO: check message
+			})).Should(Succeed())
 
-				By("creating the new pod")
-				mockCreatePods([]int32{i + 10}, string(rolloutObj.UID[:8]))
+			mockClusterNShardingRunning()
 
-				mockClusterNCompRunning() // to down
+			By("checking the cluster spec been updated")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				g.Expect(cluster.Spec.Shardings[0].Template.ServiceVersion).Should(Equal(serviceVersion2))
+			})).Should(Succeed())
 
-				By("checking the cluster spec after scale down")
-				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
-					spec := cluster.Spec.ComponentSpecs[0]
-					g.Expect(spec.Replicas).Should(Equal(replicas))
-					g.Expect(spec.OfflineInstances).Should(HaveLen(int(i + 1)))
-					for j := int32(0); j < i+1; j++ {
-						g.Expect(spec.OfflineInstances[j]).Should(Equal(pods[j].Name))
-					}
-				})).Should(Succeed())
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+		})
 
-				By("deleting the scaled down pod")
-				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
-			}
+		It("succeed", func() {
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultInplaceStrategy)
+			})
 
-			mockClusterNCompRunning() // all old pods are deleted
+			mockClusterNShardingRunning()
 
-			By("checking the cluster spec finally")
-			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
-				spec := cluster.Spec.ComponentSpecs[0]
-				g.Expect(spec.Replicas).Should(Equal(replicas))
-				g.Expect(*spec.Instances[0].Replicas).Should(Equal(replicas))
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
 			})).Should(Succeed())
 
-			mockClusterNCompRunning() // tear down will update the cluster spec
+			mockClusterNShardingRunning()
 
 			By("checking the rollout state as succeed")
 			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
 				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
 			})).Should(Succeed())
 		})
+	})
 
-		It("tear down", func() {
-			createRolloutObj(func(f *testapps.MockRolloutFactory) {
-				f.SetServiceVersion(serviceVersion2).
-					SetStrategy(defaultReplaceStrategy).
-					SetReplicas(replicas)
+	Context("inplace - sharding + instance template", func() {
+		var (
+			defaultInplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Inplace: &appsv1alpha1.RolloutStrategyInplace{},
+			}
+		)
+
+		BeforeEach(func() {
+			rand.Seed(seed)
+			createClusterNShardingObjWithInstanceTemplate()
+		})
+
+		It("rolling", func() {
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultInplaceStrategy)
 			})
 
-			By("creating pods for the component")
-			pods := mockCreatePods([]int32{0, 1, 2}, "")
+			By("checking the rollout state")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.PendingRolloutState))
+				// TODO: check message
+			})).Should(Succeed())
 
-			for i := int32(0); i < replicas; i++ {
-				mockClusterNCompRunning() // to up
+			mockClusterNShardingRunning()
 
-				By("checking the cluster spec after roll up")
+			By("checking the cluster spec been updated")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				g.Expect(cluster.Spec.Shardings[0].Template.ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(cluster.Spec.Shardings[0].Template.Instances[0].ServiceVersion).Should(Equal(serviceVersion2))
+			})).Should(Succeed())
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("succeed", func() {
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultInplaceStrategy)
+			})
+
+			mockClusterNShardingRunning()
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning()
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+	})
+
+	Context("replace", func() {
+		var (
+			defaultReplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Replace: &appsv1alpha1.RolloutStrategyReplace{},
+			}
+		)
+
+		BeforeEach(func() {
+			createClusterNCompObj()
+		})
+
+		It("rolling", func() {
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			By("checking the rollout state")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.PendingRolloutState))
+				// TODO: check message
+			})).Should(Succeed())
+
+			mockClusterNCompRunning()
+
+			By("checking the cluster spec & status been updated")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas + 1))
+				g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
+				g.Expect(spec.Instances).Should(HaveLen(1))
+				g.Expect(spec.Instances[0].Name).Should(Equal(string(rolloutObj.UID[:8])))
+				g.Expect(spec.Instances[0].ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(1)))
+				g.Expect(spec.FlatInstanceOrdinal).Should(BeTrue())
+				g.Expect(cluster.Generation).Should(Equal(cluster.Status.ObservedGeneration + 1))
+			})).Should(Succeed())
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("scale down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0, 1, 2}, "")
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			mockClusterNCompRunning() // to up
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNCompRunning() // to down
+
+			By("checking the rollout state as rolling, and one instance is scaled down")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+				g.Expect(rollout.Status.Components).Should(HaveLen(1))
+				g.Expect(rollout.Status.Components[0].ScaleDownInstances).Should(HaveLen(1))
+				g.Expect(rollout.Status.Components[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+
+			By("checking the cluster spec after scale down")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas))
+				g.Expect(spec.OfflineInstances).Should(HaveLen(1))
+				g.Expect(spec.OfflineInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+		})
+
+		It("succeed", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0, 1, 2}, "")
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				mockClusterNCompRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.ComponentSpecs[0]
+					g.Expect(spec.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
+					g.Expect(*spec.Instances[0].Replicas).Should(Equal(i + 1))
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				mockCreatePods([]int32{i + 10}, string(rolloutObj.UID[:8]))
+
+				mockClusterNCompRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.ComponentSpecs[0]
+					g.Expect(spec.Replicas).Should(Equal(replicas))
+					g.Expect(spec.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNCompRunning() // all old pods are deleted
+
+			By("checking the cluster spec finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas))
+				g.Expect(*spec.Instances[0].Replicas).Should(Equal(replicas))
+			})).Should(Succeed())
+
+			mockClusterNCompRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("tear down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0, 1, 2}, "")
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				mockClusterNCompRunning() // to up
+
+				By("checking the cluster spec after roll up")
 				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
 					spec := cluster.Spec.ComponentSpecs[0]
 					g.Expect(spec.Replicas).Should(Equal(replicas + 1))
@@ -504,23 +853,824 @@ var _ = Describe("rollout controller", func() {
 		})
 	})
 
-	// Context("create", func() {
-	//	It("auto promotion", func() {
-	//	})
-	//
-	//	It("partly", func() {
-	//	})
-	//
-	//	It("partly - done", func() {
-	//	})
-	//
-	//	It("promote condition", func() {
-	//	})
-	//
-	//	It("scale down", func() {
-	//	})
-	//
-	//	It("tear down", func() {
-	//	})
-	// })
+	Context("replace - instance template", func() {
+		var (
+			defaultReplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Replace: &appsv1alpha1.RolloutStrategyReplace{},
+			}
+		)
+
+		BeforeEach(func() {
+			createClusterNCompObjWithInstanceTemplate()
+		})
+
+		It("rolling", func() {
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			By("checking the rollout state")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.PendingRolloutState))
+				// TODO: check message
+			})).Should(Succeed())
+
+			mockClusterNCompRunning()
+
+			By("checking the cluster spec & status been updated")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas + 1))
+				g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
+				g.Expect(spec.Instances).Should(HaveLen(3)) // aaa, prefix, prefix-aaa
+				g.Expect(spec.Instances[0].Name).Should(Equal(instanceTemplateName))
+				g.Expect(spec.Instances[0].ServiceVersion).Should(Equal(serviceVersion1)) // hasn't been updated
+				g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(1)))
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				for _, i := range []int{1, 2} {
+					tpl := spec.Instances[i]
+					g.Expect(tpl.ServiceVersion).Should(Equal(serviceVersion2))
+					g.Expect(tpl.Name).Should(HavePrefix(prefix))
+					if tpl.Name == prefix {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+					} else {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(0)))
+					}
+				}
+				g.Expect(spec.FlatInstanceOrdinal).Should(BeTrue())
+				g.Expect(cluster.Generation).Should(Equal(cluster.Status.ObservedGeneration + 1))
+			})).Should(Succeed())
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("scale down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0}, instanceTemplateName)  // pod 0 is the instance template pod
+			pods = append(mockCreatePods([]int32{1, 2}, ""), pods...) // 2, 1, 0
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			mockClusterNCompRunning() // to up
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNCompRunning() // to down
+
+			By("checking the rollout state as rolling, and one instance is scaled down")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+				g.Expect(rollout.Status.Components).Should(HaveLen(1))
+				g.Expect(rollout.Status.Components[0].ScaleDownInstances).Should(HaveLen(1))
+				g.Expect(rollout.Status.Components[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+
+			By("checking the cluster spec after scale down")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas))
+				g.Expect(spec.OfflineInstances).Should(HaveLen(1))
+				g.Expect(spec.OfflineInstances[0]).Should(Equal(pods[0].Name))
+				g.Expect(spec.Instances[0].Name).Should(Equal(instanceTemplateName))
+				g.Expect(spec.Instances[0].ServiceVersion).Should(Equal(serviceVersion1)) // hasn't been updated
+				g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(1)))             // hasn't been scaled down
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				for _, i := range []int{1, 2} {
+					tpl := spec.Instances[i]
+					g.Expect(tpl.ServiceVersion).Should(Equal(serviceVersion2))
+					g.Expect(tpl.Name).Should(HavePrefix(prefix))
+					if tpl.Name == prefix {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+					} else {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(0)))
+					}
+				}
+			})).Should(Succeed())
+		})
+
+		It("scale down - instance template pod", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0, 1}, "")
+			pods = append(mockCreatePods([]int32{2}, instanceTemplateName), pods...) // pod 2 is the instance template pod
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			mockClusterNCompRunning() // to up
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNCompRunning() // to down
+
+			By("checking the rollout state as rolling, and one instance is scaled down")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+				g.Expect(rollout.Status.Components).Should(HaveLen(1))
+				g.Expect(rollout.Status.Components[0].ScaleDownInstances).Should(HaveLen(1))
+				g.Expect(rollout.Status.Components[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+
+			By("checking the cluster spec after scale down")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas))
+				g.Expect(spec.OfflineInstances).Should(HaveLen(1))
+				g.Expect(spec.OfflineInstances[0]).Should(Equal(pods[0].Name))
+				g.Expect(spec.Instances[0].Name).Should(Equal(instanceTemplateName))
+				g.Expect(spec.Instances[0].ServiceVersion).Should(Equal(serviceVersion1)) // hasn't been updated
+				g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(0)))             // should be scaled down
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				for _, i := range []int{1, 2} {
+					tpl := spec.Instances[i]
+					g.Expect(tpl.ServiceVersion).Should(Equal(serviceVersion2))
+					g.Expect(tpl.Name).Should(HavePrefix(prefix))
+					if tpl.Name == prefix {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(0)))
+					} else {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+					}
+				}
+			})).Should(Succeed())
+		})
+
+		It("succeed", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0, 1}, "")
+			pods = append(mockCreatePods([]int32{2}, instanceTemplateName), pods...) // pod 2 is the instance template pod
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				tplName := pods[i].Labels[constant.KBAppInstanceTemplateLabelKey]
+				newTplName := prefix
+				if tplName != "" {
+					newTplName = fmt.Sprintf("%s-%s", prefix, tplName)
+				}
+
+				mockClusterNCompRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.ComponentSpecs[0]
+					g.Expect(spec.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
+					for _, tpl := range spec.Instances {
+						if tpl.Name == newTplName {
+							if tplName == "" {
+								g.Expect(*tpl.Replicas).Should(Equal(i))
+							} else {
+								g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+							}
+						}
+					}
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				if tplName == "" {
+					mockCreatePods([]int32{i + 10}, prefix)
+				} else {
+					mockCreatePods([]int32{i + 10}, fmt.Sprintf("%s-%s", prefix, tplName))
+				}
+
+				mockClusterNCompRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.ComponentSpecs[0]
+					g.Expect(spec.Replicas).Should(Equal(replicas))
+					g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(0)))
+					g.Expect(spec.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNCompRunning() // all old pods are deleted
+
+			By("checking the cluster spec finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.Replicas).Should(Equal(replicas))
+				g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(0)))
+				g.Expect(*spec.Instances[1].Replicas + *spec.Instances[2].Replicas).Should(Equal(replicas))
+			})).Should(Succeed())
+
+			mockClusterNCompRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("tear down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods([]int32{0, 1}, "")
+			pods = append(mockCreatePods([]int32{2}, instanceTemplateName), pods...) // pod 2 is the instance template pod
+
+			createRolloutObj(func(f *testapps.MockRolloutFactory) {
+				f.SetCompServiceVersion(serviceVersion2).
+					SetCompStrategy(defaultReplaceStrategy).
+					SetCompReplicas(replicas)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				tplName := pods[i].Labels[constant.KBAppInstanceTemplateLabelKey]
+				newTplName := prefix
+				if tplName != "" {
+					newTplName = fmt.Sprintf("%s-%s", prefix, tplName)
+				}
+
+				mockClusterNCompRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.ComponentSpecs[0]
+					g.Expect(spec.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion1))
+					for _, tpl := range spec.Instances {
+						if tpl.Name == newTplName {
+							if tplName == "" {
+								g.Expect(*tpl.Replicas).Should(Equal(i))
+							} else {
+								g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+							}
+						}
+					}
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				if tplName == "" {
+					mockCreatePods([]int32{i + 10}, prefix)
+				} else {
+					mockCreatePods([]int32{i + 10}, fmt.Sprintf("%s-%s", prefix, tplName))
+				}
+
+				mockClusterNCompRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.ComponentSpecs[0]
+					g.Expect(spec.Replicas).Should(Equal(replicas))
+					g.Expect(*spec.Instances[0].Replicas).Should(Equal(int32(0)))
+					g.Expect(spec.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNCompRunning() // all old pods are deleted
+
+			By("checking the cluster spec updated finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.ComponentSpecs[0]
+				g.Expect(spec.ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(spec.OfflineInstances).Should(BeEmpty())
+			})).Should(Succeed())
+
+			mockClusterNCompRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+	})
+
+	Context("replace - sharding", func() {
+		var (
+			defaultReplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Replace: &appsv1alpha1.RolloutStrategyReplace{},
+			}
+		)
+
+		BeforeEach(func() {
+			rand.Seed(seed)
+			createClusterNShardingObj()
+		})
+
+		It("rolling", func() {
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			By("checking the rollout state")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.PendingRolloutState))
+				// TODO: check message
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning()
+
+			By("checking the cluster spec & status been updated")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas + 1))
+				g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion1))
+				g.Expect(spec.Template.Instances).Should(HaveLen(1))
+				g.Expect(spec.Template.Instances[0].Name).Should(Equal(string(rolloutObj.UID[:8])))
+				g.Expect(spec.Template.Instances[0].ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(1)))
+				g.Expect(spec.Template.FlatInstanceOrdinal).Should(BeTrue())
+				g.Expect(cluster.Generation).Should(Equal(cluster.Status.ObservedGeneration + 1))
+			})).Should(Succeed())
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("scale down", func() {
+			By("creating pods for the shard")
+			pods := mockCreatePods4Sharding([]int32{0, 1, 2}, "")
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			mockClusterNShardingRunning() // to up
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // to down
+
+			By("checking the rollout state as rolling, and one instance is scaled down")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+				g.Expect(rollout.Status.Shardings).Should(HaveLen(1))
+				g.Expect(rollout.Status.Shardings[0].ScaleDownInstances).Should(HaveLen(1))
+				g.Expect(rollout.Status.Shardings[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+
+			By("checking the cluster spec after scale down")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+				g.Expect(spec.Template.OfflineInstances).Should(HaveLen(1))
+				g.Expect(spec.Template.OfflineInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+		})
+
+		It("succeed", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods4Sharding([]int32{0, 1, 2}, "")
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				mockClusterNShardingRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion1))
+					g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(i + 1))
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				mockCreatePods4Sharding([]int32{i + 10}, string(rolloutObj.UID[:8]))
+
+				mockClusterNShardingRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+					g.Expect(spec.Template.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.Template.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNShardingRunning() // all old pods are deleted
+
+			By("checking the cluster spec finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+				g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(replicas))
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("tear down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods4Sharding([]int32{0, 1, 2}, "")
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				mockClusterNShardingRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion1))
+					g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(i + 1))
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				mockCreatePods4Sharding([]int32{i + 10}, string(rolloutObj.UID[:8]))
+
+				mockClusterNShardingRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+					g.Expect(spec.Template.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.Template.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNShardingRunning() // all old pods are deleted
+
+			By("checking the cluster spec updated finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(spec.Template.OfflineInstances).Should(BeEmpty())
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+	})
+
+	Context("replace - sharding + instance template", func() {
+		var (
+			defaultReplaceStrategy = appsv1alpha1.RolloutStrategy{
+				Replace: &appsv1alpha1.RolloutStrategyReplace{},
+			}
+		)
+
+		BeforeEach(func() {
+			rand.Seed(seed)
+			createClusterNShardingObjWithInstanceTemplate()
+		})
+
+		It("rolling", func() {
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			By("checking the rollout state")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.PendingRolloutState))
+				// TODO: check message
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning()
+
+			By("checking the cluster spec & status been updated")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas + 1))
+				g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion1))
+				g.Expect(spec.Template.Instances).Should(HaveLen(3)) // aaa, prefix, prefix-aaa
+				g.Expect(spec.Template.Instances[0].Name).Should(Equal(instanceTemplateName))
+				g.Expect(spec.Template.Instances[0].ServiceVersion).Should(Equal(serviceVersion1)) // hasn't been updated
+				g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(1)))
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				for _, i := range []int{1, 2} {
+					tpl := spec.Template.Instances[i]
+					g.Expect(tpl.ServiceVersion).Should(Equal(serviceVersion2))
+					g.Expect(tpl.Name).Should(HavePrefix(prefix))
+					if tpl.Name == prefix {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+					} else {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(0)))
+					}
+				}
+				g.Expect(spec.Template.FlatInstanceOrdinal).Should(BeTrue())
+				g.Expect(cluster.Generation).Should(Equal(cluster.Status.ObservedGeneration + 1))
+			})).Should(Succeed())
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("scale down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods4Sharding([]int32{0}, instanceTemplateName)  // pod 0 is the instance template pod
+			pods = append(mockCreatePods4Sharding([]int32{1, 2}, ""), pods...) // 2, 1, 0
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			mockClusterNShardingRunning() // to up
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // to down
+
+			By("checking the rollout state as rolling, and one instance is scaled down")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+				g.Expect(rollout.Status.Shardings).Should(HaveLen(1))
+				g.Expect(rollout.Status.Shardings[0].ScaleDownInstances).Should(HaveLen(1))
+				g.Expect(rollout.Status.Shardings[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+
+			By("checking the cluster spec after scale down")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+				g.Expect(spec.Template.OfflineInstances).Should(HaveLen(1))
+				g.Expect(spec.Template.OfflineInstances[0]).Should(Equal(pods[0].Name))
+				g.Expect(spec.Template.Instances[0].Name).Should(Equal(instanceTemplateName))
+				g.Expect(spec.Template.Instances[0].ServiceVersion).Should(Equal(serviceVersion1)) // hasn't been updated
+				g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(1)))             // hasn't been scaled down
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				for _, i := range []int{1, 2} {
+					tpl := spec.Template.Instances[i]
+					g.Expect(tpl.ServiceVersion).Should(Equal(serviceVersion2))
+					g.Expect(tpl.Name).Should(HavePrefix(prefix))
+					if tpl.Name == prefix {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+					} else {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(0)))
+					}
+				}
+			})).Should(Succeed())
+		})
+
+		It("scale down - instance template pod", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods4Sharding([]int32{0, 1}, "")
+			pods = append(mockCreatePods4Sharding([]int32{2}, instanceTemplateName), pods...) // pod 2 is the instance template pod
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			mockClusterNShardingRunning() // to up
+
+			By("checking the rollout state as rolling")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // to down
+
+			By("checking the rollout state as rolling, and one instance is scaled down")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.RollingRolloutState))
+				g.Expect(rollout.Status.Shardings).Should(HaveLen(1))
+				g.Expect(rollout.Status.Shardings[0].ScaleDownInstances).Should(HaveLen(1))
+				g.Expect(rollout.Status.Shardings[0].ScaleDownInstances[0]).Should(Equal(pods[0].Name))
+			})).Should(Succeed())
+
+			By("checking the cluster spec after scale down")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+				g.Expect(spec.Template.OfflineInstances).Should(HaveLen(1))
+				g.Expect(spec.Template.OfflineInstances[0]).Should(Equal(pods[0].Name))
+				g.Expect(spec.Template.Instances[0].Name).Should(Equal(instanceTemplateName))
+				g.Expect(spec.Template.Instances[0].ServiceVersion).Should(Equal(serviceVersion1)) // hasn't been updated
+				g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(0)))             // should be scaled down
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				for _, i := range []int{1, 2} {
+					tpl := spec.Template.Instances[i]
+					g.Expect(tpl.ServiceVersion).Should(Equal(serviceVersion2))
+					g.Expect(tpl.Name).Should(HavePrefix(prefix))
+					if tpl.Name == prefix {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(0)))
+					} else {
+						g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+					}
+				}
+			})).Should(Succeed())
+		})
+
+		It("succeed", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods4Sharding([]int32{0, 1}, "")
+			pods = append(mockCreatePods4Sharding([]int32{2}, instanceTemplateName), pods...) // pod 2 is the instance template pod
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				tplName := pods[i].Labels[constant.KBAppInstanceTemplateLabelKey]
+				newTplName := prefix
+				if tplName != "" {
+					newTplName = fmt.Sprintf("%s-%s", prefix, tplName)
+				}
+
+				mockClusterNShardingRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion1))
+					for _, tpl := range spec.Template.Instances {
+						if tpl.Name == newTplName {
+							if tplName == "" {
+								g.Expect(*tpl.Replicas).Should(Equal(i))
+							} else {
+								g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+							}
+						}
+					}
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				if tplName == "" {
+					mockCreatePods4Sharding([]int32{i + 10}, prefix)
+				} else {
+					mockCreatePods4Sharding([]int32{i + 10}, fmt.Sprintf("%s-%s", prefix, tplName))
+				}
+
+				mockClusterNShardingRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+					g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(0)))
+					g.Expect(spec.Template.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.Template.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNShardingRunning() // all old pods are deleted
+
+			By("checking the cluster spec finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+				g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(0)))
+				g.Expect(*spec.Template.Instances[1].Replicas + *spec.Template.Instances[2].Replicas).Should(Equal(replicas))
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+
+		It("tear down", func() {
+			By("creating pods for the component")
+			pods := mockCreatePods4Sharding([]int32{0, 1}, "")
+			pods = append(mockCreatePods4Sharding([]int32{2}, instanceTemplateName), pods...) // pod 2 is the instance template pod
+
+			createRolloutObj4Sharding(func(f *testapps.MockRolloutFactory) {
+				f.SetShardingServiceVersion(serviceVersion2).
+					SetShardingStrategy(defaultReplaceStrategy)
+			})
+
+			for i := int32(0); i < replicas; i++ {
+				prefix := replaceInstanceTemplateNamePrefix(rolloutObj)
+				tplName := pods[i].Labels[constant.KBAppInstanceTemplateLabelKey]
+				newTplName := prefix
+				if tplName != "" {
+					newTplName = fmt.Sprintf("%s-%s", prefix, tplName)
+				}
+
+				mockClusterNShardingRunning() // to up
+
+				By("checking the cluster spec after roll up")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas + 1))
+					g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion1))
+					for _, tpl := range spec.Template.Instances {
+						if tpl.Name == newTplName {
+							if tplName == "" {
+								g.Expect(*tpl.Replicas).Should(Equal(i))
+							} else {
+								g.Expect(*tpl.Replicas).Should(Equal(int32(1)))
+							}
+						}
+					}
+				})).Should(Succeed())
+
+				By("creating the new pod")
+				if tplName == "" {
+					mockCreatePods4Sharding([]int32{i + 10}, prefix)
+				} else {
+					mockCreatePods4Sharding([]int32{i + 10}, fmt.Sprintf("%s-%s", prefix, tplName))
+				}
+
+				mockClusterNShardingRunning() // to down
+
+				By("checking the cluster spec after scale down")
+				Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+					spec := cluster.Spec.Shardings[0]
+					g.Expect(spec.Template.Replicas).Should(Equal(replicas))
+					g.Expect(*spec.Template.Instances[0].Replicas).Should(Equal(int32(0)))
+					g.Expect(spec.Template.OfflineInstances).Should(HaveLen(int(i + 1)))
+					for j := int32(0); j < i+1; j++ {
+						g.Expect(spec.Template.OfflineInstances[j]).Should(Equal(pods[j].Name))
+					}
+				})).Should(Succeed())
+
+				By("deleting the scaled down pod")
+				Expect(testCtx.Cli.Delete(testCtx.Ctx, pods[i])).Should(Succeed())
+			}
+
+			mockClusterNShardingRunning() // all old pods are deleted
+
+			By("checking the cluster spec updated finally")
+			Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1.Cluster) {
+				spec := cluster.Spec.Shardings[0]
+				g.Expect(spec.Template.ServiceVersion).Should(Equal(serviceVersion2))
+				g.Expect(spec.Template.OfflineInstances).Should(BeEmpty())
+			})).Should(Succeed())
+
+			mockClusterNShardingRunning() // tear down will update the cluster spec
+
+			By("checking the rollout state as succeed")
+			Eventually(testapps.CheckObj(&testCtx, rolloutKey, func(g Gomega, rollout *appsv1alpha1.Rollout) {
+				g.Expect(rollout.Status.State).Should(Equal(appsv1alpha1.SucceedRolloutState))
+			})).Should(Succeed())
+		})
+	})
 })
diff --git a/pkg/testutil/apps/cluster_factory.go b/pkg/testutil/apps/cluster_factory.go
index 4a8f9d978..90eb98ddf 100644
--- a/pkg/testutil/apps/cluster_factory.go
+++ b/pkg/testutil/apps/cluster_factory.go
@@ -144,6 +144,30 @@ func (factory *MockClusterFactory) SetShards(shards int32) *MockClusterFactory {
 	})
 }
 
+func (factory *MockClusterFactory) SetShardingReplicas(replicas int32) *MockClusterFactory {
+	return factory.lastSharding(func(sharding *appsv1.ClusterSharding) {
+		sharding.Template.Replicas = replicas
+	})
+}
+
+func (factory *MockClusterFactory) SetShardingServiceVersion(serviceVersion string) *MockClusterFactory {
+	return factory.lastSharding(func(sharding *appsv1.ClusterSharding) {
+		sharding.Template.ServiceVersion = serviceVersion
+	})
+}
+
+func (factory *MockClusterFactory) AddShardingInstances(instance appsv1.InstanceTemplate) *MockClusterFactory {
+	return factory.lastSharding(func(sharding *appsv1.ClusterSharding) {
+		sharding.Template.Instances = append(sharding.Template.Instances, instance)
+	})
+}
+
+func (factory *MockClusterFactory) SetShardingFlatInstanceOrdinal(flatInstanceOrdinal bool) *MockClusterFactory {
+	return factory.lastSharding(func(sharding *appsv1.ClusterSharding) {
+		sharding.Template.FlatInstanceOrdinal = flatInstanceOrdinal
+	})
+}
+
 func (factory *MockClusterFactory) SetCompDef(compDef string) *MockClusterFactory {
 	return factory.lastComponentRef(func(comp *appsv1.ClusterComponentSpec) {
 		comp.ComponentDef = compDef
@@ -223,3 +247,9 @@ func (factory *MockClusterFactory) SetServiceRefs(serviceRefs []appsv1.ServiceRe
 		comp.ServiceRefs = serviceRefs
 	})
 }
+
+func (factory *MockClusterFactory) SetFlatInstanceOrdinal(flatInstanceOrdinal bool) *MockClusterFactory {
+	return factory.lastComponentRef(func(comp *appsv1.ClusterComponentSpec) {
+		comp.FlatInstanceOrdinal = flatInstanceOrdinal
+	})
+}
diff --git a/pkg/testutil/apps/component_factory.go b/pkg/testutil/apps/component_factory.go
index 67bb3f642..5ee364c19 100644
--- a/pkg/testutil/apps/component_factory.go
+++ b/pkg/testutil/apps/component_factory.go
@@ -120,3 +120,8 @@ func (factory *MockComponentFactory) AddInstances(instance appsv1.InstanceTempla
 	factory.Get().Spec.Instances = append(factory.Get().Spec.Instances, instance)
 	return factory
 }
+
+func (factory *MockComponentFactory) SetFlatInstanceOrdinal(flatInstanceOrdinal bool) *MockComponentFactory {
+	factory.Get().Spec.FlatInstanceOrdinal = flatInstanceOrdinal
+	return factory
+}
diff --git a/pkg/testutil/apps/rollout_factory.go b/pkg/testutil/apps/rollout_factory.go
index 8c78a79ae..77c7c0488 100644
--- a/pkg/testutil/apps/rollout_factory.go
+++ b/pkg/testutil/apps/rollout_factory.go
@@ -49,9 +49,17 @@ func (factory *MockRolloutFactory) AddComponent(compName string) *MockRolloutFac
 	return factory
 }
 
-type updateRollComponentFn func(*appsv1alpha1.RolloutComponent)
+func (factory *MockRolloutFactory) AddSharding(shardingName string) *MockRolloutFactory {
+	sharding := appsv1alpha1.RolloutSharding{
+		Name: shardingName,
+	}
+	factory.Get().Spec.Shardings = append(factory.Get().Spec.Shardings, sharding)
+	return factory
+}
 
-func (factory *MockRolloutFactory) updateLastComponent(update updateRollComponentFn) *MockRolloutFactory {
+type updateRolloutComponentFn func(*appsv1alpha1.RolloutComponent)
+
+func (factory *MockRolloutFactory) updateLastComponent(update updateRolloutComponentFn) *MockRolloutFactory {
 	comps := factory.Get().Spec.Components
 	if len(comps) > 0 {
 		update(&comps[len(comps)-1])
@@ -60,44 +68,61 @@ func (factory *MockRolloutFactory) updateLastComponent(update updateRollComponen
 	return factory
 }
 
-func (factory *MockRolloutFactory) SetServiceVersion(serviceVersion string) *MockRolloutFactory {
+func (factory *MockRolloutFactory) SetCompServiceVersion(serviceVersion string) *MockRolloutFactory {
 	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
 		comp.ServiceVersion = ptr.To(serviceVersion)
 	})
 }
 
-func (factory *MockRolloutFactory) SetCompDef(compDef string) *MockRolloutFactory {
+func (factory *MockRolloutFactory) SetCompCompDef(compDef string) *MockRolloutFactory {
 	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
 		comp.CompDef = ptr.To(compDef)
 	})
 }
 
-func (factory *MockRolloutFactory) SetStrategy(strategy appsv1alpha1.RolloutStrategy) *MockRolloutFactory {
+func (factory *MockRolloutFactory) SetCompStrategy(strategy appsv1alpha1.RolloutStrategy) *MockRolloutFactory {
 	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
 		comp.Strategy = strategy
 	})
 }
 
-func (factory *MockRolloutFactory) SetInplaceStrategy() *MockRolloutFactory {
+func (factory *MockRolloutFactory) SetCompReplicas(replicas int32) *MockRolloutFactory {
 	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
-		comp.Strategy.Inplace = &appsv1alpha1.RolloutStrategyInplace{}
+		comp.Replicas = ptr.To(intstr.FromInt32(replicas))
 	})
 }
 
-func (factory *MockRolloutFactory) SetReplaceStrategy() *MockRolloutFactory {
-	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
-		comp.Strategy.Replace = &appsv1alpha1.RolloutStrategyReplace{}
+type updateRolloutShardingFn func(*appsv1alpha1.RolloutSharding)
+
+func (factory *MockRolloutFactory) updateLastSharding(update updateRolloutShardingFn) *MockRolloutFactory {
+	shardings := factory.Get().Spec.Shardings
+	if len(shardings) > 0 {
+		update(&shardings[len(shardings)-1])
+	}
+	factory.Get().Spec.Shardings = shardings
+	return factory
+}
+
+func (factory *MockRolloutFactory) SetShardingDef(shardingDef string) *MockRolloutFactory {
+	return factory.updateLastSharding(func(sharding *appsv1alpha1.RolloutSharding) {
+		sharding.ShardingDef = ptr.To(shardingDef)
 	})
 }
 
-func (factory *MockRolloutFactory) SetCreateStrategy() *MockRolloutFactory {
-	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
-		comp.Strategy.Create = &appsv1alpha1.RolloutStrategyCreate{}
+func (factory *MockRolloutFactory) SetShardingServiceVersion(serviceVersion string) *MockRolloutFactory {
+	return factory.updateLastSharding(func(sharding *appsv1alpha1.RolloutSharding) {
+		sharding.ServiceVersion = ptr.To(serviceVersion)
 	})
 }
 
-func (factory *MockRolloutFactory) SetReplicas(replicas int32) *MockRolloutFactory {
-	return factory.updateLastComponent(func(comp *appsv1alpha1.RolloutComponent) {
-		comp.Replicas = ptr.To(intstr.FromInt32(replicas))
+func (factory *MockRolloutFactory) SetShardingCompDef(compDef string) *MockRolloutFactory {
+	return factory.updateLastSharding(func(sharding *appsv1alpha1.RolloutSharding) {
+		sharding.CompDef = ptr.To(compDef)
+	})
+}
+
+func (factory *MockRolloutFactory) SetShardingStrategy(strategy appsv1alpha1.RolloutStrategy) *MockRolloutFactory {
+	return factory.updateLastSharding(func(sharding *appsv1alpha1.RolloutSharding) {
+		sharding.Strategy = strategy
 	})
 }