v1alpha1

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 8 Imported by: 3

Documentation

Overview

+kubebuilder:object:generate=true +k8s:deepcopy-gen=package,register +groupName=fleet.azure.com

+kubebuilder:object:generate=true +groupName=fleet.azure.com

Index

Constants

View Source
const (
	MemberClusterKind                = "MemberCluster"
	MemberClusterResource            = "memberclusters"
	InternalMemberClusterKind        = "InternalMemberCluster"
	ClusterResourcePlacementKind     = "ClusterResourcePlacement"
	ClusterResourcePlacementResource = "clusterresourceplacements"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "fleet.azure.com", 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 Affinity

type Affinity struct {
	// ClusterAffinity contains cluster affinity scheduling rules for the selected resources.
	// +optional
	ClusterAffinity *ClusterAffinity `json:"clusterAffinity,omitempty"`
}

Affinity is a group of cluster affinity scheduling rules. More to be added.

func (*Affinity) DeepCopy

func (in *Affinity) DeepCopy() *Affinity

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

func (*Affinity) DeepCopyInto

func (in *Affinity) DeepCopyInto(out *Affinity)

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

type AgentConditionType

type AgentConditionType string

AgentConditionType identifies a specific condition on the Agent.

const (
	// AgentJoined indicates the join condition of the given member agent.
	// Its condition status can be one of the following:
	// - "True" means the member agent has joined.
	// - "False" means the member agent has left.
	// - "Unknown" means the member agent is joining or leaving or in an unknown status.
	AgentJoined AgentConditionType = "Joined"
	// AgentHealthy indicates the health condition of the given member agent.
	// Its condition status can be one of the following:
	// - "True" means the member agent is healthy.
	// - "False" means the member agent is unhealthy.
	// - "Unknown" means the member agent has an unknown health status.
	AgentHealthy AgentConditionType = "Healthy"
)

type AgentStatus

type AgentStatus struct {
	// Type of the member agent.
	// +required
	Type AgentType `json:"type"`

	// Conditions is an array of current observed conditions for the member agent.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Last time we received a heartbeat from the member agent.
	// +optional
	LastReceivedHeartbeat metav1.Time `json:"lastReceivedHeartbeat,omitempty"`
}

AgentStatus defines the observed status of the member agent of the given type.

func (*AgentStatus) DeepCopy

func (in *AgentStatus) DeepCopy() *AgentStatus

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

func (*AgentStatus) DeepCopyInto

func (in *AgentStatus) DeepCopyInto(out *AgentStatus)

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

type AgentType

type AgentType string

AgentType defines a type of agent/binary running in a member cluster.

const (
	// MemberAgent (core) handles member cluster joining/leaving as well as k8s object placement from hub to member clusters.
	MemberAgent AgentType = "MemberAgent"
	// MultiClusterServiceAgent (networking) is responsible for exposing multi-cluster services via L4 load
	// balancer.
	MultiClusterServiceAgent AgentType = "MultiClusterServiceAgent"
	// ServiceExportImportAgent (networking) is responsible for export or import services across multi-clusters.
	ServiceExportImportAgent AgentType = "ServiceExportImportAgent"
)

type ClusterAffinity

type ClusterAffinity struct {

	// ClusterSelectorTerms is a list of cluster selector terms. The terms are `ORed`.
	// +optional
	ClusterSelectorTerms []ClusterSelectorTerm `json:"clusterSelectorTerms,omitempty"`
}

ClusterAffinity contains cluster affinity scheduling rules for the selected resources.

func (*ClusterAffinity) DeepCopy

func (in *ClusterAffinity) DeepCopy() *ClusterAffinity

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

func (*ClusterAffinity) DeepCopyInto

func (in *ClusterAffinity) DeepCopyInto(out *ClusterAffinity)

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

type ClusterResourcePlacement

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

	// The desired state of ClusterResourcePlacement.
	// +required
	Spec ClusterResourcePlacementSpec `json:"spec"`

	// The observed status of ClusterResourcePlacement.
	// +optional
	Status ClusterResourcePlacementStatus `json:"status,omitempty"`
}

ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet. If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. Note that you can't select the following resources: - reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces). - reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, MultiClusterService, ServiceImport, etc.

func (*ClusterResourcePlacement) DeepCopy

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

func (*ClusterResourcePlacement) DeepCopyInto

