Documentation ¶
Index ¶
- Constants
- Variables
- func CapacityPerVolume(capacity string, volumes int32) (*resource.Quantity, error)
- func CheckNineClusterTypeSupported(c ninev1alpha1.NineClusterType) bool
- func CheckOlapSupported(c ninev1alpha1.ClusterType) bool
- func CheckStorageSupported(c ninev1alpha1.ClusterStorage) bool
- func FillClustersInfo(cluster *ninev1alpha1.NineCluster) error
- func FillNineClusterType(cluster *ninev1alpha1.NineCluster) error
- func GenUniqueName4Cluster(cluster *ninev1alpha1.NineCluster, clusterType ninev1alpha1.ClusterType) string
- func GetClusterDomain(cluster *ninev1alpha1.NineCluster, cType ninev1alpha1.ClusterType) string
- func GetClusterStorage(cluster *ninev1alpha1.NineCluster) ninev1alpha1.ClusterStorage
- func GetDefaultRefClusterInfo(clusterType ninev1alpha1.ClusterType) *ninev1alpha1.ClusterInfo
- func GetDiskNum(cluster ninev1alpha1.ClusterInfo) int
- func GetK8sClientConfig() (*rest.Config, error)
- func GetOlapClusterType(cluster *ninev1alpha1.NineCluster) (ninev1alpha1.ClusterType, error)
- func GetRefClusterInfo(cluster *ninev1alpha1.NineCluster, clusterType ninev1alpha1.ClusterType) *ninev1alpha1.ClusterInfo
- func GetStorageClassName(cluster *ninev1alpha1.ClusterInfo) string
- func GiB2Bytes(datavolume int) int
- func HelmInstallCmd(chartRepo string, releaseName string, chartPath string, chartVersion string, ...) error
- func HelmUnInstallCmd(releaseName string, ns string) error
- func IsKyuubiNeedHA(cluster *ninev1alpha1.NineCluster) bool
- func LogError(ctx context.Context, err error, msg string)
- func LogInfo(ctx context.Context, msg string)
- func LogInfoInterval(ctx context.Context, interval int, msg string)
- func MinioConfigName(cluster *ninev1alpha1.NineCluster) string
- func MinioNewUserName(cluster *ninev1alpha1.NineCluster) string
- func NineConstructLabels(cluster *ninev1alpha1.NineCluster) map[string]string
- func NineObjectMeta(cluster *ninev1alpha1.NineCluster, suffixs ...string) metav1.ObjectMeta
- func NineResourceName(cluster *ninev1alpha1.NineCluster, suffixs ...string) string
- func PGInitDBUserSecretName(cluster *ninev1alpha1.NineCluster) string
- func PGSuperUserSecretName(cluster *ninev1alpha1.NineCluster) string
- func RequestStorage(q resource.Quantity) corev1.ResourceList
- type NineClusterReconciler
- func (r *NineClusterReconciler) BuildPGJdbc(username string, password string, host string, dbname string) string
- func (r *NineClusterReconciler) BuildPGJdbcWithCluster(cluster *ninev1alpha1.NineCluster, username string, password string, ...) string
- func (r *NineClusterReconciler) BuildPGUri(username string, password string, host string, dbname string) string
- func (r *NineClusterReconciler) CheckEndpointsReady(cluster *ninev1alpha1.NineCluster, name string, needReplicas int) (error, bool, *corev1.Endpoints)
- func (r *NineClusterReconciler) CheckPodsReady(cluster *ninev1alpha1.NineCluster, podLabels map[string]string, ...) (error, bool)
- func (r *NineClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *NineClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
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" )
const ( DefaultMinioNameSuffix = "-minio" MinioErrorNotExist = "The specified key does not exist" )
const ( PGResourceNameSuffix = "-pg" DefaultPGSuperUserName = "postgres" DefaultPGSuperUserPassword = "postgres" DefaultPGServerPort = 5432 PGErrorDuplicateKey = "duplicate key value violates unique constraint" )
const ( DefaultKyuubiAuthUserName = "kyuubi" DefaultKyuubiAuthPassword = "kyuubi" DefaultKyuubiAuthDatabase = "kyuubi" DefaultKyuubiZKNamespace = "kyuubi" )
const ( ZKResourceNameSuffix = "-zookeeper" DefaultZookeeperClusterSign = "zookeeper" DefaultZKClientPortName = "client" )
const ( HdfsResourceNameSuffix = "-hdfs" DefaultHdfsClusterSign = "hdfs" HdfsRoleNameNode = "namenode" )
const ( MetastoreResourceNameSuffix = "-metastore" DefaultMetastoreClusterSign = "metastore" )
const ( DorisResourceNameSuffix = "-doris" DefaultDorisBeStorageMountPath = "/opt/apache-doris/be/storage" DefaultDorisFeStorageMountPath = "/opt/apache-doris/fe/doris-meta " DefaultDorisBeStoragePVName = "bestorage" DefaultDorisFeStoragePVName = "femeta" DefaultDorisAdminUser = "root" DefaultDorisAdminPassword = "" )
const ( DfsReplicationConfKey = "dfs.replication" FSDefaultFSConfKey = "fs.defaultFS" DFSNameSpacesConfKey = "dfs.nameservices" )
const ( PGInitDBName = "hive" PGInitDBUserName = "hive" PGInitDBPassword = "hive" DefaultPgReplicas = 3 )
const (
DefaultZKReplicas = 3
)
Variables ¶
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 )
var (
DefaultMinioDiskNum = 4
)
var (
MetastoreReplicas int32 = 1
)
Functions ¶
func CapacityPerVolume ¶
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 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 HelmInstallCmd ¶ added in v0.4.3
func HelmUnInstallCmd ¶ added in v0.4.3
func IsKyuubiNeedHA ¶ added in v0.6.0
func IsKyuubiNeedHA(cluster *ninev1alpha1.NineCluster) bool
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 ¶
NineClusterReconciler reconciles a NineCluster object
func (*NineClusterReconciler) BuildPGJdbc ¶ added in v0.6.0
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 (*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.