v1alpha1

package
v5.0.2508 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Overview

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

Index

Constants

View Source
const (
	// ClusterManagerPhasePending is the first state a Cluster is assigned by
	// Cluster API Cluster controller after being created.
	ClusterManagerPhasePending = ClusterManagerPhase("Pending")

	// ClusterManagerPhaseProvisioning is the state when the Cluster has a provider infrastructure
	// object associated and can start provisioning.
	ClusterManagerPhaseProvisioning = ClusterManagerPhase("Provisioning")

	// object associated and can start provisioning.
	ClusterManagerPhaseRegistering = ClusterManagerPhase("Registering")

	// ClusterManagerPhaseProvisioned is the state when its
	// infrastructure has been created and configured.
	ClusterManagerPhaseProvisioned = ClusterManagerPhase("Provisioned")

	// infrastructure has been created and configured.
	ClusterManagerPhaseRegistered = ClusterManagerPhase("Registered")

	// ClusterManagerPhaseDeleting is the Cluster state when a delete
	// request has been sent to the API Server,
	// but its infrastructure has not yet been fully deleted.
	ClusterManagerPhaseDeleting = ClusterManagerPhase("Deleting")

	// ClusterManagerPhaseFailed is the Cluster state when the system
	// might require user intervention.
	ClusterManagerPhaseFailed = ClusterManagerPhase("Failed")

	// ClusterManagerPhaseUnknown is returned if the Cluster state cannot be determined.
	ClusterManagerPhaseUnknown = ClusterManagerPhase("Unknown")
)
View Source
const (
	// ClusterRegistrationPhaseSuccess is the state when cluster is registered successfully
	ClusterRegistrationPhaseSuccess = ClusterRegistrationPhase("Success")

	// ClusterRegistrationPhaseFailed is the when failed to register cluster
	// Cluster registration failure can occur in following cases
	// 1. kubeconfig is invalid
	// 2. cluster is invalid
	ClusterRegistrationPhaseFailed = ClusterRegistrationPhase("Failed")

	// ClusterRegistrationPhaseValidating
	ClusterRegistrationPhaseValidating = ClusterRegistrationPhase("Validating")

	// ClusterRegistrationPhaseValidated
	ClusterRegistrationPhaseValidated = ClusterRegistrationPhase("Validated")

	// ClusterRegistrationPhaseDeleting is the Cluster state when a delete
	// request has been sent to the API Server,
	// but its infrastructure has not yet been fully deleted.
	ClusterRegistrationPhaseDeleting = ClusterRegistrationPhase("Deleting")

	// ClusterRegistrationPhaseUnknown is returned if the Cluster state cannot be determined.
	ClusterRegistrationPhaseUnknown = ClusterRegistrationPhase("Unknown")

	// ClusterRegistrationReasonClusterNotFound is returned if the Cluster not found
	ClusterRegistrationReasonClusterNotFound = ClusterRegistrationReason("ClusterNotFound")

	// ClusterRegistrationReasonClusterNotFound is returned if the Input Kubeconfig is invalid
	ClusterRegistrationReasonInvalidKubeconfig = ClusterRegistrationReason("InvalidKubeconfig")

	// ClusterRegistrationReasonClusterNameDuplicated is returned if the cluster name is duplicated
	ClusterRegistrationReasonClusterNameDuplicated = ClusterRegistrationReason("ClusterNameDuplicated")
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "cluster.tmax.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 ClusterManager

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

	Spec        ClusterManagerSpec   `json:"spec"`
	AwsSpec     ProviderAwsSpec      `json:"awsSpec,omitempty"`
	VsphereSpec ProviderVsphereSpec  `json:"vsphereSpec,omitempty"`
	Status      ClusterManagerStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:path=clustermanagers,scope=Namespaced,shortName=clm +kubebuilder:printcolumn:name="Provider",type="string",JSONPath=".spec.provider",description="provider" +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="k8s version" +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="is running" +kubebuilder:printcolumn:name="MasterNum",type="string",JSONPath=".spec.masterNum",description="replica number of master" +kubebuilder:printcolumn:name="MasterRun",type="string",JSONPath=".status.masterRun",description="running of master" +kubebuilder:printcolumn:name="WorkerNum",type="string",JSONPath=".spec.workerNum",description="replica number of worker" +kubebuilder:printcolumn:name="WorkerRun",type="string",JSONPath=".status.workerRun",description="running of worker" +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="cluster status phase" ClusterManager is the Schema for the clustermanagers API

func (*ClusterManager) DeepCopy

func (in *ClusterManager) DeepCopy() *ClusterManager

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

func (*ClusterManager) DeepCopyInto

func (in *ClusterManager) DeepCopyInto(out *ClusterManager)

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

func (*ClusterManager) DeepCopyObject

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

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

func (*ClusterManager) SetupWebhookWithManager

func (r *ClusterManager) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*ClusterManager) ValidateCreate

