controller

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: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGloableNameSuffix     = "nineinfra"
	DefaultStorageClass          = "nineinfra-default"
	DefaultShuffleDiskSize       = "200Gi"
	DefaultShuffleDiskMountPath  = "/opt/spark/mnt/dir1"
	DefualtPasswordMD5Salt       = "nineinfra"
	DefaultHeadlessSvcNameSuffix = "-headless"
	DefaultClusterLabelKey       = "cluster"
	DefaultAppLabelKey           = "app"
	DefaultDiskNum               = 4
	DefaultMaxWaitSeconds        = 600
	// DefaultClusterDomainName is the default domain name key for the k8s cluster
	DefaultClusterDomainName = "clusterDomain"
	// DefaultClusterDomain is the default domain name value for the k8s cluster
	DefaultClusterDomain = "cluster.local"
)
View Source
const (
	DefaultMinioNameSuffix = "-minio"
	MinioErrorNotExist     = "The specified key does not exist"
)
View Source
const (
	PGResourceNameSuffix       = "-pg"
	DefaultPGSuperUserName     = "postgres"
	DefaultPGSuperUserPassword = "postgres"
	DefaultPGServerPort        = 5432
	PGErrorDuplicateKey        = "duplicate key value violates unique constraint"
)
View Source
const (
	DefaultKyuubiAuthUserName = "kyuubi"
	DefaultKyuubiAuthPassword = "kyuubi"
	DefaultKyuubiAuthDatabase = "kyuubi"
	DefaultKyuubiZKNamespace  = "kyuubi"
)
View Source
const (
	ZKResourceNameSuffix        = "-zookeeper"
	DefaultZookeeperClusterSign = "zookeeper"
	DefaultZKClientPortName     = "client"
)
View Source
const (
	HdfsResourceNameSuffix = "-hdfs"
	DefaultHdfsClusterSign = "hdfs"
	HdfsRoleNameNode       = "namenode"
)
View Source
const (
	MetastoreResourceNameSuffix = "-metastore"
	DefaultMetastoreClusterSign = "metastore"
)
View Source
const (
	DorisResourceNameSuffix        = "-doris"
	DefaultDorisBeStorageMountPath = "/opt/apache-doris/be/storage"
	DefaultDorisFeStorageMountPath = "/opt/apache-doris/fe/doris-meta "
	DefaultDorisBeStoragePVName    = "bestorage"
	DefaultDorisFeStoragePVName    = "femeta"
	DefaultDorisAdminUser          = "root"
	DefaultDorisAdminPassword      = ""
)
View Source
const (
	DfsReplicationConfKey = "dfs.replication"
	FSDefaultFSConfKey    = "fs.defaultFS"
	DFSNameSpacesConfKey  = "dfs.nameservices"
)
View Source
const (
	PGInitDBName      = "hive"
	PGInitDBUserName  = "hive"
	PGInitDBPassword  = "hive"
	DefaultPgReplicas = 3
)
View Source
const (
	DefaultZKReplicas = 3
)

Variables

View Source
var (
	DefaultDfsReplication   = 3
	DefaultDataNodeReplicas = 3
	// DefaultNameService is the default name service for hdfs
	DefaultNameService     = "nineinfra"
	DefaultNameNodeRpcPort = 8020
	// DefaultNameNodeHaReplicas is the default ha replicas for namenode
	DefaultNameNodeHaReplicas = 2
)
View Source
var (
	DefaultMinioDiskNum = 4
)
View Source
var (
	MetastoreReplicas int32 = 1
)

Functions

func CapacityPerVolume

func CapacityPerVolume(capacity string, volumes int32) (*resource.Quantity, error)

func CheckNineClusterTypeSupported added in v0.5.3

func CheckNineClusterTypeSupported(c ninev1alpha1.NineClusterType) bool

func CheckOlapSupported added in v0.5.0

func CheckOlapSupported(c ninev1alpha1.ClusterType) bool

func CheckStorageSupported added in v0.6.0

func CheckStorageSupported(c ninev1alpha1.ClusterStorage) bool

func FillClustersInfo added in v0.5.3

func FillClustersInfo(cluster *ninev1alpha1.NineCluster) error

func FillNineClusterType added in v0.5.3

func FillNineClusterType(cluster *ninev1alpha1.NineCluster) error

func GenUniqueName4Cluster added in v0.5.5

func GenUniqueName4Cluster(cluster *ninev1alpha1.NineCluster, clusterType ninev1alpha1.ClusterType) string

