v1alpha1

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true +k8s:deepcopy-gen=package,register +groupName=placement.kubernetes-fleet.io

Index

Constants

View Source
const (

	// ClusterResourceOverrideKind is the kind of the ClusterResourceOverride.
	ClusterResourceOverrideKind = "ClusterResourceOverride"

	// ClusterResourceOverrideSnapshotKind is the kind of the ClusterResourceOverrideSnapshot.
	ClusterResourceOverrideSnapshotKind = "ClusterResourceOverrideSnapshot"

	// ResourceOverrideKind is the kind of the ResourceOverride.
	ResourceOverrideKind = "ResourceOverride"

	// ResourceOverrideSnapshotKind is the kind of the ResourceOverrideSnapshotKind.
	ResourceOverrideSnapshotKind = "ResourceOverrideSnapshot"
)
View Source
const (

	// OverrideIndexLabel is the label that indicate the policy snapshot index of a cluster policy.
	OverrideIndexLabel = fleetPrefix + "override-index"

	// OverrideSnapshotNameFmt is clusterResourceOverrideSnapshot name format: {CROName}-{OverrideSnapshotIndex}.
	OverrideSnapshotNameFmt = "%s-%d"

	// OverrideTrackingLabel is the label that points to the cluster resource override that creates a resource snapshot.
	OverrideTrackingLabel = fleetPrefix + "parent-resource-override"

	// OverrideFinalizer is a finalizer added by the override controllers to all override, to make sure
	// that the override controller can react to override deletions if necessary.
	OverrideFinalizer = fleetPrefix + "override-cleanup"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "placement.kubernetes-fleet.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AfterStageTask added in v0.10.12

type AfterStageTask struct {
	// The type of the after-stage task.
	// +kubebuilder:validation:Enum=TimedWait;Approval
	// +kubebuilder:validation:Required
	Type AfterStageTaskType `json:"type"`

	// The time to wait after all the clusters in the current stage complete the update before moving to the next stage.
	// +kubebuilder:default="1h"
	// +kubebuilder:validation:Pattern="^0|([0-9]+(\\.[0-9]+)?(s|m|h))+$"
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Optional
	WaitTime metav1.Duration `json:"waitTime,omitempty"`
}

AfterStageTask is the collection of post-stage tasks that ALL need to be completed before moving to the next stage.

func (*AfterStageTask) DeepCopy added in v0.10.12

func (in *AfterStageTask) DeepCopy() *AfterStageTask

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AfterStageTask.

func (*AfterStageTask) DeepCopyInto added in v0.10.12

func (in *AfterStageTask) DeepCopyInto(out *AfterStageTask)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AfterStageTaskConditionType added in v0.10.12

type AfterStageTaskConditionType string

AfterStageTaskConditionType identifies a specific condition of the AfterStageTask. +enum

const (
	// AfterStageTaskConditionApprovalRequestCreated indicates if the approval request has been created.
	// Its condition status can be:
	// - "True": The approval request has been created.
	AfterStageTaskConditionApprovalRequestCreated AfterStageTaskConditionType = "ApprovalRequestCreated"

	// AfterStageTaskConditionApprovalRequestApproved indicates if the approval request has been approved.
	// Its condition status can be:
	// - "True": The approval request has been approved.
	AfterStageTaskConditionApprovalRequestApproved AfterStageTaskConditionType = "ApprovalRequestApproved"

	// AfterStageTaskConditionWaitTimeElapsed indicates if the wait time after each stage has elapsed.
	// If the status is "False", the condition message will include the remaining wait time.
	// Its condition status can be:
	// - "True": The wait time has elapsed.
	// - "False": The wait time has not elapsed.
	AfterStageTaskConditionWaitTimeElapsed AfterStageTaskConditionType = "WaitTimeElapsed"
)

type AfterStageTaskStatus added in v0.10.12

type AfterStageTaskStatus struct {
	// The type of the post-update task.
	// +kubebuilder:validation:Enum=TimedWait;Approval
	// +kubebuilder:validation:Required
	Type AfterStageTaskType `json:"type"`

	// The name of the approval request object that is created for this stage.
	// Only valid if the AfterStageTaskType is Approval.
	// +kubebuilder:validation:Optional
	ApprovalRequestName string `json:"approvalRequestName,omitempty"`

	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	//
	// Conditions is an array of current observed conditions for the specific type of post-update task.
	// Known conditions are "ApprovalRequestCreated", "WaitTimeElapsed", and "ApprovalRequestApproved".
	// +kubebuilder:validation:Optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

func (*AfterStageTaskStatus) DeepCopy added in v0.10.12

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AfterStageTaskStatus.

func (*AfterStageTaskStatus) DeepCopyInto added in v0.10.12

func (in *AfterStageTaskStatus) DeepCopyInto(out *AfterStageTaskStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AfterStageTaskType added in v0.10.12

type AfterStageTaskType string

AfterStageTaskType identifies a specific type of the AfterStageTask. +enum

const (
	// AfterStageTaskTypeTimedWait indicates the post-stage task is a timed wait.
	AfterStageTaskTypeTimedWait AfterStageTaskType = "TimedWait"

	// AfterStageTaskTypeApproval indicates the post-stage task is an approval.
	AfterStageTaskTypeApproval AfterStageTaskType = "Approval"
)

type ApprovalRequestConditionType added in v0.10.12

type ApprovalRequestConditionType string

ApprovalRequestConditionType identifies a specific condition of the ClusterApprovalRequest.

const (
	// ApprovalRequestConditionApproved indicates if the approval request was approved.
	// Its condition status can be:
	// - "True": The request is approved.
	ApprovalRequestConditionApproved ApprovalRequestConditionType = "Approved"
)

type ApprovalRequestSpec added in v0.10.12

type ApprovalRequestSpec struct {
	// The name of the staged update run that this approval request is for.
	// +kubebuilder:validation:Required
	TargetUpdateRun string `json:"parentStageRollout"`

	// The name of the update stage that this approval request is for.
	// +kubebuilder:validation:Required
	TargetStage string `json:"targetStage"`
}

ApprovalRequestSpec defines the desired state of the update run approval request. The entire spec is immutable.

func (*ApprovalRequestSpec) DeepCopy added in v0.10.12

func (in *ApprovalRequestSpec) DeepCopy() *ApprovalRequestSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApprovalRequestSpec.

func (*ApprovalRequestSpec) DeepCopyInto added in v0.10.12

func (in *ApprovalRequestSpec) DeepCopyInto(out *ApprovalRequestSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ApprovalRequestStatus added in v0.10.12

type ApprovalRequestStatus struct {
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	//
	// Conditions is an array of current observed conditions for the specific type of post-update task.
	// Known conditions are "Approved" and "ApprovalAccepted".
	// +kubebuilder:validation:Optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

ApprovalRequestStatus defines the observed state of the ClusterApprovalRequest.

func (*ApprovalRequestStatus) DeepCopy added in v0.10.12

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApprovalRequestStatus.

func (*ApprovalRequestStatus) DeepCopyInto added in v0.10.12

func (in *ApprovalRequestStatus) DeepCopyInto(out *ApprovalRequestStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterApprovalRequest added in v0.11.2

type ClusterApprovalRequest struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ClusterApprovalRequest.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="The spec field is immutable"
	// +kubebuilder:validation:Required
	Spec ApprovalRequestSpec `json:"spec"`

	// The observed state of ClusterApprovalRequest.
	// +kubebuilder:validation:Optional
	Status ApprovalRequestStatus `json:"status,omitempty"`
}

ClusterApprovalRequest defines a request for user approval for cluster staged update run. The request object MUST have the following labels:

  • `TargetUpdateRun`: Points to the cluster staged update run that this approval request is for.
  • `TargetStage`: The name of the stage that this approval request is for.
  • `IsLatestUpdateRunApproval`: Indicates whether this approval request is the latest one related to this update run.

func (*ClusterApprovalRequest) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterApprovalRequest.

func (*ClusterApprovalRequest) DeepCopyInto added in v0.11.2

func (in *ClusterApprovalRequest) DeepCopyInto(out *ClusterApprovalRequest)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterApprovalRequest) DeepCopyObject added in v0.11.2

func (in *ClusterApprovalRequest) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterApprovalRequestList added in v0.11.2

type ClusterApprovalRequestList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterApprovalRequest `json:"items"`
}

ClusterApprovalRequestList contains a list of ClusterApprovalRequest. +kubebuilder:resource:scope=Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterApprovalRequestList) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterApprovalRequestList.

func (*ClusterApprovalRequestList) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterApprovalRequestList) DeepCopyObject added in v0.11.2

func (in *ClusterApprovalRequestList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourceOverride

type ClusterResourceOverride struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ClusterResourceOverrideSpec.
	// +required
	Spec ClusterResourceOverrideSpec `json:"spec"`
}

ClusterResourceOverride defines a group of override policies about how to override the selected cluster scope resources to target clusters.

func (*ClusterResourceOverride) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceOverride.

func (*ClusterResourceOverride) DeepCopyInto

func (in *ClusterResourceOverride) DeepCopyInto(out *ClusterResourceOverride)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourceOverride) DeepCopyObject

