Documentation
¶
Index ¶
- func CheckFEReady(ctx context.Context, k8sClient client.Client, ...) bool
- func CheckFEReadyInDisasterRecovery(ctx context.Context, k8sClient client.Client, clusterNamespace string, ...) bool
- func EnterDisasterRecoveryMode(ctx context.Context, k8sClient client.Client, src *v1.StarRocksCluster, ...) error
- func GetFEConfig(ctx context.Context, client client.Client, feSpec *srapi.StarRocksFeSpec, ...) (map[string]interface{}, error)
- func IsRunInSharedDataMode(config map[string]interface{}) bool
- func PortReadyProbe(port int) *corev1.Probe
- func ShouldEnterDisasterRecoveryMode(drSpec *v1.DisasterRecovery, drStatus *v1.DisasterRecoveryStatus, ...) (bool, int32)
- type FeController
- func (fc *FeController) ClearCluster(ctx context.Context, src *srapi.StarRocksCluster) error
- func (fc *FeController) GetControllerName() string
- func (fc *FeController) SyncCluster(ctx context.Context, src *srapi.StarRocksCluster) error
- func (fc *FeController) UpdateClusterStatus(_ context.Context, src *srapi.StarRocksCluster) error
- func (fc *FeController) Validating(feSpec *srapi.StarRocksFeSpec) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFEReady ¶
func CheckFEReady(ctx context.Context, k8sClient client.Client, clusterNamespace, clusterName string) bool
CheckFEReady check the fe cluster is ok. Note: When user upgrade the cluster, and the statefulset controller has not begun to update the statefulset, CheckFEReady will use the old status to check whether FE is ready.
func CheckFEReadyInDisasterRecovery ¶ added in v1.10.0
func CheckFEReadyInDisasterRecovery(ctx context.Context, k8sClient client.Client, clusterNamespace string, clusterName string, generation int64) bool
CheckFEReadyInDisasterRecovery check whether the FE pod is ready. When user upgrade the cluster, and the statefulset controller has not begun to update the statefulset, CheckFEReady will use the old status to check whether FE is ready. CheckFEReadyInDisasterRecovery will check the following things:
- make sure the value of environment RESTORE_CLUSTER_GENERATION equals to the generation of disaster recovery.
- make sure the pod is ready.
func EnterDisasterRecoveryMode ¶ added in v1.10.0
func EnterDisasterRecoveryMode(ctx context.Context, k8sClient client.Client, src *v1.StarRocksCluster, sts *appsv1.StatefulSet, queryPort int32) error
func GetFEConfig ¶ added in v1.9.8
func GetFEConfig(ctx context.Context, client client.Client, feSpec *srapi.StarRocksFeSpec, namespace string) (map[string]interface{}, error)
GetFEConfig get the fe config from configMap. It is not a method of FeController, but BE/CN controller also need to get the config from configMap.
func IsRunInSharedDataMode ¶ added in v1.10.0
func PortReadyProbe ¶ added in v1.10.0
PortReadyProbe detect whether the port is ready
func ShouldEnterDisasterRecoveryMode ¶ added in v1.10.0
func ShouldEnterDisasterRecoveryMode(drSpec *v1.DisasterRecovery, drStatus *v1.DisasterRecoveryStatus, feConfig map[string]interface{}) (bool, int32)
Types ¶
type FeController ¶
type FeController struct {
Client client.Client
Recorder record.EventRecorder
}
func New ¶
func New(k8sClient client.Client, recorderFor subcontrollers.GetEventRecorderForFunc) *FeController
New construct a FeController.
func (*FeController) ClearCluster ¶ added in v1.11.0
func (fc *FeController) ClearCluster(ctx context.Context, src *srapi.StarRocksCluster) error
ClearCluster clears resource about fe.
func (*FeController) GetControllerName ¶
func (fc *FeController) GetControllerName() string
func (*FeController) SyncCluster ¶
func (fc *FeController) SyncCluster(ctx context.Context, src *srapi.StarRocksCluster) error
SyncCluster starRocksCluster spec to fe statefulset and service.
func (*FeController) UpdateClusterStatus ¶
func (fc *FeController) UpdateClusterStatus(_ context.Context, src *srapi.StarRocksCluster) error
UpdateClusterStatus update the all resource status about fe.
func (*FeController) Validating ¶ added in v1.9.9
func (fc *FeController) Validating(feSpec *srapi.StarRocksFeSpec) error