GenUniqueName4Cluster format: DefaultGloableNameSuffix-namespace-ninename-clustertype

func GetClusterDomain added in v0.7.0

func GetClusterDomain(cluster *ninev1alpha1.NineCluster, cType ninev1alpha1.ClusterType) string

func GetClusterStorage added in v0.6.0

func GetClusterStorage(cluster *ninev1alpha1.NineCluster) ninev1alpha1.ClusterStorage

func GetDefaultRefClusterInfo added in v0.4.4

func GetDefaultRefClusterInfo(clusterType ninev1alpha1.ClusterType) *ninev1alpha1.ClusterInfo

func GetDiskNum added in v0.7.0

func GetDiskNum(cluster ninev1alpha1.ClusterInfo) int

func GetK8sClientConfig added in v0.4.3

func GetK8sClientConfig() (*rest.Config, error)

func GetOlapClusterType added in v0.5.0

func GetOlapClusterType(cluster *ninev1alpha1.NineCluster) (ninev1alpha1.ClusterType, error)

func GetRefClusterInfo added in v0.4.4

func GetRefClusterInfo(cluster *ninev1alpha1.NineCluster, clusterType ninev1alpha1.ClusterType) *ninev1alpha1.ClusterInfo

func GetStorageClassName added in v0.5.0

func GetStorageClassName(cluster *ninev1alpha1.ClusterInfo) string

func GiB2Bytes

func GiB2Bytes(datavolume int) int

func HelmInstallCmd added in v0.4.3

func HelmInstallCmd(chartRepo string, releaseName string, chartPath string, chartVersion string, ns string, params map[string]string) error

func HelmUnInstallCmd added in v0.4.3

func HelmUnInstallCmd(releaseName string, ns string) error

func IsKyuubiNeedHA added in v0.6.0

func IsKyuubiNeedHA(cluster *ninev1alpha1.NineCluster) bool

func LogError added in v0.5.0

func LogError(ctx context.Context, err error, msg string)

func LogInfo

func LogInfo(ctx context.Context, msg string)

func LogInfoInterval

func LogInfoInterval(ctx context.Context, interval int, msg string)

func MinioConfigName added in v0.5.5

func MinioConfigName(cluster *ninev1alpha1.NineCluster) string

func MinioNewUserName added in v0.4.3

func MinioNewUserName(cluster *ninev1alpha1.NineCluster) string

func NineConstructLabels added in v0.4.3

func NineConstructLabels(cluster *ninev1alpha1.NineCluster) map[string]string

func NineObjectMeta added in v0.4.3

func NineObjectMeta(cluster *ninev1alpha1.NineCluster, suffixs ...string) metav1.ObjectMeta

func NineResourceName added in v0.4.3

func NineResourceName(cluster *ninev1alpha1.NineCluster, suffixs ...string) string

func PGInitDBUserSecretName added in v0.5.5

func PGInitDBUserSecretName(cluster *ninev1alpha1.NineCluster) string

func PGSuperUserSecretName added in v0.5.5

func PGSuperUserSecretName(cluster *ninev1alpha1.NineCluster) string

func RequestStorage added in v0.7.0

func RequestStorage(q resource.Quantity) corev1.ResourceList

Types

type NineClusterReconciler

type NineClusterReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

NineClusterReconciler reconciles a NineCluster object

func (*NineClusterReconciler) BuildPGJdbc added in v0.6.0

func (r *NineClusterReconciler) BuildPGJdbc(username string, password string, host string, dbname string) string

func (*NineClusterReconciler) BuildPGJdbcWithCluster added in v0.6.0

func (r *NineClusterReconciler) BuildPGJdbcWithCluster(cluster *ninev1alpha1.NineCluster, username string, password string, dbname string) string

func (*NineClusterReconciler) BuildPGUri added in v0.6.0

func (r *NineClusterReconciler) BuildPGUri(username string, password string, host string, dbname string) string

func (*NineClusterReconciler) CheckEndpointsReady added in v0.7.0

func (r *NineClusterReconciler) CheckEndpointsReady(cluster *ninev1alpha1.NineCluster, name string, needReplicas int) (error, bool, *corev1.Endpoints)

func (*NineClusterReconciler) CheckPodsReady added in v0.7.0

func (r *NineClusterReconciler) CheckPodsReady(cluster *ninev1alpha1.NineCluster, podLabels map[string]string, needReplicas int) (error, bool)

func (*NineClusterReconciler) Reconcile

func (r *NineClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the NineCluster object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile

func (*NineClusterReconciler) SetupWithManager

func (r *NineClusterReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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