func (in *ClusterResourceOverride) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourceOverrideList

type ClusterResourceOverrideList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterResourceOverride `json:"items"`
}

ClusterResourceOverrideList contains a list of ClusterResourceOverride. +kubebuilder:resource:scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterResourceOverrideList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceOverrideList.

func (*ClusterResourceOverrideList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourceOverrideList) DeepCopyObject

func (in *ClusterResourceOverrideList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourceOverrideSnapshot added in v0.8.9

type ClusterResourceOverrideSnapshot struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ClusterResourceOverrideSnapshotSpec.
	// +required
	Spec ClusterResourceOverrideSnapshotSpec `json:"spec"`
}

ClusterResourceOverrideSnapshot is used to store a snapshot of ClusterResourceOverride. Its spec is immutable. We assign an ever-increasing index for snapshots. The naming convention of a ClusterResourceOverrideSnapshot is {ClusterResourceOverride}-{resourceIndex}. resourceIndex will begin with 0. Each snapshot MUST have the following labels:

  • `OverrideTrackingLabel` which points to its owner ClusterResourceOverride.
  • `IsLatestSnapshotLabel` which indicates whether the snapshot is the latest one.

func (*ClusterResourceOverrideSnapshot) DeepCopy added in v0.8.9

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceOverrideSnapshot.

func (*ClusterResourceOverrideSnapshot) DeepCopyInto added in v0.8.9

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourceOverrideSnapshot) DeepCopyObject added in v0.8.9

func (in *ClusterResourceOverrideSnapshot) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourceOverrideSnapshotList added in v0.8.9

type ClusterResourceOverrideSnapshotList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterResourceOverrideSnapshot `json:"items"`
}

ClusterResourceOverrideSnapshotList contains a list of ClusterResourceOverrideSnapshot. +kubebuilder:resource:scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterResourceOverrideSnapshotList) DeepCopy added in v0.8.9

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceOverrideSnapshotList.

func (*ClusterResourceOverrideSnapshotList) DeepCopyInto added in v0.8.9

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourceOverrideSnapshotList) DeepCopyObject added in v0.8.9

