v1alpha1

package
v0.5.1-b3f0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

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 (
	// 클러스터 클레임 수락, 클러스터 등록 생성에 의해 클러스터 매니저가 생성되고
	// infra 생성, kubeadm init/join, resource 배포등을 수행하고 있는 단계
	ClusterManagerPhaseProcessing = ClusterManagerPhase("Processing")
	// ArgoCD를 통해 single cluster에 traefik 배포를 기다리고 있는 상태
	ClusterManagerPhaseSyncNeeded = ClusterManagerPhase("Sync Needed")
	// 모든 과정이 완료되어 클러스터가 준비된 상태
	ClusterManagerPhaseReady = ClusterManagerPhase("Ready")
	// 클러스터가 삭제중인 상태
	ClusterManagerPhaseDeleting = ClusterManagerPhase("Deleting")
	// 클러스터가 업그레이드 중인 상태
	ClusterManagerPhaseUpgrading = ClusterManagerPhase("Upgrading")
	// 클러스터가 스케일링 중인 상태
	ClusterManagerPhaseScaling = ClusterManagerPhase("Scaling")
)
View Source
const (
	ClusterManagerDeprecatedPhasePending      = ClusterManagerPhase("Pending")
	ClusterManagerDeprecatedPhaseProvisioning = ClusterManagerPhase("Provisioning")
	ClusterManagerDeprecatedPhaseRegistering  = ClusterManagerPhase("Registering")
	ClusterManagerDeprecatedPhaseProvisioned  = ClusterManagerPhase("Provisioned")
	ClusterManagerDeprecatedPhaseRegistered   = ClusterManagerPhase("Registered")
	ClusterManagerDeprecatedPhaseFailed       = ClusterManagerPhase("Failed")
	ClusterManagerDeprecatedPhaseUnknown      = ClusterManagerPhase("Unknown")
)

deprecated phases

View Source
const (
	ClusterManagerFinalizer = "clustermanager.cluster.tmax.io/finalizer"

	// ClusterTypeCreated    = ClusterType("created")
	// ClusterTypeRegistered = ClusterType("registered")
	ClusterTypeCreated    = "created"
	ClusterTypeRegistered = "registered"

	AnnotationKeyClmApiserver      = "clustermanager.cluster.tmax.io/apiserver"
	AnnotationKeyClmGateway        = "clustermanager.cluster.tmax.io/gateway"
	AnnotationKeyClmSuffix         = "clustermanager.cluster.tmax.io/suffix"
	AnnotationKeyClmDomain         = "clustermanager.cluster.tmax.io/domain"
	AnnotationKeyClmMgmtK8SVersion = "clustermanager.cluster.tmax.io/mgmtk8sversion"

	LabelKeyClmName               = "clustermanager.cluster.tmax.io/clm-name"
	LabelKeyClmNamespace          = "clustermanager.cluster.tmax.io/clm-namespace"
	LabelKeyClcName               = "clustermanager.cluster.tmax.io/clc-name"
	LabelKeyClrName               = "clustermanager.cluster.tmax.io/clr-name"
	LabelKeyClmClusterType        = "clustermanager.cluster.tmax.io/cluster-type"
	LabelKeyClmClusterTypeDefunct = "type"
)
View Source
const (
	ProviderAWS     = "AWS"
	ProviderVSphere = "vSphere"
)
View Source
const (
	// 클러스터가 등록된 상태
	ClusterRegistrationPhaseRegistered = ClusterRegistrationPhase("Registered")
	// 에러가 발생하여 클러스터가 등록되지 못한 상태
	// 세가지 종류가 존재함
	// 1. kubeconfig 파일이 invalid한 경우(yaml파일이 아니거나 yaml형식이 맞지 않는 등)
	// 2. cluster가 invalid한 경우(network call이 가지 않는 경우)
	// 3. 동일한 이름의 클러스터가 이미 존재하는 경우
	ClusterRegistrationPhaseError = ClusterRegistrationPhase("Error")
	// 클러스터가 삭제된 상태
	ClusterRegistrationPhaseClusterDeleted = ClusterRegistrationPhase("Cluster Deleted")
)
View Source
const (
	ClusterRegistrationDeprecatedPhaseSuccess = ClusterRegistrationPhase("Success")
	ClusterRegistrationDeprecatedPhaseDeleted = ClusterRegistrationPhase("Deleted")
)
View Source
const (

	// 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
)
View Source
var ClusterManagerWebhookLogger = logf.Log.WithName("clustermanager-resource")