func (r *ClusterManager) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*ClusterManager) ValidateDelete

func (r *ClusterManager) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*ClusterManager) ValidateUpdate

func (r *ClusterManager) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type ClusterManagerList

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

+kubebuilder:object:root=true ClusterManagerList contains a list of ClusterManager

func (*ClusterManagerList) DeepCopy

func (in *ClusterManagerList) DeepCopy() *ClusterManagerList

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

func (*ClusterManagerList) DeepCopyInto

func (in *ClusterManagerList) DeepCopyInto(out *ClusterManagerList)

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

func (*ClusterManagerList) DeepCopyObject

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

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

type ClusterManagerPhase

type ClusterManagerPhase string

type ClusterManagerSpec

type ClusterManagerSpec struct {
	// +kubebuilder:validation:Required
	// The name of cloud provider where VM is created
	Provider string `json:"provider"`
	// +kubebuilder:validation:Required
	// The version of kubernetes
	Version string `json:"version"`
	// +kubebuilder:validation:Required
	// The number of master node
	MasterNum int `json:"masterNum"`
	// +kubebuilder:validation:Required
	// The number of worker node
	WorkerNum int `json:"workerNum"`
}

ClusterManagerSpec defines the desired state of ClusterManager

func (*ClusterManagerSpec) DeepCopy

func (in *ClusterManagerSpec) DeepCopy() *ClusterManagerSpec

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

func (*ClusterManagerSpec) DeepCopyInto

func (in *ClusterManagerSpec) DeepCopyInto(out *ClusterManagerSpec)

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

type ClusterManagerStatus

type ClusterManagerStatus struct {
	Provider             string                  `json:"provider,omitempty"`
	Version              string                  `json:"version,omitempty"`
	Ready                bool                    `json:"ready,omitempty"`
	ControlPlaneReady    bool                    `json:"controlPlaneReady,omitempty"`
	AgentReady           bool                    `json:"agentReady,omitempty"`
	MasterRun            int                     `json:"masterRun,omitempty"`
	WorkerRun            int                     `json:"workerRun,omitempty"`
	NodeInfo             []corev1.NodeSystemInfo `json:"nodeInfo,omitempty"`
	Phase                string                  `json:"phase,omitempty"`
	ControlPlaneEndpoint string                  `json:"controlPlaneEndpoint,omitempty"`
	AgentEndpoint        string                  `json:"agentEndpoint,omitempty"`
}

ClusterManagerStatus defines the observed state of ClusterManager

func (*ClusterManagerStatus) DeepCopy

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

func (*ClusterManagerStatus) DeepCopyInto

func (in *ClusterManagerStatus) DeepCopyInto(out *ClusterManagerStatus)

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

func (*ClusterManagerStatus) SetTypedPhase

func (c *ClusterManagerStatus) SetTypedPhase(p ClusterManagerPhase)

type ClusterRegistration

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

	Spec   ClusterRegistrationSpec   `json:"spec"`
	Status ClusterRegistrationStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:path=clusterregistrations,scope=Namespaced,shortName=clr +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="cluster status phase" +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.reason",description="cluster status reason" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" ClusterRegistration is the Schema for the clusterregistrations API

func (*ClusterRegistration) DeepCopy

func (in *ClusterRegistration) DeepCopy() *ClusterRegistration

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

func (*ClusterRegistration) DeepCopyInto

func (in *ClusterRegistration) DeepCopyInto(out *ClusterRegistration)

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

func (*ClusterRegistration) DeepCopyObject

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

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

func (*ClusterRegistration) SetupWebhookWithManager

func (r *ClusterRegistration) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*ClusterRegistration) ValidateCreate

func (r *ClusterRegistration) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*ClusterRegistration) ValidateDelete

func (r *ClusterRegistration) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*ClusterRegistration) ValidateUpdate

func (r *ClusterRegistration) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type ClusterRegistrationList

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

+kubebuilder:object:root=true ClusterRegistrationList contains a list of ClusterRegistration

func (*ClusterRegistrationList) DeepCopy

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

func (*ClusterRegistrationList) DeepCopyInto

func (in *ClusterRegistrationList) DeepCopyInto(out *ClusterRegistrationList)

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

func (*ClusterRegistrationList) DeepCopyObject

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

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

type ClusterRegistrationPhase

type ClusterRegistrationPhase string

type ClusterRegistrationReason

type ClusterRegistrationReason string

type ClusterRegistrationSpec

