v1

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1 +k8s:deepcopy-gen=package +groupName=hdfs.nineinfra.tech

Package v1 contains API Schema definitions for the hdfs v1 API group +kubebuilder:object:generate=true +groupName=hdfs.nineinfra.tech

Index

Constants

View Source
const (
	ClusterConditionPodsReady ClusterConditionType = "PodsReady"
	ClusterConditionUpgrading                      = "Upgrading"
	ClusterConditionError                          = "Error"

	// UpdatingClusterReason Reasons for cluster upgrading condition
	UpdatingClusterReason = "Updating Cluster"
	UpgradeErrorReason    = "Upgrade Error"
)
View Source
const (
	// RefClusterZKReplicasKey  zookeeper replicas.must be odd and >= 3.
	RefClusterZKReplicasKey string = "reference-zookeeper-replicas"
	// RefClusterZKEndpointsKey zookeeper endpoints.such as 10.224.1.218:2181,10.224.2.222:2181,10.224.3.253:2181.
	RefClusterZKEndpointsKey string = "reference-zookeeper-endpoints"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "hdfs.nineinfra.tech", Version: "v1"}

	// 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 SchemeGroupVersion = GroupVersion

SchemeGroupVersion is group version used to register these objects.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Cluster

type Cluster struct {
	// Version. version of the cluster.
	Version string `json:"version"`
	// +kubebuilder:validation:Enum={namenode,datanode,journalnode,zookeeper}
	Type ClusterType `json:"type"`
	// Name. name of the cluster.
	// +optional
	Name string `json:"name"`
	// Image. image config of the cluster.
	// +optional
	Image ImageConfig `json:"image"`
	// Resource. resouce config of the cluster.
	// +optional
	Resource ResourceConfig `json:"resource,omitempty"`
	// Conf. k/v configs for the cluster.
	// +optional
	Conf map[string]string `json:"conf,omitempty"`
}

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

type ClusterCondition

type ClusterCondition struct {
	// Type of cluster condition.
	Type ClusterConditionType `json:"type,omitempty"`

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

	// The last time this condition was updated.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`

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

ClusterCondition shows the current condition of a cluster. Comply with k8s API conventions

func (*ClusterCondition) DeepCopy

func (in *ClusterCondition) DeepCopy() *ClusterCondition

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

func (*ClusterCondition) DeepCopyInto

func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)

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

type ClusterConditionType

type ClusterConditionType string

type ClusterStatus

type ClusterStatus struct {
	// Name is the name of the cluster
	Name string `json:"name"`

	// Type is the type of the cluster
	Type ClusterType `json:"type"`

	// Members is the cluster members in the cluster
	Members MembersStatus `json:"members,omitempty"`

	// Replicas is the number of desired replicas in the cluster
	Replicas int32 `json:"replicas,omitempty"`

	// ReadyReplicas is the number of ready replicas in the cluster
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// InternalClientEndpoint is the internal client IP and port
	InternalClientEndpoint string `json:"internalClientEndpoint,omitempty"`

	// ExternalClientEndpoint is the internal client IP and port
	ExternalClientEndpoint string `json:"externalClientEndpoint,omitempty"`

	// CurrentVersion is the current cluster version
	CurrentVersion string `json:"currentVersion,omitempty"`

	TargetVersion string `json:"targetVersion,omitempty"`

	// Conditions list all the applied conditions
	Conditions []ClusterCondition `json:"conditions,omitempty"`
}

func (*ClusterStatus) DeepCopy

func (in *ClusterStatus) DeepCopy() *ClusterStatus

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

func (*ClusterStatus) DeepCopyInto

func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)

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

type ClusterType

type ClusterType string // Different types of clusters.
const (
	NameNodeClusterType    ClusterType = "namenode"
	DataNodeClusterType    ClusterType = "datanode"
	JournalNodeClusterType ClusterType = "journalnode"
	HttpFSClusterType      ClusterType = "httpfs"
	ZookeeperClusterType   ClusterType = "zookeeper"
)

type HdfsCluster

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

	Spec   HdfsClusterSpec   `json:"spec,omitempty"`
	Status HdfsClusterStatus `json:"status,omitempty"`
}

HdfsCluster is the Schema for the hdfsclusters API

func (*HdfsCluster) DeepCopy

func (in *HdfsCluster) DeepCopy() *HdfsCluster

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

func (*HdfsCluster) DeepCopyInto

func (in *HdfsCluster) DeepCopyInto(out *HdfsCluster)

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

func (*HdfsCluster) DeepCopyObject

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

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

func (*HdfsCluster) Default

func (r *HdfsCluster) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*HdfsCluster) SetupWebhookWithManager

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

func (*HdfsCluster) ValidateCreate

func (r *HdfsCluster) ValidateCreate() (admission.Warnings, error)

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

func (*HdfsCluster) ValidateDelete

func (r *HdfsCluster) ValidateDelete() (admission.Warnings, error)

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

func (*HdfsCluster) ValidateUpdate

func (r *HdfsCluster) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

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

type HdfsClusterList

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

HdfsClusterList contains a list of HdfsCluster

func (*HdfsClusterList) DeepCopy

func (in *HdfsClusterList) DeepCopy() *HdfsClusterList

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

func (*HdfsClusterList) DeepCopyInto

func (in *HdfsClusterList) DeepCopyInto(out *HdfsClusterList)

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

func (*HdfsClusterList) DeepCopyObject

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

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

type HdfsClusterSpec