func (in *ClusterResourcePlacement) DeepCopyInto(out *ClusterResourcePlacement)

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

func (*ClusterResourcePlacement) DeepCopyObject

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

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

func (*ClusterResourcePlacement) GetCondition

func (m *ClusterResourcePlacement) GetCondition(conditionType string) *metav1.Condition

func (*ClusterResourcePlacement) SetConditions

func (m *ClusterResourcePlacement) SetConditions(conditions ...metav1.Condition)

type ClusterResourcePlacementList

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

ClusterResourcePlacementList contains a list of ClusterResourcePlacement.

func (*ClusterResourcePlacementList) DeepCopy

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

func (*ClusterResourcePlacementList) DeepCopyInto

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

func (*ClusterResourcePlacementList) DeepCopyObject

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

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

type ClusterResourcePlacementSpec

type ClusterResourcePlacementSpec struct {

	// ResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`.
	// You can have 1-100 selectors.
	// +required
	ResourceSelectors []ClusterResourceSelector `json:"resourceSelectors"`

	// Policy defines how to select member clusters to place the selected resources.
	// If unspecified, all the joined member clusters are selected.
	// +optional
	Policy *PlacementPolicy `json:"policy,omitempty"`
}

ClusterResourcePlacementSpec defines the desired state of ClusterResourcePlacement.

func (*ClusterResourcePlacementSpec) DeepCopy

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

func (*ClusterResourcePlacementSpec) DeepCopyInto

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

type ClusterResourcePlacementStatus

type ClusterResourcePlacementStatus struct {

	// Conditions is an array of current observed conditions for ClusterResourcePlacement.
	// +optional
	Conditions []metav1.Condition `json:"conditions"`

	// SelectedResources contains a list of resources selected by ResourceSelectors.
	// +optional
	SelectedResources []ResourceIdentifier `json:"selectedResources,omitempty"`

	// TargetClusters contains a list of names of member clusters selected by PlacementPolicy.
	// Note that the clusters must be both joined and meeting PlacementPolicy.
	// +optional
	TargetClusters []string `json:"targetClusters,omitempty"`

	// FailedResourcePlacements is a list of all the resources failed to be placed to the given clusters.
	// Note that we only include 1000 failed resource placements even if there are more than 1000.
	// +optional
	FailedResourcePlacements []FailedResourcePlacement `json:"failedPlacements,omitempty"`
}

ClusterResourcePlacementStatus defines the observed state of resource.

func (*ClusterResourcePlacementStatus) DeepCopy

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

func (*ClusterResourcePlacementStatus) DeepCopyInto

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

type ClusterResourceSelector

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

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

	// Kind of the cluster-scoped resource.
	// Note: When `Kind` is `namespace`, ALL the resources under the selected namespaces are selected.
	// +required
	Kind string `json:"kind"`

	// Name of the cluster-scoped resource.
	// +optional
	Name string `json:"name,omitempty"`

	// A label query over all the cluster-scoped resources. Resources matching the query are selected.
	// Note that namespace-scoped resources can't be selected even if they match the query.
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}

ClusterResourceSelector is used to select cluster scoped resources as the target resources to be placed. If a namespace is selected, ALL the resources under the namespace are selected automatically. All the fields are `ANDed`. In other words, a resource must match all the fields to be selected.

func (*ClusterResourceSelector) DeepCopy

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

func (*ClusterResourceSelector) DeepCopyInto

func (in *ClusterResourceSelector) DeepCopyInto(out *ClusterResourceSelector)

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

type ClusterSelectorTerm

type ClusterSelectorTerm struct {
	// LabelSelector is a label query over all the joined member clusters. Clusters matching the query are selected.
	// +required
	LabelSelector metav1.LabelSelector `json:"labelSelector"`
}

ClusterSelectorTerm contains the requirements to select clusters.

func (*ClusterSelectorTerm) DeepCopy

func (in *ClusterSelectorTerm) DeepCopy() *ClusterSelectorTerm

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

func (*ClusterSelectorTerm) DeepCopyInto

func (in *ClusterSelectorTerm) DeepCopyInto(out *ClusterSelectorTerm)

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

type ClusterState

type ClusterState string
const (
	ClusterStateJoin       ClusterState = "Join"
	ClusterStateLeave      ClusterState = "Leave"
	MemberClusterFinalizer              = "work.fleet.azure.com/membercluster-finalizer"
)