type ClusterRegistrationSpec struct {
	// +kubebuilder:validation:Required
	// The name of the cluster to be registered
	ClusterName string `json:"clusterName"`
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Format:="data-url"
	// The kubeconfig file of the cluster to be registered
	KubeConfig string `json:"kubeConfig"`
}

ClusterRegistrationSpec defines the desired state of ClusterRegistration

func (*ClusterRegistrationSpec) DeepCopy

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

func (*ClusterRegistrationSpec) DeepCopyInto

func (in *ClusterRegistrationSpec) DeepCopyInto(out *ClusterRegistrationSpec)

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

type ClusterRegistrationStatus

type ClusterRegistrationStatus struct {
	Provider  string                  `json:"provider,omitempty"`
	Version   string                  `json:"version,omitempty"`
	Ready     bool                    `json:"ready,omitempty"`
	MasterNum int                     `json:"masterNum,omitempty"`
	MasterRun int                     `json:"masterRun,omitempty"`
	WorkerNum int                     `json:"workerNum,omitempty"`
	WorkerRun int                     `json:"workerRun,omitempty"`
	NodeInfo  []corev1.NodeSystemInfo `json:"nodeInfo,omitempty"`
	Phase     string                  `json:"phase,omitempty"`
	Reason    string                  `json:"reason,omitempty"`
}

ClusterRegistrationStatus defines the observed state of ClusterRegistration

func (*ClusterRegistrationStatus) DeepCopy

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

func (*ClusterRegistrationStatus) DeepCopyInto

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

func (*ClusterRegistrationStatus) SetTypedPhase

func (*ClusterRegistrationStatus) SetTypedReason

type ProviderAwsSpec

type ProviderAwsSpec struct {
	// The region where VM is working
	Region string `json:"region,omitempty"`
	// The ssh key info to access VM
	SshKey string `json:"sshKey,omitempty"`
	// The type of VM for master node
	MasterType string `json:"masterType,omitempty"`
	// The type of VM for worker node
	WorkerType string `json:"workerType,omitempty"`
}

ProviderAwsSpec defines

func (*ProviderAwsSpec) DeepCopy

func (in *ProviderAwsSpec) DeepCopy() *ProviderAwsSpec

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

func (*ProviderAwsSpec) DeepCopyInto

func (in *ProviderAwsSpec) DeepCopyInto(out *ProviderAwsSpec)

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

type ProviderVsphereSpec

type ProviderVsphereSpec struct {
	// The internal IP address cider block for pods
	PodCidr string `json:"podCidr,omitempty"`
	// The IP address of vCenter Server Application(VCSA)
	VcenterIp string `json:"vcenterIp,omitempty"`
	// The user id of VCSA
	VcenterId string `json:"vcenterId,omitempty"`
	// The password of VCSA
	VcenterPassword string `json:"vcenterPassword,omitempty"`
	// The TLS thumbprint of machine certificate
	VcenterThumbprint string `json:"vcenterThumbprint,omitempty"`
	// The name of network
	VcenterNetwork string `json:"vcenterNetwork,omitempty"`
	// The name of data center
	VcenterDataCenter string `json:"vcenterDataCenter,omitempty"`
	// The name of data store
	VcenterDataStore string `json:"vcenterDataStore,omitempty"`
	// The name of folder
	VcenterFolder string `json:"vcenterFolder,omitempty"`
	// The name of resource pool
	VcenterResourcePool string `json:"vcenterResourcePool,omitempty"`
	// The IP address of control plane for remote cluster(vip)
	VcenterKcpIp string `json:"vcenterKcpIp,omitempty"`
	// The number of cpus for vm
	VcenterCpuNum int `json:"vcenterCpuNum,omitempty"`
	// The memory size for vm
	VcenterMemSize int `json:"vcenterMemSize,omitempty"`
	// The disk size for vm
	VcenterDiskSize int `json:"vcenterDiskSize,omitempty"`
	// The template name for cloud init
	VcenterTemplate string `json:"vcenterTemplate,omitempty"`
}

ProviderVsphereSpec defines

func (*ProviderVsphereSpec) DeepCopy

func (in *ProviderVsphereSpec) DeepCopy() *ProviderVsphereSpec

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

func (*ProviderVsphereSpec) DeepCopyInto

func (in *ProviderVsphereSpec) DeepCopyInto(out *ProviderVsphereSpec)

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

type ResourceType

type ResourceType struct {
	Type     string `json:"type,omitempty"`
	Capacity string `json:"capacity,omitempty"`
	Usage    string `json:"usage,omitempty"`
}

func (*ResourceType) DeepCopy

func (in *ResourceType) DeepCopy() *ResourceType

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

func (*ResourceType) DeepCopyInto

func (in *ResourceType) DeepCopyInto(out *ResourceType)

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