log is for logging in this package.

View Source
var ClusterRegistrationWebhookLogger = logf.Log.WithName("clusterregistration-resource")

log is for logging in this package.

Functions

This section is empty.

Types

type ClusterManager

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

	Spec        ClusterManagerSpec   `json:"spec"`
	Status      ClusterManagerStatus `json:"status,omitempty"`
	AwsSpec     ProviderAwsSpec      `json:"awsSpec,omitempty"`
	VsphereSpec ProviderVsphereSpec  `json:"vsphereSpec,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) GetApplicationName

func (c *ClusterManager) GetApplicationName() string

single app of apps application name

func (*ClusterManager) GetClusterType

func (c *ClusterManager) GetClusterType() string

func (ClusterManager) GetK8SVersion

func (c ClusterManager) GetK8SVersion() string

func (*ClusterManager) GetNamespacedName

func (c *ClusterManager) GetNamespacedName() types.NamespacedName

func (*ClusterManager) GetNamespacedPrefix

func (c *ClusterManager) GetNamespacedPrefix() string

func (*ClusterManager) SetK8SVersion

func (c *ClusterManager) SetK8SVersion(version string)

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"`
	MasterRun             int                     `json:"masterRun,omitempty"`
	WorkerRun             int                     `json:"workerRun,omitempty"`
	MasterNum             int                     `json:"masterNum,omitempty"`
	WorkerNum             int                     `json:"workerNum,omitempty"`
	NodeInfo              []coreV1.NodeSystemInfo `json:"nodeInfo,omitempty"`
	Phase                 ClusterManagerPhase     `json:"phase,omitempty"`
	ControlPlaneEndpoint  string                  `json:"controlPlaneEndpoint,omitempty"`
	ArgoReady             bool                    `json:"argoReady,omitempty"`
	TraefikReady          bool                    `json:"traefikReady,omitempty"`
	GatewayReady          bool                    `json:"gatewayReady,omitempty"`
	GatewayReadyMigration bool                    `json:"gatewayReadyMigration,omitempty"`
	AuthClientReady       bool                    `json:"authClientReady,omitempty"`
	OpenSearchReady       bool                    `json:"openSearchReady,omitempty"`
	ApplicationLink       string                  `json:"applicationLink,omitempty"`

	// will be deprecated
	PrometheusReady bool `json:"prometheusReady,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) GetK8SVersion

func (c ClusterManagerStatus) GetK8SVersion() string

func (ClusterManagerStatus) GetTypedPhase

func (c ClusterManagerStatus) GetTypedPhase() ClusterManagerPhase

func (*ClusterManagerStatus) SetK8SVersion

func (c *ClusterManagerStatus) SetK8SVersion(version string)

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) GetCluterManagerNamespacedName

func (c *ClusterRegistration) GetCluterManagerNamespacedName() types.NamespacedName

func (*ClusterRegistration) GetNamespacedName

func (c *ClusterRegistration) GetNamespacedName() types.NamespacedName

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            ClusterRegistrationPhase  `json:"phase,omitempty"`
	Reason           ClusterRegistrationReason `json:"reason,omitempty"`
	ClusterValidated bool                      `json:"clusterValidated,omitempty"`
	SecretReady      bool                      `json:"secretReady,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"`
	// The disk size of VM for master node. Example: 20
	MasterDiskSize int `json:"masterDiskSize,omitempty"`
	// The disk size of VM for worker node. Example: 20
	WorkerDiskSize int `json:"workerDiskSize,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"`
	// The password of virtual machine
	VMPassword string `json:"vmPassword,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