type ConditionedAgentObj added in v0.6.7

type ConditionedAgentObj interface {
	client.Object
	ConditionedWithType
}

A ConditionedAgentObj is for kubernetes resources where multiple agents can set and update conditions within AgentStatus. +kubebuilder:object:generate=false

type ConditionedWithType added in v0.6.7

type ConditionedWithType interface {
	SetConditionsWithType(AgentType, ...metav1.Condition)
	GetConditionWithType(AgentType, string) *metav1.Condition
}

A ConditionedWithType may have conditions set or retrieved based on agent type. Conditions typically indicate the status of both a resource and its reconciliation process. +kubebuilder:object:generate=false

type FailedResourcePlacement

type FailedResourcePlacement struct {
	// The resource failed to be placed.
	// +required
	ResourceIdentifier `json:",inline"`

	// Name of the member cluster that the resource is placed to.
	// +required
	ClusterName string `json:"clusterName"`

	// The failed condition status.
	// +required
	Condition metav1.Condition `json:"condition"`
}

FailedResourcePlacement contains the failure details of a failed resource placement.

func (*FailedResourcePlacement) DeepCopy

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

func (*FailedResourcePlacement) DeepCopyInto

func (in *FailedResourcePlacement) DeepCopyInto(out *FailedResourcePlacement)

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

type InternalMemberCluster

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

	// The desired state of InternalMemberCluster.
	// +required
	Spec InternalMemberClusterSpec `json:"spec"`

	// The observed status of InternalMemberCluster.
	// +optional
	Status InternalMemberClusterStatus `json:"status,omitempty"`
}

InternalMemberCluster is used by hub agent to notify the member agents about the member cluster state changes, and is used by the member agents to report their status.

func (*InternalMemberCluster) DeepCopy

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

func (*InternalMemberCluster) DeepCopyInto

func (in *InternalMemberCluster) DeepCopyInto(out *InternalMemberCluster)

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

func (*InternalMemberCluster) DeepCopyObject

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

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

func (*InternalMemberCluster) GetAgentStatus added in v0.3.0

func (m *InternalMemberCluster) GetAgentStatus(agentType AgentType) *AgentStatus

GetAgentStatus is used to retrieve agent status from internal member cluster, if it doesn't exist it creates the expected agent status and returns it.

func (*InternalMemberCluster) GetConditionWithType added in v0.3.0

func (m *InternalMemberCluster) GetConditionWithType(agentType AgentType, conditionType string) *metav1.Condition

GetConditionWithType is used to retrieve the desired condition from AgentStatus for given agentType

func (*InternalMemberCluster) SetConditionsWithType added in v0.3.0

func (m *InternalMemberCluster) SetConditionsWithType(agentType AgentType, conditions ...metav1.Condition)

SetConditionsWithType is used to add condition to AgentStatus for a given agentType.

type InternalMemberClusterList

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

InternalMemberClusterList contains a list of InternalMemberCluster.

func (*InternalMemberClusterList) DeepCopy

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

func (*InternalMemberClusterList) DeepCopyInto

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

func (*InternalMemberClusterList) DeepCopyObject

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

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

type InternalMemberClusterSpec

type InternalMemberClusterSpec struct {

	// The desired state of the member cluster. Possible values: Join, Leave.
	// +required
	State ClusterState `json:"state"`

	// How often (in seconds) for the member cluster to send a heartbeat to the hub cluster. Default: 60 seconds. Min: 1 second. Max: 10 minutes.
	// +optional
	HeartbeatPeriodSeconds int32 `json:"heartbeatPeriodSeconds,omitempty"`
}

InternalMemberClusterSpec defines the desired state of InternalMemberCluster. Set by the hub agent.

func (*InternalMemberClusterSpec) DeepCopy

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

func (*InternalMemberClusterSpec) DeepCopyInto

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

type InternalMemberClusterStatus

type InternalMemberClusterStatus struct {
	// The current observed resource usage of the member cluster. It is populated by the member agent.
	// +optional
	ResourceUsage ResourceUsage `json:"resourceUsage,omitempty"`

	// AgentStatus is an array of current observed status, each corresponding to one member agent running in the member cluster.
	// +optional
	AgentStatus []AgentStatus `json:"agentStatus,omitempty"`
}

InternalMemberClusterStatus defines the observed state of InternalMemberCluster.