type HdfsClusterSpec struct {
	// Version. version of the cluster.
	Version string `json:"version"`
	// Image. image config of the cluster.
	Image ImageConfig `json:"image"`
	// Resource. resource config of the datanodecluster if the datanode cluster not in clusters.
	// +optional
	Resource ResourceConfig `json:"resource,omitempty"`
	// Conf. k/v configs for the cluster.
	// +optional
	Conf map[string]string `json:"conf,omitempty"`
	// K8sConf. k/v configs for the cluster in k8s.such as the cluster domain
	// +optional
	K8sConf map[string]string `json:"k8sConf,omitempty"`
	// ClusterRefs. k/v configs for the cluster in k8s.such as the cluster domain
	// +optional
	ClusterRefs []Cluster `json:"clusterRefs,omitempty"`
	// Clusters. namenode,datanode and journalnode cluster.
	// +optional
	Clusters []Cluster `json:"clusters"`
}

HdfsClusterSpec defines the desired state of HdfsCluster

func (*HdfsClusterSpec) DeepCopy

func (in *HdfsClusterSpec) DeepCopy() *HdfsClusterSpec

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

func (*HdfsClusterSpec) DeepCopyInto

func (in *HdfsClusterSpec) DeepCopyInto(out *HdfsClusterSpec)

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

type HdfsClusterStatus

type HdfsClusterStatus struct {
	ClustersStatus []ClusterStatus `json:"clustersStatus"`
}

HdfsClusterStatus defines the observed state of HdfsCluster

func (*HdfsClusterStatus) DeepCopy

func (in *HdfsClusterStatus) DeepCopy() *HdfsClusterStatus

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

func (*HdfsClusterStatus) DeepCopyInto

func (in *HdfsClusterStatus) DeepCopyInto(out *HdfsClusterStatus)

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

func (*HdfsClusterStatus) GetClusterCondition

func (zs *HdfsClusterStatus) GetClusterCondition(t ClusterConditionType, role string) (int, *ClusterCondition)

func (*HdfsClusterStatus) GetLastCondition

func (zs *HdfsClusterStatus) GetLastCondition(role string) (lastCondition *ClusterCondition)

func (*HdfsClusterStatus) Init

func (zs *HdfsClusterStatus) Init(role string)

func (*HdfsClusterStatus) IsClusterInReadyState

func (zs *HdfsClusterStatus) IsClusterInReadyState(role string) bool

func (*HdfsClusterStatus) IsClusterInUpgradeFailedState

func (zs *HdfsClusterStatus) IsClusterInUpgradeFailedState(role string) bool

func (*HdfsClusterStatus) IsClusterInUpgradingState

func (zs *HdfsClusterStatus) IsClusterInUpgradingState(role string) bool

func (*HdfsClusterStatus) SetErrorConditionFalse

func (zs *HdfsClusterStatus) SetErrorConditionFalse(role string)

func (*HdfsClusterStatus) SetErrorConditionTrue

func (zs *HdfsClusterStatus) SetErrorConditionTrue(reason, message string, role string)

func (*HdfsClusterStatus) SetPodsReadyConditionFalse

func (zs *HdfsClusterStatus) SetPodsReadyConditionFalse(role string)

func (*HdfsClusterStatus) SetPodsReadyConditionTrue

func (zs *HdfsClusterStatus) SetPodsReadyConditionTrue(role string)

func (*HdfsClusterStatus) SetUpgradingConditionFalse

func (zs *HdfsClusterStatus) SetUpgradingConditionFalse(role string)

func (*HdfsClusterStatus) SetUpgradingConditionTrue

func (zs *HdfsClusterStatus) SetUpgradingConditionTrue(reason, message string, role string)

func (*HdfsClusterStatus) UpdateProgress

func (zs *HdfsClusterStatus) UpdateProgress(reason, updatedReplicas string, role string)

type ImageConfig

type ImageConfig struct {
	Repository string `json:"repository"`
	// Image tag. Usually the vesion of the kyuubi, default: `latest`.
	// +optional
	Tag string `json:"tag,omitempty"`
	// Image pull policy. One of `Always, Never, IfNotPresent`, default: `Always`.
	// +kubebuilder:default:=Always
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	// +optional
	PullPolicy string `json:"pullPolicy,omitempty"`
	// Secrets for image pull.
	// +optional
	PullSecrets string `json:"pullSecret,omitempty"`
}

func (*ImageConfig) DeepCopy

func (in *ImageConfig) DeepCopy() *ImageConfig

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

func (*ImageConfig) DeepCopyInto

func (in *ImageConfig) DeepCopyInto(out *ImageConfig)

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

type MembersStatus

type MembersStatus struct {
	//+nullable
	Ready []string `json:"ready,omitempty"`
	//+nullable
	Unready []string `json:"unready,omitempty"`
}

MembersStatus is the status of the members of the cluster with both ready and unready node membership lists

func (*MembersStatus) DeepCopy

func (in *MembersStatus) DeepCopy() *MembersStatus

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

func (*MembersStatus) DeepCopyInto

func (in *MembersStatus) DeepCopyInto(out *MembersStatus)

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

type ResourceConfig

type ResourceConfig struct {
	// The replicas of the cluster workload.Default value is 1
	// +optional
	Replicas int32 `json:"replicas"`
	// num of the disks. default value is 1
	// +optional
	Disks int32 `json:"disks"`
	// the storage class. default value is nineinfra-default
	// +optional
	StorageClass string `json:"storageClass"`
	// The resource requirements of the cluster workload.
	// +optional
	ResourceRequirements corev1.ResourceRequirements `json:"resourceRequirements"`
}

func (*ResourceConfig) DeepCopy

func (in *ResourceConfig) DeepCopy() *ResourceConfig

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

func (*ResourceConfig) DeepCopyInto

func (in *ResourceConfig) DeepCopyInto(out *ResourceConfig)

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