LeaderWorkerSet API

Generated API reference documentation for leaderworkerset.x-k8s.io/v1.

Resource Types

LeaderWorkerSet

Appears in:

LeaderWorkerSet is the Schema for the leaderworkersets API

FieldDescription
apiVersion
string
leaderworkerset.x-k8s.io/v1
kind
string
LeaderWorkerSet
spec [Required]
LeaderWorkerSetSpec
No description provided.
status [Required]
LeaderWorkerSetStatus
No description provided.

LeaderWorkerSetSpec

Appears in:

One group consists of a single leader and M workers, and the total number of pods in a group is M+1. LeaderWorkerSet will create N replicas of leader-worker pod groups (hereinafter referred to as group).

Each group has a unique index between 0 and N-1. We call this the leaderIndex. The leaderIndex is used to uniquely name the leader pod of each group in the following format: leaderWorkerSetName-leaderIndex. This is considered as the name of the group too.

Each worker pod in the group has a unique workerIndex between 1 and M. The leader also gets a workerIndex, and it is always set to 0. Worker pods are named using the format: leaderWorkerSetName-leaderIndex-workerIndex.

FieldDescription
replicas
int32

Number of leader-workers groups. A scale subresource is available to enable HPA. The selector for HPA will be that of the leader pod, and so practically HPA will be looking up the leader pod metrics. Note that the leader pod could aggregate metrics from the rest of the group and expose them as a summary custom metric representing the whole group. On scale down, the leader pod as well as the workers statefulset will be deleted. Default to 1.

leaderWorkerTemplate [Required]
LeaderWorkerTemplate

LeaderWorkerTemplate defines the template for leader/worker pods

rolloutStrategy
RolloutStrategy

RolloutStrategy defines the strategy that will be applied to update replicas when a revision is made to the leaderWorkerTemplate.

startupPolicy
StartupPolicyType

StartupPolicy determines the startup policy for the worker statefulset.

networkConfig
NetworkConfig

NetworkConfig defines the network configuration of the group

LeaderWorkerSetStatus

Appears in:

LeaderWorkerSetStatus defines the observed state of LeaderWorkerSet

FieldDescription
conditions [Required]
[]k8s.io/apimachinery/pkg/apis/meta/v1.Condition

Conditions track the condition of the leaderworkerset.

readyReplicas [Required]
int32

ReadyReplicas track the number of groups that are in ready state (updated or not).

updatedReplicas [Required]
int32

UpdatedReplicas track the number of groups that have been updated (ready or not).

replicas [Required]
int32

Replicas track the total number of groups that have been created (updated or not, ready or not)

hpaPodSelector [Required]
string

HPAPodSelector for pods that belong to the LeaderWorkerSet object, this is needed for HPA to know what pods belong to the LeaderWorkerSet object. Here we only select the leader pods.

LeaderWorkerTemplate

Appears in:

Template of the leader/worker pods, the group will include at least one leader pod. Defaults to the worker template if not specified. The idea is to allow users to create a group with identical templates without needing to specify the template in both places. For the leader it represents the id of the group, while for the workers it represents the index within the group. For this reason, users should depend on the labels injected by this API whenever possible.

FieldDescription
leaderTemplate [Required]
k8s.io/api/core/v1.PodTemplateSpec

LeaderTemplate defines the pod template for leader pods.

workerTemplate [Required]
k8s.io/api/core/v1.PodTemplateSpec

WorkerTemplate defines the pod template for worker pods.

size
int32

Number of pods to create. It is the total number of pods in each group. The minimum is 1 which represent the leader. When set to 1, the leader pod is created for each group as well as a 0-replica StatefulSet for the workers. Default to 1.

restartPolicy
RestartPolicyType

RestartPolicy defines the restart policy when pod failures happen. The former named Default policy is deprecated, will be removed in the future, replace with None policy for the same behavior.

subGroupPolicy
SubGroupPolicy

SubGroupPolicy describes the policy that will be applied when creating subgroups in each replica.

NetworkConfig

Appears in:

FieldDescription
subdomainPolicy [Required]
SubdomainPolicy

SubdomainPolicy determines the policy that will be used when creating the headless service, defaults to shared

RestartPolicyType

(Alias of string)

Appears in:

RollingUpdateConfiguration

Appears in:

RollingUpdateConfiguration defines the parameters to be used for RollingUpdateStrategyType.

FieldDescription
maxUnavailable [Required]
k8s.io/apimachinery/pkg/util/intstr.IntOrString

The maximum number of replicas that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total replicas at the start of update (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old replicas can be scaled down by 30% immediately when the rolling update starts. Once new replicas are ready, old replicas can be scaled down further, followed by scaling up the new replicas, ensuring that at least 70% of original number of replicas are available at all times during the update.

maxSurge [Required]
k8s.io/apimachinery/pkg/util/intstr.IntOrString

The maximum number of replicas that can be scheduled above the original number of replicas. Value can be an absolute number (ex: 5) or a percentage of total replicas at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. By default, a value of 0 is used. Example: when this is set to 30%, the new replicas can be scaled up by 30% immediately when the rolling update starts. Once old replicas have been deleted, new replicas can be scaled up further, ensuring that total number of replicas running at any time during the update is at most 130% of original replicas. When rolling update completes, replicas will fall back to the original replicas.

RolloutStrategy

Appears in:

RolloutStrategy defines the strategy that the leaderWorkerSet controller will use to perform replica updates.

FieldDescription
type [Required]
RolloutStrategyType

Type defines the rollout strategy, it can only be “RollingUpdate” for now.

rollingUpdateConfiguration
RollingUpdateConfiguration

RollingUpdateConfiguration defines the parameters to be used when type is RollingUpdateStrategyType.

RolloutStrategyType

(Alias of string)

Appears in:

StartupPolicyType

(Alias of string)

Appears in:

SubGroupPolicy

Appears in:

SubGroupPolicy describes the policy that will be applied when creating subgroups.

FieldDescription
subGroupSize [Required]
int32

The number of pods per subgroup. This value is immutable, and must not be greater than LeaderWorkerSet.Spec.Size. Size must be divisible by subGroupSize in which case the subgroups will be of equal size. Or size - 1 is divisible by subGroupSize, in which case the leader is considered as the extra pod, and will be part of the first subgroup.

SubdomainPolicy

(Alias of string)

Appears in: