v1alpha1

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

+groupName=apps.openyurt.io

Package v1alpha1 contains API Schema definitions for the apps v1alpha1 API group +kubebuilder:object:generate=true +groupName=apps.openyurt.io

Index

Constants

View Source
const (
	// ControllerRevisionHashLabelKey is used to record the controller revision of current resource.
	ControllerRevisionHashLabelKey = "apps.openyurt.io/controller-revision-hash"

	// PoolNameLabelKey is used to record the name of current pool.
	PoolNameLabelKey = "apps.openyurt.io/pool-name"

	// SpecifiedDeleteKey indicates this object should be deleted, and the value could be the deletion option.
	SpecifiedDeleteKey = "apps.openyurt.io/specified-delete"

	// AnnotationPatchKey indicates the patch for every sub pool
	AnnotationPatchKey = "apps.openyurt.io/patch"
)

UnitedDeployment related labels and annotations

View Source
const (
	// LabelDesiredNodePool indicates which nodepool the node want to join
	LabelDesiredNodePool = "apps.openyurt.io/desired-nodepool"

	// LabelCurrentNodePool indicates which nodepool the node is currently
	// belonging to
	LabelCurrentNodePool = "apps.openyurt.io/nodepool"

	AnnotationPrevAttrs = "nodepool.openyurt.io/previous-attributes"

	// DefaultCloudNodePoolName defines the name of the default cloud nodepool
	DefaultCloudNodePoolName = "default-nodepool"

	// DefaultEdgeNodePoolName defines the name of the default edge nodepool
	DefaultEdgeNodePoolName = "default-edge-nodepool"

	// ServiceTopologyKey is the toplogy key that will be attached to node,
	// the value will be the name of the nodepool
	ServiceTopologyKey = "topology.kubernetes.io/zone"
)

NodePool related labels and annotations

Variables

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

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

Types

type DeploymentTemplateSpec

type DeploymentTemplateSpec struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              appsv1.DeploymentSpec `json:"spec"`
}

DeploymentTemplateSpec defines the pool template of Deployment.

func (*DeploymentTemplateSpec) DeepCopy

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

func (*DeploymentTemplateSpec) DeepCopyInto

func (in *DeploymentTemplateSpec) DeepCopyInto(out *DeploymentTemplateSpec)

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

type NodePool

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

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

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +genclient 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.

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"`

	// A label query over nodes to consider for adding to the pool
	// +optional
	Selector *metav1.LabelSelector `json:"selector,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"`
}

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"`
}

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
const (
	Edge  NodePoolType = "Edge"
	Cloud NodePoolType = "Cloud"
)

type Pool

type Pool struct {
	// Indicates pool name as a DNS_LABEL, which will be used to generate
	// pool workload name prefix in the format '<deployment-name>-<pool-name>-'.
	// Name should be unique between all of the pools under one UnitedDeployment.
	// Name is NodePool Name
	Name string `json:"name"`

	// Indicates the node selector to form the pool. Depending on the node selector,
	// pods provisioned could be distributed across multiple groups of nodes.
	// A pool's nodeSelectorTerm is not allowed to be updated.
	// +optional
	NodeSelectorTerm corev1.NodeSelectorTerm `json:"nodeSelectorTerm,omitempty"`

	// Indicates the tolerations the pods under this pool have.
	// A pool's tolerations is not allowed to be updated.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Indicates the number of the pod to be created under this pool.
	// +required
	Replicas *int32 `json:"replicas,omitempty"`

	// Indicates the patch for the templateSpec
	// Now support strategic merge path :https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#notes-on-the-strategic-merge-patch
	// Patch takes precedence over Replicas fields
	// If the Patch also modifies the Replicas, use the Replicas value in the Patch
	// +optional
	Patch *runtime.RawExtension `json:"patch,omitempty"`
}

Pool defines the detail of a pool.

func (*Pool) DeepCopy

func (in *Pool) DeepCopy() *Pool

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

func (*Pool) DeepCopyInto

func (in *Pool) DeepCopyInto(out *Pool)

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

type StatefulSetTemplateSpec

type StatefulSetTemplateSpec struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              appsv1.StatefulSetSpec `json:"spec"`
}

StatefulSetTemplateSpec defines the pool template of StatefulSet.

func (*StatefulSetTemplateSpec) DeepCopy

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

func (*StatefulSetTemplateSpec) DeepCopyInto

func (in *StatefulSetTemplateSpec) DeepCopyInto(out *StatefulSetTemplateSpec)

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

type TemplateType

type TemplateType string
const (
	StatefulSetTemplateType TemplateType = "StatefulSet"
	DeploymentTemplateType  TemplateType = "Deployment"
)

type Topology

type Topology struct {
	// Contains the details of each pool. Each element in this array represents one pool
	// which will be provisioned and managed by UnitedDeployment.
	// +optional
	Pools []Pool `json:"pools,omitempty"`
}

Topology defines the spread detail of each pool under UnitedDeployment. A UnitedDeployment manages multiple homogeneous workloads which are called pool. Each of pools under the UnitedDeployment is described in Topology.

func (*Topology) DeepCopy

func (in *Topology) DeepCopy() *Topology

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

func (*Topology) DeepCopyInto

func (in *Topology) DeepCopyInto(out *Topology)

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

type UnitedDeployment

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

	Spec   UnitedDeploymentSpec   `json:"spec,omitempty"`
	Status UnitedDeploymentStatus `json:"status,omitempty"`
}

UnitedDeployment is the Schema for the uniteddeployments API

func (*UnitedDeployment) DeepCopy

func (in *UnitedDeployment) DeepCopy() *UnitedDeployment

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

func (*UnitedDeployment) DeepCopyInto

func (in *UnitedDeployment) DeepCopyInto(out *UnitedDeployment)

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

func (*UnitedDeployment) DeepCopyObject

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

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

type UnitedDeploymentCondition

type UnitedDeploymentCondition struct {
	// Type of in place set condition.
	Type UnitedDeploymentConditionType `json:"type,omitempty"`

	// Status of the condition, one of True, False, Unknown.
	Status corev1.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"`
}

UnitedDeploymentCondition describes current state of a UnitedDeployment.

func (*UnitedDeploymentCondition) DeepCopy

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

func (*UnitedDeploymentCondition) DeepCopyInto

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

type UnitedDeploymentConditionType

type UnitedDeploymentConditionType string

UnitedDeploymentConditionType indicates valid conditions type of a UnitedDeployment.

const (
	// PoolProvisioned means all the expected pools are provisioned and unexpected pools are deleted.
	PoolProvisioned UnitedDeploymentConditionType = "PoolProvisioned"
	// PoolUpdated means all the pools are updated.
	PoolUpdated UnitedDeploymentConditionType = "PoolUpdated"
	// PoolFailure is added to a UnitedDeployment when one of its pools has failure during its own reconciling.
	PoolFailure UnitedDeploymentConditionType = "PoolFailure"
)

type UnitedDeploymentList

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

UnitedDeploymentList contains a list of UnitedDeployment

func (*UnitedDeploymentList) DeepCopy

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

func (*UnitedDeploymentList) DeepCopyInto

func (in *UnitedDeploymentList) DeepCopyInto(out *UnitedDeploymentList)

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

func (*UnitedDeploymentList) DeepCopyObject

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

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

type UnitedDeploymentSpec

type UnitedDeploymentSpec struct {
	// Selector is a label query over pods that should match the replica count.
	// It must match the pod template's labels.
	Selector *metav1.LabelSelector `json:"selector"`

	// WorkloadTemplate describes the pool that will be created.
	// +optional
	WorkloadTemplate WorkloadTemplate `json:"workloadTemplate,omitempty"`

	// Topology describes the pods distribution detail between each of pools.
	// +optional
	Topology Topology `json:"topology,omitempty"`

	// Indicates the number of histories to be conserved.
	// If unspecified, defaults to 10.
	// +optional
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
}

UnitedDeploymentSpec defines the desired state of UnitedDeployment.

func (*UnitedDeploymentSpec) DeepCopy

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

func (*UnitedDeploymentSpec) DeepCopyInto

func (in *UnitedDeploymentSpec) DeepCopyInto(out *UnitedDeploymentSpec)

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

type UnitedDeploymentStatus

type UnitedDeploymentStatus struct {
	// ObservedGeneration is the most recent generation observed for this UnitedDeployment. It corresponds to the
	// UnitedDeployment's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Count of hash collisions for the UnitedDeployment. The UnitedDeployment controller
	// uses this field as a collision avoidance mechanism when it needs to
	// create the name for the newest ControllerRevision.
	// +optional
	CollisionCount *int32 `json:"collisionCount,omitempty"`

	// CurrentRevision, if not empty, indicates the current version of the UnitedDeployment.
	CurrentRevision string `json:"currentRevision"`

	// Represents the latest available observations of a UnitedDeployment's current state.
	// +optional
	Conditions []UnitedDeploymentCondition `json:"conditions,omitempty"`

	// Records the topology detail information of the replicas of each pool.
	// +optional
	PoolReplicas map[string]int32 `json:"poolReplicas,omitempty"`

	// The number of ready replicas.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas"`

	// Replicas is the most recently observed number of replicas.
	Replicas int32 `json:"replicas"`

	// TemplateType indicates the type of PoolTemplate
	TemplateType TemplateType `json:"templateType"`
}

UnitedDeploymentStatus defines the observed state of UnitedDeployment.

func (*UnitedDeploymentStatus) DeepCopy

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

func (*UnitedDeploymentStatus) DeepCopyInto

func (in *UnitedDeploymentStatus) DeepCopyInto(out *UnitedDeploymentStatus)

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

type WorkloadTemplate

type WorkloadTemplate struct {
	// StatefulSet template
	// +optional
	StatefulSetTemplate *StatefulSetTemplateSpec `json:"statefulSetTemplate,omitempty"`

	// Deployment template
	// +optional
	DeploymentTemplate *DeploymentTemplateSpec `json:"deploymentTemplate,omitempty"`
}

WorkloadTemplate defines the pool template under the UnitedDeployment. UnitedDeployment will provision every pool based on one workload templates in WorkloadTemplate. WorkloadTemplate now support statefulset and deployment Only one of its members may be specified.

func (*WorkloadTemplate) DeepCopy

func (in *WorkloadTemplate) DeepCopy() *WorkloadTemplate

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

func (*WorkloadTemplate) DeepCopyInto

func (in *WorkloadTemplate) DeepCopyInto(out *WorkloadTemplate)

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