func (*InternalMemberClusterStatus) DeepCopy

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

func (*InternalMemberClusterStatus) DeepCopyInto

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

type MemberCluster

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

	// The desired state of MemberCluster.
	// +required
	Spec MemberClusterSpec `json:"spec"`

	// The observed status of MemberCluster.
	// +optional
	Status MemberClusterStatus `json:"status,omitempty"`
}

MemberCluster is a resource created in the hub cluster to represent a member cluster within a fleet.

func (*MemberCluster) DeepCopy

func (in *MemberCluster) DeepCopy() *MemberCluster

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

func (*MemberCluster) DeepCopyInto

func (in *MemberCluster) DeepCopyInto(out *MemberCluster)

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

func (*MemberCluster) DeepCopyObject

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

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

func (*MemberCluster) GetCondition

func (m *MemberCluster) GetCondition(conditionType string) *metav1.Condition

func (*MemberCluster) RemoveCondition

func (m *MemberCluster) RemoveCondition(conditionType string)

func (*MemberCluster) SetConditions

func (m *MemberCluster) SetConditions(conditions ...metav1.Condition)

type MemberClusterConditionType added in v0.5.5

type MemberClusterConditionType string

MemberClusterConditionType defines a specific condition of a member cluster.

const (
	// ConditionTypeMemberClusterReadyToJoin indicates the readiness condition of the given member cluster for joining the hub cluster.
	// Its condition status can be one of the following:
	// - "True" means the hub cluster is ready for the member cluster to join.
	// - "False" means the hub cluster is not ready for the member cluster to join.
	// - "Unknown" means it is unknown whether the hub cluster is ready for the member cluster to join.
	ConditionTypeMemberClusterReadyToJoin MemberClusterConditionType = "ReadyToJoin"

	// ConditionTypeMemberClusterJoined indicates the join condition of the given member cluster.
	// Its condition status can be one of the following:
	// - "True" means all the agents on the member cluster have joined.
	// - "False" means all the agents on the member cluster have left.
	// - "Unknown" means not all the agents have joined or left.
	ConditionTypeMemberClusterJoined MemberClusterConditionType = "Joined"

	// ConditionTypeMemberClusterHealthy indicates the health condition of the given member cluster.
	// Its condition status can be one of the following:
	// - "True" means the member cluster is healthy.
	// - "False" means the member cluster is unhealthy.
	// - "Unknown" means the member cluster has an unknown health status.
	// NOTE: This condition type is currently unused.
	ConditionTypeMemberClusterHealthy MemberClusterConditionType = "Healthy"
)

type MemberClusterList

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

MemberClusterList contains a list of MemberCluster.

func (*MemberClusterList) DeepCopy

func (in *MemberClusterList) DeepCopy() *MemberClusterList

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

func (*MemberClusterList) DeepCopyInto

func (in *MemberClusterList) DeepCopyInto(out *MemberClusterList)

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

func (*MemberClusterList) DeepCopyObject

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

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

type MemberClusterSpec

type MemberClusterSpec struct {

	// The desired state of the member cluster. Possible values: Join, Leave.
	// +required
	State ClusterState `json:"state"`

	// The identity used by the member cluster to access the hub cluster.
	// The hub agents deployed on the hub cluster will automatically grant the minimal required permissions to this identity for the member agents deployed on the member cluster to access the hub cluster.
	// +required
	Identity rbacv1.Subject `json:"identity"`

	// How often (in seconds) for the member cluster to send a heartbeat to the hub cluster. Default: 60 seconds. Min: 1 second. Max: 10 minutes.
	// +optional
	HeartbeatPeriodSeconds int32 `json:"heartbeatPeriodSeconds,omitempty"`
}

MemberClusterSpec defines the desired state of MemberCluster.

func (*MemberClusterSpec) DeepCopy

func (in *MemberClusterSpec) DeepCopy() *MemberClusterSpec

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

func (*MemberClusterSpec) DeepCopyInto

func (in *MemberClusterSpec) DeepCopyInto(out *MemberClusterSpec)

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

type MemberClusterStatus