func (in *ClusterResourceOverrideSnapshotList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourceOverrideSnapshotSpec added in v0.8.9

type ClusterResourceOverrideSnapshotSpec struct {
	// OverrideSpec stores the spec of ClusterResourceOverride.
	OverrideSpec ClusterResourceOverrideSpec `json:"overrideSpec"`

	// OverrideHash is the sha-256 hash value of the OverrideSpec field.
	// +required
	OverrideHash []byte `json:"overrideHash"`
}

ClusterResourceOverrideSnapshotSpec defines the desired state of ClusterResourceOverride.

func (*ClusterResourceOverrideSnapshotSpec) DeepCopy added in v0.8.9

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceOverrideSnapshotSpec.

func (*ClusterResourceOverrideSnapshotSpec) DeepCopyInto added in v0.8.9

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterResourceOverrideSpec

type ClusterResourceOverrideSpec struct {
	// ClusterResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`.
	// If a namespace is selected, ALL the resources under the namespace are selected automatically.
	// LabelSelector is not supported.
	// You can have 1-20 selectors.
	// We only support Name selector for now.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=20
	// +required
	ClusterResourceSelectors []placementv1beta1.ClusterResourceSelector `json:"clusterResourceSelectors"`

	// Policy defines how to override the selected resources on the target clusters.
	// +required
	Policy *OverridePolicy `json:"policy"`
}

ClusterResourceOverrideSpec defines the desired state of the Override. The ClusterResourceOverride create or update will fail when the resource has been selected by the existing ClusterResourceOverride. If the resource is selected by both ClusterResourceOverride and ResourceOverride, ResourceOverride will win when resolving conflicts.

func (*ClusterResourceOverrideSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceOverrideSpec.

func (*ClusterResourceOverrideSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterResourcePlacementDisruptionBudget added in v0.11.2

type ClusterResourcePlacementDisruptionBudget struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is the desired state of the ClusterResourcePlacementDisruptionBudget.
	// +kubebuilder:validation:XValidation:rule="!(has(self.maxUnavailable) && has(self.minAvailable))",message="Both MaxUnavailable and MinAvailable cannot be specified"
	// +required
	Spec PlacementDisruptionBudgetSpec `json:"spec"`
}

ClusterResourcePlacementDisruptionBudget is the policy applied to a ClusterResourcePlacement object that specifies its disruption budget, i.e., how many placements (clusters) can be down at the same time due to voluntary disruptions (e.g., evictions). Involuntary disruptions are not subject to this budget, but will still count against it.

To apply a ClusterResourcePlacementDisruptionBudget to a ClusterResourcePlacement, use the same name for the ClusterResourcePlacementDisruptionBudget object as the ClusterResourcePlacement object. This guarantees a 1:1 link between the two objects.

func (*ClusterResourcePlacementDisruptionBudget) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementDisruptionBudget.

func (*ClusterResourcePlacementDisruptionBudget) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourcePlacementDisruptionBudget) DeepCopyObject added in v0.11.2

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourcePlacementDisruptionBudgetList added in v0.11.2

type ClusterResourcePlacementDisruptionBudgetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of PlacementDisruptionBudget objects.
	Items []ClusterResourcePlacementDisruptionBudget `json:"items"`
}

ClusterResourcePlacementDisruptionBudgetList contains a list of ClusterResourcePlacementDisruptionBudget objects. +kubebuilder:resource:scope=Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterResourcePlacementDisruptionBudgetList) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementDisruptionBudgetList.

func (*ClusterResourcePlacementDisruptionBudgetList) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourcePlacementDisruptionBudgetList) DeepCopyObject added in v0.11.2

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourcePlacementEviction added in v0.11.2

type ClusterResourcePlacementEviction struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is the desired state of the ClusterResourcePlacementEviction.
	//
	// Note that all fields in the spec are immutable.
	// +required
	Spec PlacementEvictionSpec `json:"spec"`

	// Status is the observed state of the ClusterResourcePlacementEviction.
	// +optional
	Status PlacementEvictionStatus `json:"status,omitempty"`
}

ClusterResourcePlacementEviction is an eviction attempt on a specific placement from a ClusterResourcePlacement object; one may use this API to force the removal of specific resources from a cluster.

An eviction is a voluntary disruption; its execution is subject to the disruption budget linked with the target ClusterResourcePlacement object (if present).

Beware that an eviction alone does not guarantee that a placement will not re-appear; i.e., after an eviction, the Fleet scheduler might still pick the previous target cluster for placement. To prevent this, considering adding proper taints to the target cluster before running an eviction that will exclude it from future placements; this is especially true in scenarios where one would like to perform a cluster replacement.

For safety reasons, Fleet will only execute an eviction once; the spec in this object is immutable, and once executed, the object will be ignored after. To trigger another eviction attempt on the same placement from the same ClusterResourcePlacement object, one must re-create (delete and create) the same Eviction object. Note also that an Eviction object will be ignored once it is deemed invalid (e.g., such an object might be targeting a CRP object or a placement that does not exist yet), even if it does become valid later (e.g., the CRP object or the placement appears later). To fix the situation, re-create the Eviction object.

Executed evictions might be kept around for a while for auditing purposes; the Fleet controllers might have a TTL set up for such objects and will garbage collect them automatically. For further information, see the Fleet documentation.

func (*ClusterResourcePlacementEviction) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementEviction.

func (*ClusterResourcePlacementEviction) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourcePlacementEviction) DeepCopyObject added in v0.11.2

func (in *ClusterResourcePlacementEviction) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterResourcePlacementEvictionList added in v0.11.2

type ClusterResourcePlacementEvictionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of ClusterResourcePlacementEviction objects.
	Items []ClusterResourcePlacementEviction `json:"items"`
}

ClusterResourcePlacementEvictionList contains a list of ClusterResourcePlacementEviction objects. +kubebuilder:resource:scope=Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterResourcePlacementEvictionList) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementEvictionList.

func (*ClusterResourcePlacementEvictionList) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterResourcePlacementEvictionList) DeepCopyObject added in v0.11.2

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterStagedUpdateRun added in v0.11.2

type ClusterStagedUpdateRun struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ClusterStagedUpdateRun. The spec is immutable.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="The spec field is immutable"
	Spec StagedUpdateRunSpec `json:"spec"`

	// The observed status of ClusterStagedUpdateRun.
	// +kubebuilder:validation:Optional
	Status StagedUpdateRunStatus `json:"status,omitempty"`
}

ClusterStagedUpdateRun represents a stage by stage update process that applies ClusterResourcePlacement selected resources to specified clusters. Resources from unselected clusters are removed after all stages in the update strategy are completed. Each ClusterStagedUpdateRun object corresponds to a single release of a specific resource version. The release is abandoned if the ClusterStagedUpdateRun object is deleted or the scheduling decision changes. The name of the ClusterStagedUpdateRun must conform to RFC 1123.

func (*ClusterStagedUpdateRun) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStagedUpdateRun.

