v1beta2

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Edge  NodePoolType = "Edge"
	Cloud NodePoolType = "Cloud"

	ElectionStrategyMark   LeaderElectionStrategy = "mark"
	ElectionStrategyRandom LeaderElectionStrategy = "random"

	// LeaderStatus means the status of leader yurthub election.
	// If it's ready the leader elected, otherwise no leader is elected.
	LeaderStatus NodePoolConditionType = "LeaderReady"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "apps.openyurt.io", Version: "v1beta2"}

	SchemeGroupVersion = GroupVersion

	// 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

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

func SetDefaultsNodePool

func SetDefaultsNodePool(obj *NodePool)

SetDefaultsNodePool set default values for NodePool.

Types

type Leader

type Leader struct {
	// The node name of the leader yurthub
	NodeName string `json:"nodeName"`

	// The address of the leader yurthub
	Address string `json:"address"`
}

Leader represents the hub leader in a nodepool

func (*Leader) DeepCopy

func (in *Leader) DeepCopy() *Leader

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

func (*Leader) DeepCopyInto

func (in *Leader) DeepCopyInto(out *Leader)

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

type LeaderElectionStrategy

type LeaderElectionStrategy string

LeaderElectionStrategy represents the policy how to elect a leader Yurthub in a nodepool.

type NodePool

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

	Spec   NodePoolSpec   `json:"spec,omitempty"`
	Status NodePoolStatus `json:"status,omitempty"`
}

NodePool is the Schema for the nodepools API

func (*NodePool) DeepCopy

func (in *NodePool) DeepCopy() *NodePool

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

func (*NodePool) DeepCopyInto

func (in *NodePool) DeepCopyInto(out *NodePool)

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

func (*NodePool) DeepCopyObject

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

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

func (*NodePool) Hub

func (*NodePool) Hub()

Hub marks this type as a conversion hub.

type NodePoolCondition

type NodePoolCondition struct {
	// Type of NodePool condition.
	Type NodePoolConditionType `json:"type,omitempty"`

	// Status of the condition, one of True, False, Unknown.
	Status v1.ConditionStatus `json:"status,omitempty"`

	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`

	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`

	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
}

func (*NodePoolCondition) DeepCopy

func (in *NodePoolCondition) DeepCopy() *NodePoolCondition

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

func (*NodePoolCondition) DeepCopyInto

func (in *NodePoolCondition) DeepCopyInto(out *NodePoolCondition)

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

type NodePoolConditionType

type NodePoolConditionType string

NodePoolConditionType represents a NodePool condition value.

type NodePoolList

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

NodePoolList contains a list of NodePool

func (*NodePoolList) DeepCopy

func (in *NodePoolList) DeepCopy() *NodePoolList

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

func (*NodePoolList) DeepCopyInto

func (in *NodePoolList) DeepCopyInto(out *NodePoolList)

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

func (*NodePoolList) DeepCopyObject

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

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

type NodePoolSpec

type NodePoolSpec struct {
	// The type of the NodePool
	// +optional
	Type NodePoolType `json:"type,omitempty"`

	// HostNetwork is used to specify that cni components(like flannel)
	// will not be installed on the nodes of this NodePool.
	// This means all pods on the nodes of this NodePool will use
	// HostNetwork and share network namespace with host machine.
	HostNetwork bool `json:"hostNetwork,omitempty"`

	// If specified, the Labels will be added to all nodes.
	// NOTE: existing labels with samy keys on the nodes will be overwritten.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// If specified, the Annotations will be added to all nodes.
	// NOTE: existing labels with samy keys on the nodes will be overwritten.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// If specified, the Taints will be added to all nodes.
	// +optional
	Taints []v1.Taint `json:"taints,omitempty"`

	// InterConnectivity represents all nodes in the NodePool can access with each other
	// through Layer 2 or Layer 3 network or not. If the field is true,
	// nodepool-level list/watch requests reuse can be applied for this nodepool.
	// otherwise, only node-level list/watch requests reuse can be applied for the nodepool.
	// This field cannot be changed after creation.
	InterConnectivity bool `json:"interConnectivity,omitempty"`

	// LeaderElectionStrategy represents the policy how to elect a leader Yurthub in a nodepool.
	// random: select one ready node as leader at random.
	// mark: select one ready node as leader from nodes that are specified by labelselector.
	// More strategies will be supported according to user's new requirements.
	LeaderElectionStrategy string `json:"leaderElectionStrategy,omitempty"`

	// LeaderNodeLabelSelector is used only when LeaderElectionStrategy is mark. leader Yurhub will be
	// elected from nodes that filtered by this label selector.
	LeaderNodeLabelSelector map[string]string `json:"leaderNodeLabelSelector,omitempty"`

	// EnableLeaderElection is used for specifying whether to enable a leader elections
	// for the nodepool. Leaders within the nodepool are elected using the election strategy and leader replicas.
	// LeaderNodeLabelSelector, LeaderElectionStrategy and LeaderReplicas are only valid when this is true.
	// If the field is not specified, the default value is false.
	EnableLeaderElection bool `json:"enableLeaderElection,omitempty"`

	// PoolScopeMetadata is used for defining requests for pool scoped metadata which will be aggregated
	// by each node or leader in nodepool (when EnableLeaderElection is set true).
	// This field can be modified. The default value is v1.services and discovery.endpointslices.
	PoolScopeMetadata []metav1.GroupVersionResource `json:"poolScopeMetadata,omitempty"`

	// LeaderReplicas is used for specifying the number of leader replicas in the nodepool.
	// If the field is not specified, the default value is 1.
	// + optional
	LeaderReplicas int32 `json:"leaderReplicas,omitempty"`
}

NodePoolSpec defines the desired state of NodePool

func (*NodePoolSpec) DeepCopy

func (in *NodePoolSpec) DeepCopy() *NodePoolSpec

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

func (*NodePoolSpec) DeepCopyInto

func (in *NodePoolSpec) DeepCopyInto(out *NodePoolSpec)

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

type NodePoolStatus

type NodePoolStatus struct {
	// Total number of ready nodes in the pool.
	// +optional
	ReadyNodeNum int32 `json:"readyNodeNum"`

	// Total number of unready nodes in the pool.
	// +optional
	UnreadyNodeNum int32 `json:"unreadyNodeNum"`

	// The list of nodes' names in the pool
	// +optional
	Nodes []string `json:"nodes,omitempty"`

	// LeaderEndpoints is used for storing the address of Leader Yurthub.
	// +optional
	LeaderEndpoints []Leader `json:"leaderEndpoints,omitempty"`

	// LeaderNum is used for storing the number of leader yurthubs in the nodepool.
	LeaderNum int32 `json:"leaderNum,omitempty"`

	// LeaderLastElectedTime is used for storing the time when the leader yurthub was elected.
	LeaderLastElectedTime metav1.Time `json:"leaderLastElectedTime,omitempty"`

	// Conditions represents the latest available observations of a NodePool's
	// current state that includes LeaderHubElection status.
	// +optional
	Conditions []NodePoolCondition `json:"conditions,omitempty"`
}

NodePoolStatus defines the observed state of NodePool

func (*NodePoolStatus) DeepCopy

func (in *NodePoolStatus) DeepCopy() *NodePoolStatus

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

func (*NodePoolStatus) DeepCopyInto

func (in *NodePoolStatus) DeepCopyInto(out *NodePoolStatus)

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

type NodePoolType

type NodePoolType string

Jump to

Keyboard shortcuts

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