type MemberClusterStatus struct {

	// Conditions is an array of current observed conditions for the member cluster.
	// +optional
	Conditions []metav1.Condition `json:"conditions"`

	// The current observed resource usage of the member cluster. It is copied from the corresponding InternalMemberCluster object.
	// +optional
	ResourceUsage ResourceUsage `json:"resourceUsage,omitempty"`

	// AgentStatus is an array of current observed status, each corresponding to one member agent running in the member cluster.
	// +optional
	AgentStatus []AgentStatus `json:"agentStatus,omitempty"`
}

MemberClusterStatus defines the observed status of MemberCluster.

func (*MemberClusterStatus) DeepCopy

func (in *MemberClusterStatus) DeepCopy() *MemberClusterStatus

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

func (*MemberClusterStatus) DeepCopyInto

func (in *MemberClusterStatus) DeepCopyInto(out *MemberClusterStatus)

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

type PlacementPolicy

type PlacementPolicy struct {

	// ClusterNames contains a list of names of MemberCluster to place the selected resources.
	// If the list is not empty, Affinity is ignored.
	// +optional
	ClusterNames []string `json:"clusterNames,omitempty"`

	// Affinity contains cluster affinity scheduling rules. Defines which member clusters to place the selected resources.
	// +optional
	Affinity *Affinity `json:"affinity,omitempty"`
}

PlacementPolicy contains the rules to select target member clusters to place the selected resources. Note that only clusters that are both joined and satisfying the rules will be selected.

You can only specify at most one of the two fields: ClusterNames and Affinity. If none is specified, all the joined clusters are selected.

func (*PlacementPolicy) DeepCopy

func (in *PlacementPolicy) DeepCopy() *PlacementPolicy

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

func (*PlacementPolicy) DeepCopyInto

func (in *PlacementPolicy) DeepCopyInto(out *PlacementPolicy)

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

type ResourceIdentifier

type ResourceIdentifier struct {
	// Group is the group name of the selected resource.
	// +required
	Group string `json:"group,omitempty"`

	// Version is the version of the selected resource.
	// +required
	Version string `json:"version,omitempty"`

	// Kind represents the Kind of the selected resources.
	// +required
	Kind string `json:"kind"`

	// Name of the target resource.
	// +required
	Name string `json:"name"`

	// Namespace is the namespace of the resource. Empty if the resource is cluster scoped.
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

ResourceIdentifier identifies one Kubernetes resource.

func (*ResourceIdentifier) DeepCopy

func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier

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

func (*ResourceIdentifier) DeepCopyInto

func (in *ResourceIdentifier) DeepCopyInto(out *ResourceIdentifier)

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

type ResourcePlacementConditionType

type ResourcePlacementConditionType string

ResourcePlacementConditionType defines a specific condition of a resource placement.

const (
	// ResourcePlacementConditionTypeScheduled indicates whether we have selected at least one resource to be placed to at least one member cluster and created work CRs under the corresponding per-cluster namespaces (i.e., fleet-member-<member-name>).
	// Its condition status can be one of the following:
	// - "True" means we have selected at least one resource, targeted at least one member cluster and created the work CRs.
	// - "False" means we have selected zero resources, zero target clusters, or failed to create the work CRs.
	// - "Unknown" otherwise.
	ResourcePlacementConditionTypeScheduled ResourcePlacementConditionType = "Scheduled"

	// ResourcePlacementStatusConditionTypeApplied indicates whether the selected member clusters have received the work CRs and applied the selected resources locally.
	// Its condition status can be one of the following:
	// - "True" means all the selected resources are successfully applied to all the target clusters.
	// - "False" means some of them have failed.
	// - "Unknown" otherwise.
	ResourcePlacementStatusConditionTypeApplied ResourcePlacementConditionType = "Applied"
)

type ResourceUsage

type ResourceUsage struct {
	// Capacity represents the total resource capacity of all the nodes on a member cluster.
	// +optional
	Capacity v1.ResourceList `json:"capacity,omitempty"`

	// Allocatable represents the total resources of all the nodes on a member cluster that are available for scheduling.
	// +optional
	Allocatable v1.ResourceList `json:"allocatable,omitempty"`

	// When the resource usage is observed.
	// +optional
	ObservationTime metav1.Time `json:"observationTime,omitempty"`
}

ResourceUsage contains the observed resource usage of a member cluster.

func (*ResourceUsage) DeepCopy

func (in *ResourceUsage) DeepCopy() *ResourceUsage

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

func (*ResourceUsage) DeepCopyInto

func (in *ResourceUsage) DeepCopyInto(out *ResourceUsage)

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