func (*ClusterStagedUpdateRun) DeepCopyInto added in v0.11.2

func (in *ClusterStagedUpdateRun) DeepCopyInto(out *ClusterStagedUpdateRun)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterStagedUpdateRun) DeepCopyObject added in v0.11.2

func (in *ClusterStagedUpdateRun) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterStagedUpdateRunList added in v0.11.2

type ClusterStagedUpdateRunList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterStagedUpdateRun `json:"items"`
}

ClusterStagedUpdateRunList contains a list of ClusterStagedUpdateRun. +kubebuilder:resource:scope=Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterStagedUpdateRunList) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStagedUpdateRunList.

func (*ClusterStagedUpdateRunList) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterStagedUpdateRunList) DeepCopyObject added in v0.11.2

func (in *ClusterStagedUpdateRunList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterStagedUpdateStrategy added in v0.11.2

type ClusterStagedUpdateStrategy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ClusterStagedUpdateStrategy.
	// +kubebuilder:validation:Required
	Spec StagedUpdateStrategySpec `json:"spec"`
}

ClusterStagedUpdateStrategy defines a reusable strategy that specifies the stages and the sequence in which the selected cluster resources will be updated on the member clusters.

func (*ClusterStagedUpdateStrategy) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStagedUpdateStrategy.

func (*ClusterStagedUpdateStrategy) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterStagedUpdateStrategy) DeepCopyObject added in v0.11.2

func (in *ClusterStagedUpdateStrategy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterStagedUpdateStrategyList added in v0.11.2

type ClusterStagedUpdateStrategyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterStagedUpdateStrategy `json:"items"`
}

ClusterStagedUpdateStrategyList contains a list of StagedUpdateStrategy. +kubebuilder:resource:scope=Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterStagedUpdateStrategyList) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStagedUpdateStrategyList.

func (*ClusterStagedUpdateStrategyList) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterStagedUpdateStrategyList) DeepCopyObject added in v0.11.2

func (in *ClusterStagedUpdateStrategyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterUpdatingStatus added in v0.10.12

type ClusterUpdatingStatus struct {
	// The name of the cluster.
	// +kubebuilder:validation:Required
	ClusterName string `json:"clusterName"`

	// ResourceOverrideSnapshots is a list of ResourceOverride snapshots associated with the cluster.
	// The list is computed at the beginning of the update run and not updated during the update run.
	// The list is empty if there are no resource overrides associated with the cluster.
	// +kubebuilder:validation:Optional
	ResourceOverrideSnapshots []v1beta1.NamespacedName `json:"resourceOverrideSnapshots,omitempty"`

	// ClusterResourceOverrides contains a list of applicable ClusterResourceOverride snapshot names
	// associated with the cluster.
	// The list is computed at the beginning of the update run and not updated during the update run.
	// The list is empty if there are no cluster overrides associated with the cluster.
	// +kubebuilder:validation:Optional
	ClusterResourceOverrideSnapshots []string `json:"clusterResourceOverrideSnapshots,omitempty"`

	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	//
	// Conditions is an array of current observed conditions for clusters. Empty if the cluster has not started updating.
	// Known conditions are "Started", "Succeeded".
	// +kubebuilder:validation:Optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

ClusterUpdatingStatus defines the status of the update run on a cluster.

func (*ClusterUpdatingStatus) DeepCopy added in v0.10.12

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterUpdatingStatus.

func (*ClusterUpdatingStatus) DeepCopyInto added in v0.10.12

func (in *ClusterUpdatingStatus) DeepCopyInto(out *ClusterUpdatingStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterUpdatingStatusConditionType added in v0.10.12

type ClusterUpdatingStatusConditionType string

ClusterUpdatingStatusConditionType identifies a specific condition of the UpdatingStatus of the cluster. +enum

const (
	// ClusterUpdatingConditionStarted indicates whether the cluster updating has started.
	// Its condition status can be one of the following:
	// - "True": The cluster updating has started.
	ClusterUpdatingConditionStarted ClusterUpdatingStatusConditionType = "Started"

	// ClusterUpdatingConditionSucceeded indicates whether the cluster updating is completed successfully.
	// Its condition status can be one of the following:
	// - "True": The cluster updating is completed successfully.
	// - "False": The cluster updating encountered an error and stopped.
	ClusterUpdatingConditionSucceeded ClusterUpdatingStatusConditionType = "Succeeded"
)

type JSONPatchOverride

type JSONPatchOverride struct {
	// Operator defines the operation on the target field.
	// +kubebuilder:validation:Enum=add;remove;replace
	// +required
	Operator JSONPatchOverrideOperator `json:"op"`
	// Path defines the target location.
	// Note: override will fail if the resource path does not exist.
	// +required
	Path string `json:"path"`
	// Value defines the content to be applied on the target location.
	// Value should be empty when operator is `remove`.
	// +optional
	Value apiextensionsv1.JSON `json:"value,omitempty"`
}

JSONPatchOverride applies a JSON patch on the selected resources following [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902).

func (*JSONPatchOverride) DeepCopy

func (in *JSONPatchOverride) DeepCopy() *JSONPatchOverride

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONPatchOverride.

func (*JSONPatchOverride) DeepCopyInto

func (in *JSONPatchOverride) DeepCopyInto(out *JSONPatchOverride)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JSONPatchOverrideOperator

type JSONPatchOverrideOperator string

JSONPatchOverrideOperator defines the supported JSON patch operator.

const (
	// JSONPatchOverrideOpAdd adds the value to the target location.
	// An example target JSON document:
	//
	//   { "foo": [ "bar", "baz" ] }
	//
	//   A JSON Patch override:
	//
	//   [
	//     { "op": "add", "path": "/foo/1", "value": "qux" }
	//   ]
	//
	//   The resulting JSON document:
	//
	//   { "foo": [ "bar", "qux", "baz" ] }
	JSONPatchOverrideOpAdd JSONPatchOverrideOperator = "add"
	// JSONPatchOverrideOpRemove removes the value from the target location.
	// An example target JSON document:
	//
	//   {
	//     "baz": "qux",
	//     "foo": "bar"
	//   }
	//   A JSON Patch override:
	//
	//   [
	//     { "op": "remove", "path": "/baz" }
	//   ]
	//
	//   The resulting JSON document:
	//
	//   { "foo": "bar" }
	JSONPatchOverrideOpRemove JSONPatchOverrideOperator = "remove"
	// JSONPatchOverrideOpReplace replaces the value at the target location with a new value.
	// An example target JSON document:
	//
	//   {
	//     "baz": "qux",
	//     "foo": "bar"
	//   }
	//
	//   A JSON Patch override:
	//
	//   [
	//     { "op": "replace", "path": "/baz", "value": "boo" }
	//   ]
	//
	//   The resulting JSON document:
	//
	//   {
	//     "baz": "boo",
	//     "foo": "bar"
	//   }
	JSONPatchOverrideOpReplace JSONPatchOverrideOperator = "replace"
)

type OverridePolicy

type OverridePolicy struct {
	// OverrideRules defines an array of override rules to be applied on the selected resources.
	// The order of the rules determines the override order.
	// When there are two rules selecting the same fields on the target cluster, the last one will win.
	// You can have 1-20 rules.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=20
	// +required
	OverrideRules []OverrideRule `json:"overrideRules"`
}

OverridePolicy defines how to override the selected resources on the target clusters. More is to be added.

func (*OverridePolicy) DeepCopy

func (in *OverridePolicy) DeepCopy() *OverridePolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OverridePolicy.

func (*OverridePolicy) DeepCopyInto

func (in *OverridePolicy) DeepCopyInto(out *OverridePolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OverrideRule

type OverrideRule struct {
	// ClusterSelectors selects the target clusters.
	// The resources will be overridden before applying to the matching clusters.
	// An empty clusterSelector selects ALL the member clusters.
	// A nil clusterSelector selects NO member clusters.
	// For now, only labelSelector is supported.
	// +optional
	ClusterSelector *placementv1beta1.ClusterSelector `json:"clusterSelector,omitempty"`

	// JSONPatchOverrides defines a list of JSON patch override rules.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=20
	// +required
	JSONPatchOverrides []JSONPatchOverride `json:"jsonPatchOverrides"`
}

OverrideRule defines how to override the selected resources on the target clusters.

func (*OverrideRule) DeepCopy

func (in *OverrideRule) DeepCopy() *OverrideRule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OverrideRule.

func (*OverrideRule) DeepCopyInto

func (in *OverrideRule) DeepCopyInto(out *OverrideRule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlacementDisruptionBudgetSpec added in v0.11.2

type PlacementDisruptionBudgetSpec struct {
	// MaxUnavailable is the maximum number of placements (clusters) that can be down at the
	// same time due to voluntary disruptions. For example, a setting of 1 would imply that
	// a voluntary disruption (e.g., an eviction) can only happen if all placements (clusters)
	// from the linked Placement object are applied and available.
	//
	// This can be either an absolute value (e.g., 1) or a percentage (e.g., 10%).
	//
	// If a percentage is specified, Fleet will calculate the corresponding absolute values
	// as follows:
	// * if the linked Placement object is of the PickFixed placement type,
	//   the percentage is against the number of clusters specified in the placement (i.e., the
	//   length of ClusterNames field in the placement policy);
	// * if the linked Placement object is of the PickAll placement type,
	//   the percentage is against the total number of clusters being selected by the scheduler
	//   at the time of the evaluation of the disruption budget;
	// * if the linked Placement object is of the PickN placement type,
	//   the percentage is against the number of clusters specified in the placement (i.e., the
	//   value of the NumberOfClusters fields in the placement policy).
	// The end result will be rounded up to the nearest integer if applicable.
	//
	// One may use a value of 0 for this field; in this case, no voluntary disruption would be
	// allowed.
	//
	// This field is mutually exclusive with the MinAvailable field in the spec; exactly one
	// of them can be set at a time.
	//
	// +kubebuilder:validation:XIntOrString
	// +kubebuilder:validation:XValidation:rule="type(self) == string ? self.matches('^(100|[0-9]{1,2}%)$') : self >= 0",message="If supplied value is String should match regex '^(100|[0-9]{1,2}%)$' or If supplied value is Integer must be greater than or equal to 0"
	// +optional
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

	// MinAvailable is the minimum number of placements (clusters) that must be available at any
	// time despite voluntary disruptions. For example, a setting of 10 would imply that
	// a voluntary disruption (e.g., an eviction) can only happen if there are at least 11
	// placements (clusters) from the linked Placement object are applied and available.
	//
	// This can be either an absolute value (e.g., 1) or a percentage (e.g., 10%).
	//
	// If a percentage is specified, Fleet will calculate the corresponding absolute values
	// as follows:
	// * if the linked Placement object is of the PickFixed placement type,
	//   the percentage is against the number of clusters specified in the placement (i.e., the
	//   length of ClusterNames field in the placement policy);
	// * if the linked Placement object is of the PickAll placement type,
	//   the percentage is against the total number of clusters being selected by the scheduler
	//   at the time of the evaluation of the disruption budget;
	// * if the linked Placement object is of the PickN placement type,
	//   the percentage is against the number of clusters specified in the placement (i.e., the
	//   value of the NumberOfClusters fields in the placement policy).
	// The end result will be rounded up to the nearest integer if applicable.
	//
	// One may use a value of 0 for this field; in this case, voluntary disruption would be
	// allowed at any time.
	//
	// This field is mutually exclusive with the MaxUnavailable field in the spec; exactly one
	// of them can be set at a time.
	//
	// +kubebuilder:validation:XIntOrString
	// +kubebuilder:validation:XValidation:rule="type(self) == string ? self.matches('^(100|[0-9]{1,2}%)$') : self >= 0",message="If supplied value is String should match regex '^(100|[0-9]{1,2}%)$' or If supplied value is Integer must be greater than or equal to 0"
	// +optional
	MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`
}

PlacementDisruptionBudgetSpec is the desired state of the PlacementDisruptionBudget.

func (*PlacementDisruptionBudgetSpec) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementDisruptionBudgetSpec.

func (*PlacementDisruptionBudgetSpec) DeepCopyInto added in v0.11.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlacementEvictionConditionType added in v0.11.2

type PlacementEvictionConditionType string

PlacementEvictionConditionType identifies a specific condition of the PlacementEviction.

const (
	// PlacementEvictionConditionTypeValid indicates whether the Eviction object is valid.
	//
	// The following values are possible:
	// * True: the Eviction object is valid.
	// * False: the Eviction object is invalid; it might be targeting a CRP object or a placement
	//   that does not exist yet.
	//   Note that this is a terminal state; once an Eviction object is deemed invalid, it will
	//   not be evaluated again, even if the target appears later.
	PlacementEvictionConditionTypeValid PlacementEvictionConditionType = "Valid"

	// PlacementEvictionConditionTypeExecuted indicates whether the Eviction object has been executed.
	//
	// The following values are possible:
	// * True: the Eviction object has been executed.
	//   Note that this is a terminal state; once an Eviction object is executed, it will not be
	//   executed again.
	// * False: the Eviction object has not been executed yet.
	PlacementEvictionConditionTypeExecuted PlacementEvictionConditionType = "Executed"
)

type PlacementEvictionSpec added in v0.11.2

type PlacementEvictionSpec struct {
	// PlacementName is the name of the Placement object which
	// the Eviction object targets.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="The PlacementName field is immutable"
	// +kubebuilder:validation:MaxLength=255
	PlacementName string `json:"placementName"`

	// ClusterName is the name of the cluster that the Eviction object targets.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="The ClusterName field is immutable"
	// +kubebuilder:validation:MaxLength=255
	ClusterName string `json:"clusterName"`
}

PlacementEvictionSpec is the desired state of the parent PlacementEviction.

func (*PlacementEvictionSpec) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementEvictionSpec.

func (*PlacementEvictionSpec) DeepCopyInto added in v0.11.2

func (in *PlacementEvictionSpec) DeepCopyInto(out *PlacementEvictionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlacementEvictionStatus added in v0.11.2

type PlacementEvictionStatus struct {
	// Conditions is the list of currently observed conditions for the
	// PlacementEviction object.
	//
	// Available condition types include:
	// * Valid: whether the Eviction object is valid, i.e., it targets at a valid placement.
	// * Executed: whether the Eviction object has been executed.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

PlacementEvictionStatus is the observed state of the parent PlacementEviction.

func (*PlacementEvictionStatus) DeepCopy added in v0.11.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementEvictionStatus.

func (*PlacementEvictionStatus) DeepCopyInto added in v0.11.2

func (in *PlacementEvictionStatus) DeepCopyInto(out *PlacementEvictionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceOverride

type ResourceOverride struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ResourceOverrideSpec.
	// +required
	Spec ResourceOverrideSpec `json:"spec"`
}

ResourceOverride defines a group of override policies about how to override the selected namespaced scope resources to target clusters.

func (*ResourceOverride) DeepCopy

func (in *ResourceOverride) DeepCopy() *ResourceOverride

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverride.

func (*ResourceOverride) DeepCopyInto

func (in *ResourceOverride) DeepCopyInto(out *ResourceOverride)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceOverride) DeepCopyObject

func (in *ResourceOverride) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceOverrideList

type ResourceOverrideList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ResourceOverride `json:"items"`
}

ResourceOverrideList contains a list of ResourceOverride. +kubebuilder:resource:scope="Namespaced" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ResourceOverrideList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverrideList.

func (*ResourceOverrideList) DeepCopyInto

func (in *ResourceOverrideList) DeepCopyInto(out *ResourceOverrideList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceOverrideList) DeepCopyObject

func (in *ResourceOverrideList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceOverrideSnapshot added in v0.8.9

type ResourceOverrideSnapshot struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The desired state of ResourceOverrideSnapshot.
	// +required
	Spec ResourceOverrideSnapshotSpec `json:"spec"`
}

ResourceOverrideSnapshot is used to store a snapshot of ResourceOverride. Its spec is immutable. We assign an ever-increasing index for snapshots. The naming convention of a ResourceOverrideSnapshot is {ResourceOverride}-{resourceIndex}. resourceIndex will begin with 0. Each snapshot MUST have the following labels:

  • `OverrideTrackingLabel` which points to its owner ResourceOverride.
  • `IsLatestSnapshotLabel` which indicates whether the snapshot is the latest one.

func (*ResourceOverrideSnapshot) DeepCopy added in v0.8.9

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverrideSnapshot.

func (*ResourceOverrideSnapshot) DeepCopyInto added in v0.8.9

func (in *ResourceOverrideSnapshot) DeepCopyInto(out *ResourceOverrideSnapshot)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceOverrideSnapshot) DeepCopyObject added in v0.8.9

func (in *ResourceOverrideSnapshot) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceOverrideSnapshotList added in v0.8.9

type ResourceOverrideSnapshotList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ResourceOverrideSnapshot `json:"items"`
}

ResourceOverrideSnapshotList contains a list of ResourceOverrideSnapshot. +kubebuilder:resource:scope="Namespaced" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ResourceOverrideSnapshotList) DeepCopy added in v0.8.9

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverrideSnapshotList.

func (*ResourceOverrideSnapshotList) DeepCopyInto added in v0.8.9

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceOverrideSnapshotList) DeepCopyObject added in v0.8.9

func (in *ResourceOverrideSnapshotList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ResourceOverrideSnapshotSpec added in v0.8.9

type ResourceOverrideSnapshotSpec struct {
	// OverrideSpec stores the spec of ResourceOverride.
	OverrideSpec ResourceOverrideSpec `json:"overrideSpec"`

	// OverrideHash is the sha-256 hash value of the OverrideSpec field.
	// +required
	OverrideHash []byte `json:"overrideHash"`
}

ResourceOverrideSnapshotSpec defines the desired state of ResourceOverride.

func (*ResourceOverrideSnapshotSpec) DeepCopy added in v0.8.9

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverrideSnapshotSpec.

func (*ResourceOverrideSnapshotSpec) DeepCopyInto added in v0.8.9

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceOverrideSpec

type ResourceOverrideSpec struct {
	// ResourceSelectors is an array of selectors used to select namespace scoped resources. The selectors are `ORed`.
	// You can have 1-20 selectors.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=20
	// +required
	ResourceSelectors []ResourceSelector `json:"resourceSelectors"`

	// Policy defines how to override the selected resources on the target clusters.
	// +required
	Policy *OverridePolicy `json:"policy"`
}

ResourceOverrideSpec defines the desired state of the Override. The ResourceOverride create or update will fail when the resource has been selected by the existing ResourceOverride. If the resource is selected by both ClusterResourceOverride and ResourceOverride, ResourceOverride will win when resolving conflicts.

func (*ResourceOverrideSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverrideSpec.

func (*ResourceOverrideSpec) DeepCopyInto

func (in *ResourceOverrideSpec) DeepCopyInto(out *ResourceOverrideSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceSelector

type ResourceSelector struct {
	// Group name of the namespace-scoped resource.
	// Use an empty string to select resources under the core API group (e.g., services).
	// +required
	Group string `json:"group"`

	// Version of the namespace-scoped resource.
	// +required
	Version string `json:"version"`

	// Kind of the namespace-scoped resource.
	// +required
	Kind string `json:"kind"`

	// Name of the namespace-scoped resource.
	// +required
	Name string `json:"name"`
}

ResourceSelector is used to select namespace scoped resources as the target resources to be placed. All the fields are `ANDed`. In other words, a resource must match all the fields to be selected. The resource namespace will inherit from the parent object scope.

func (*ResourceSelector) DeepCopy

func (in *ResourceSelector) DeepCopy() *ResourceSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSelector.

func (*ResourceSelector) DeepCopyInto

func (in *ResourceSelector) DeepCopyInto(out *ResourceSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StageConfig added in v0.10.12

type StageConfig struct {
	// The name of the stage. This MUST be unique within the same StagedUpdateStrategy.
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern="[A-Za-z0-9]+$"
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// LabelSelector is a label query over all the joined member clusters. Clusters matching the query are selected
	// for this stage. There cannot be overlapping clusters between stages when the stagedUpdateRun is created.
	// If the label selector is absent, the stage includes all the selected clusters.
	// +kubebuilder:validation:Optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

	// The label key used to sort the selected clusters.
	// The clusters within the stage are updated sequentially following the rule below:
	//   - primary: Ascending order based on the value of the label key, interpreted as integers if present.
	//   - secondary: Ascending order based on the name of the cluster if the label key is absent or the label value is the same.
	// +kubebuilder:validation:Optional
	SortingLabelKey *string `json:"sortingLabelKey,omitempty"`

	// The collection of tasks that each stage needs to complete successfully before moving to the next stage.
	// Each task is executed in parallel and there cannot be more than one task of the same type.
	// +kubebuilder:validation:MaxItems=2
	// +kubebuilder:validation:Optional
	AfterStageTasks []AfterStageTask `json:"afterStageTasks,omitempty"`
}

StageConfig describes a single update stage. The clusters in each stage are updated sequentially. The update stops if any of the updates fail.

func (*StageConfig) DeepCopy added in v0.10.12

func (in *StageConfig) DeepCopy() *StageConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StageConfig.

func (*StageConfig) DeepCopyInto added in v0.10.12

func (in *StageConfig) DeepCopyInto(out *StageConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StageUpdatingConditionType added in v0.10.12

type StageUpdatingConditionType string

StageUpdatingConditionType identifies a specific condition of the stage that is being updated. +enum

const (
	// StageUpdatingConditionProgressing indicates whether the stage updating is making progress.
	// Its condition status can be one of the following:
	// - "True": The stage updating is making progress.
	// - "False": The stage updating is waiting/pausing.
	StageUpdatingConditionProgressing StageUpdatingConditionType = "Progressing"

	// StageUpdatingConditionSucceeded indicates whether the stage updating is completed successfully.
	// Its condition status can be one of the following:
	// - "True": The stage updating is completed successfully.
	// - "False": The stage updating encountered an error and stopped.
	StageUpdatingConditionSucceeded StageUpdatingConditionType = "Succeeded"
)

type StageUpdatingStatus added in v0.10.12

type StageUpdatingStatus struct {
	// The name of the stage.
	// +kubebuilder:validation:Required
	StageName string `json:"stageName"`

	// The list of each cluster's updating status in this stage.
	// +kubebuilder:validation:Required
	Clusters []ClusterUpdatingStatus `json:"clusters"`

	// The status of the post-update tasks associated with the current stage.
	// Empty if the stage has not finished updating all the clusters.
	// +kubebuilder:validation:MaxItems=2
	// +kubebuilder:validation:Optional
	AfterStageTaskStatus []AfterStageTaskStatus `json:"afterStageTaskStatus,omitempty"`

	// The time when the update started on the stage. Empty if the stage has not started updating.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Format=date-time
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// The time when the update finished on the stage. Empty if the stage has not started updating.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Format=date-time
	EndTime *metav1.Time `json:"endTime,omitempty"`

	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	//
	// Conditions is an array of current observed updating conditions for the stage. Empty if the stage has not started updating.
	// Known conditions are "Progressing", "Succeeded".
	// +kubebuilder:validation:Optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

StageUpdatingStatus defines the status of the update run in a stage.

func (*StageUpdatingStatus) DeepCopy added in v0.10.12

func (in *StageUpdatingStatus) DeepCopy() *StageUpdatingStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StageUpdatingStatus.

func (*StageUpdatingStatus) DeepCopyInto added in v0.10.12

func (in *StageUpdatingStatus) DeepCopyInto(out *StageUpdatingStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StagedUpdateRunConditionType added in v0.10.12

type StagedUpdateRunConditionType string

StagedUpdateRunConditionType identifies a specific condition of the StagedUpdateRun. +enum

const (
	// StagedUpdateRunConditionInitialized indicates whether the staged update run is initialized, meaning it
	// has computed all the stages according to the referenced strategy and is ready to start the update.
	// Its condition status can be one of the following:
	// - "True": The staged update run is initialized successfully.
	// - "False": The staged update run encountered an error during initialization and aborted.
	// - "Unknown": The staged update run initialization has started.
	StagedUpdateRunConditionInitialized StagedUpdateRunConditionType = "Initialized"

	// StagedUpdateRunConditionProgressing indicates whether the staged update run is making progress.
	// Its condition status can be one of the following:
	// - "True": The staged update run is making progress.
	// - "False": The staged update run is waiting/paused.
	// - "Unknown" means it is unknown.
	StagedUpdateRunConditionProgressing StagedUpdateRunConditionType = "Progressing"

	// StagedUpdateRunConditionSucceeded indicates whether the staged update run is completed successfully.
	// Its condition status can be one of the following:
	// - "True": The staged update run is completed successfully.
	// - "False": The staged update run encountered an error and stopped.
	StagedUpdateRunConditionSucceeded StagedUpdateRunConditionType = "Succeeded"
)

type StagedUpdateRunSpec added in v0.10.12

type StagedUpdateRunSpec struct {
	// PlacementName is the name of placement that this update run is applied to.
	// There can be multiple active update runs for each placement, but
	// it's up to the DevOps team to ensure they don't conflict with each other.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=255
	PlacementName string `json:"placementName"`

	// The resource snapshot index of the selected resources to be updated across clusters.
	// The index represents a group of resource snapshots that includes all the resources a ResourcePlacement selected.
	// +kubebuilder:validation:Required
	ResourceSnapshotIndex string `json:"resourceSnapshotIndex"`

	// The name of the update strategy that specifies the stages and the sequence
	// in which the selected resources will be updated on the member clusters. The stages
	// are computed according to the referenced strategy when the update run starts
	// and recorded in the status field.
	// +kubebuilder:validation:Required
	StagedUpdateStrategyName string `json:"stagedRolloutStrategyName"`
}

StagedUpdateRunSpec defines the desired rollout strategy and the snapshot indices of the resources to be updated. It specifies a stage-by-stage update process across selected clusters for the given ResourcePlacement object.

func (*StagedUpdateRunSpec) DeepCopy added in v0.10.12

func (in *StagedUpdateRunSpec) DeepCopy() *StagedUpdateRunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StagedUpdateRunSpec.

func (*StagedUpdateRunSpec) DeepCopyInto added in v0.10.12

func (in *StagedUpdateRunSpec) DeepCopyInto(out *StagedUpdateRunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StagedUpdateRunStatus added in v0.10.12

type StagedUpdateRunStatus struct {
	// PolicySnapShotIndexUsed records the policy snapshot index of the ClusterResourcePlacement (CRP) that
	// the update run is based on. The index represents the latest policy snapshot at the start of the update run.
	// If a newer policy snapshot is detected after the run starts, the staged update run is abandoned.
	// The scheduler must identify all clusters that meet the current policy before the update run begins.
	// All clusters involved in the update run are selected from the list of clusters scheduled by the CRP according
	// to the current policy.
	// +kubebuilder:validation:Optional
	PolicySnapshotIndexUsed string `json:"policySnapshotIndexUsed,omitempty"`

	// PolicyObservedClusterCount records the number of observed clusters in the policy snapshot.
	// It is recorded at the beginning of the update run from the policy snapshot object.
	// If the `ObservedClusterCount` value is updated during the update run, the update run is abandoned.
	// +kubebuilder:validation:Optional
	PolicyObservedClusterCount int `json:"policyObservedClusterCount,omitempty"`

	// ApplyStrategy is the apply strategy that the stagedUpdateRun is using.
	// It is the same as the apply strategy in the CRP when the staged update run starts.
	// The apply strategy is not updated during the update run even if it changes in the CRP.
	// +kubebuilder:validation:Optional
	ApplyStrategy *v1beta1.ApplyStrategy `json:"appliedStrategy,omitempty"`

	// StagedUpdateStrategySnapshot is the snapshot of the StagedUpdateStrategy used for the update run.
	// The snapshot is immutable during the update run.
	// The strategy is applied to the list of clusters scheduled by the CRP according to the current policy.
	// The update run fails to initialize if the strategy fails to produce a valid list of stages where each selected
	// cluster is included in exactly one stage.
	// +kubebuilder:validation:Optional
	StagedUpdateStrategySnapshot *StagedUpdateStrategySpec `json:"stagedUpdateStrategySnapshot,omitempty"`

	// StagesStatus lists the current updating status of each stage.
	// The list is empty if the update run is not started or failed to initialize.
	// +kubebuilder:validation:Optional
	StagesStatus []StageUpdatingStatus `json:"stagesStatus,omitempty"`

	// DeletionStageStatus lists the current status of the deletion stage. The deletion stage
	// removes all the resources from the clusters that are not selected by the
	// current policy after all the update stages are completed.
	// +kubebuilder:validation:Optional
	DeletionStageStatus *StageUpdatingStatus `json:"deletionStageStatus,omitempty"`

	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	//
	// Conditions is an array of current observed conditions for StagedUpdateRun.
	// Known conditions are "Initialized", "Progressing", "Succeeded".
	// +kubebuilder:validation:Optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

StagedUpdateRunStatus defines the observed state of the ClusterStagedUpdateRun.

func (*StagedUpdateRunStatus) DeepCopy added in v0.10.12

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StagedUpdateRunStatus.

func (*StagedUpdateRunStatus) DeepCopyInto added in v0.10.12

func (in *StagedUpdateRunStatus) DeepCopyInto(out *StagedUpdateRunStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StagedUpdateStrategySpec added in v0.10.12

type StagedUpdateStrategySpec struct {
	// Stage specifies the configuration for each update stage.
	// +kubebuilder:validation:MaxItems=31
	// +kubebuilder:validation:Required
	Stages []StageConfig `json:"stages"`
}

StagedUpdateStrategySpec defines the desired state of the StagedUpdateStrategy.

func (*StagedUpdateStrategySpec) DeepCopy added in v0.10.12

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StagedUpdateStrategySpec.

func (*StagedUpdateStrategySpec) DeepCopyInto added in v0.10.12

func (in *StagedUpdateStrategySpec) DeepCopyInto(out *StagedUpdateStrategySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL