Documentation ¶
Index ¶
- Constants
- func EventString(event *Event) string
- func GetDisaggregatedCommand(componentType dv1.DisaggregatedComponentType) (commands []string, args []string)
- func GetDisaggregatedPreStopScript(componentType dv1.DisaggregatedComponentType) string
- type DisaggregatedSubController
- type DisaggregatedSubDefaultController
- func (d *DisaggregatedSubDefaultController) BuildDefaultConfigMapVolumesVolumeMounts(cms []v1.ConfigMap) ([]corev1.Volume, []corev1.VolumeMount)
- func (d *DisaggregatedSubDefaultController) CheckMSConfigMountPath(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType)
- func (d *DisaggregatedSubDefaultController) ClassifyPodsByStatus(namespace string, status *mv1.BaseStatus, labels map[string]string, ...) error
- func (d *DisaggregatedSubDefaultController) ClearMSCommonResources(ctx context.Context, dms *mv1.DorisDisaggregatedMetaService, ...) (bool, error)deprecated
- func (d *DisaggregatedSubDefaultController) ConstructDefaultAffinity(matchKey, value string, ddcAffinity *corev1.Affinity) *corev1.Affinity
- func (d *DisaggregatedSubDefaultController) DefaultReconcileService(ctx context.Context, svc *corev1.Service) (*Event, error)
- func (d *DisaggregatedSubDefaultController) GetConfigValuesFromConfigMaps(namespace string, resolveKey string, cms []v1.ConfigMap) map[string]interface{}
- func (d *DisaggregatedSubDefaultController) GetMSConfig(ctx context.Context, cms []mv1.ConfigMap, namespace string, ...) (map[string]interface{}, error)deprecated
- func (d *DisaggregatedSubDefaultController) NewDefaultService(ddc *v1.DorisDisaggregatedCluster) *corev1.Service
- func (d *DisaggregatedSubDefaultController) NewDefaultStatefulset(ddc *v1.DorisDisaggregatedCluster) *appv1.StatefulSet
- func (d *DisaggregatedSubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, est *appv1.StatefulSet)
- type Event
- type EventReason
- type EventType
- type SubController
- type SubDefaultController
- func (d *SubDefaultController) CheckConfigMountPath(dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType)
- func (d *SubDefaultController) ClassifyPodsByStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, ...) error
- func (d *SubDefaultController) ClearCommonResources(ctx context.Context, dcr *dorisv1.DorisCluster, ...) (bool, error)
- func (d *SubDefaultController) FeAvailable(dcr *dorisv1.DorisCluster) bool
- func (d *SubDefaultController) GetConfig(ctx context.Context, configMapInfo *dorisv1.ConfigMapInfo, namespace string, ...) (map[string]interface{}, error)
- func (d *SubDefaultController) InitStatus(dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType)
- func (d *SubDefaultController) PrepareReconcileResources(ctx context.Context, dcr *dorisv1.DorisCluster, ...) bool
- func (d *SubDefaultController) RecycleResources(ctx context.Context, dcr *dorisv1.DorisCluster, ...) error
- func (d *SubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, est *appv1.StatefulSet)
- func (d *SubDefaultController) UpdateStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, ...) error
Constants ¶
const ( StatefulSetNotExist = "StatefulSetNotExist" AutoScalerDeleteFailed = "AutoScalerDeleteFailed" ComponentImageUpdate = "ComponentImageUpdate" PVCListFailed = "PVCListFailed" PVCUpdate = "PVCUpdated" PVCUpdateFailed = "PVCUpdateFailed" PVCDeleteFailed = "PVCDeleteFailed" PVCCreate = "PVCCreate" PVCCreateFailed = "PVCCreateFailed" FollowerScaleDownFailed = "FollowerScaleDownFailed" )
'reason' should be short and unique; it should be in UpperCamelCase format (starting with a capital letter).
Variables ¶
This section is empty.
Functions ¶
func EventString ¶
func GetDisaggregatedCommand ¶
func GetDisaggregatedCommand(componentType dv1.DisaggregatedComponentType) (commands []string, args []string)
func GetDisaggregatedPreStopScript ¶
func GetDisaggregatedPreStopScript(componentType dv1.DisaggregatedComponentType) string
get the script path of prestop, this will be called before stop container.
Types ¶
type DisaggregatedSubController ¶
type DisaggregatedSubController interface { //Sync reconcile for sub controller. bool represent the component have updated. Sync(ctx context.Context, obj client.Object) error //clear all resource about sub-component. ClearResources(ctx context.Context, obj client.Object) (bool, error) //return the controller name, beController, feController,cnController for log. GetControllerName() string //UpdateStatus update the component status on src. UpdateComponentStatus(obj client.Object) error }
type DisaggregatedSubDefaultController ¶
type DisaggregatedSubDefaultController struct { K8sclient client.Client K8srecorder record.EventRecorder ControllerName string }
func (*DisaggregatedSubDefaultController) BuildDefaultConfigMapVolumesVolumeMounts ¶
func (d *DisaggregatedSubDefaultController) BuildDefaultConfigMapVolumesVolumeMounts(cms []v1.ConfigMap) ([]corev1.Volume, []corev1.VolumeMount)
func (*DisaggregatedSubDefaultController) CheckMSConfigMountPath ¶
func (d *DisaggregatedSubDefaultController) CheckMSConfigMountPath(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType)
generate map for mountpath:configmap Deprecated:
func (*DisaggregatedSubDefaultController) ClassifyPodsByStatus ¶
func (d *DisaggregatedSubDefaultController) ClassifyPodsByStatus(namespace string, status *mv1.BaseStatus, labels map[string]string, replicas int32) error
func (*DisaggregatedSubDefaultController) ClearMSCommonResources
deprecated
func (d *DisaggregatedSubDefaultController) ClearMSCommonResources(ctx context.Context, dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) (bool, error)
Deprecated: ClearMSCommonResources clear common resources all component have, as statefulset, service. response `bool` represents all resource have deleted, if not and delete resource failed return false for next reconcile retry.
func (*DisaggregatedSubDefaultController) ConstructDefaultAffinity ¶
func (*DisaggregatedSubDefaultController) DefaultReconcileService ¶
func (d *DisaggregatedSubDefaultController) DefaultReconcileService(ctx context.Context, svc *corev1.Service) (*Event, error)
the common logic to apply service, will used by fe,be,ms.
func (*DisaggregatedSubDefaultController) GetConfigValuesFromConfigMaps ¶
func (*DisaggregatedSubDefaultController) GetMSConfig
deprecated
func (d *DisaggregatedSubDefaultController) GetMSConfig(ctx context.Context, cms []mv1.ConfigMap, namespace string, componentType mv1.ComponentType) (map[string]interface{}, error)
Deprecated:
func (*DisaggregatedSubDefaultController) NewDefaultService ¶
func (d *DisaggregatedSubDefaultController) NewDefaultService(ddc *v1.DorisDisaggregatedCluster) *corev1.Service
for config default values.
func (*DisaggregatedSubDefaultController) NewDefaultStatefulset ¶
func (d *DisaggregatedSubDefaultController) NewDefaultStatefulset(ddc *v1.DorisDisaggregatedCluster) *appv1.StatefulSet
func (*DisaggregatedSubDefaultController) RestrictConditionsEqual ¶
func (d *DisaggregatedSubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, est *appv1.StatefulSet)
RestrictConditionsEqual adds two StatefulSet, It is used to control the conditions for comparing. nst StatefulSet - a new StatefulSet est StatefulSet - an old StatefulSet
type Event ¶
type Event struct { Type EventType Reason EventReason Message string }
type EventReason ¶
type EventReason string
var ( ImageFormatError EventReason = "ImageFormatError" FDBSpecEmpty EventReason = "SpecEmpty" FDBAvailableButUnhealth EventReason = "FDBAvailableButUnhealth" FESpecSetError EventReason = "FESpecSetError" FECreateResourceFailed EventReason = "FECreateResourceFailed" FEApplyResourceFailed EventReason = "FEApplyResourceFailed" FEStatefulsetDeleteFailed EventReason = "FEStatefulsetDeleteFailed" FEHTTPFailed EventReason = "FEHTTPResponseFailed" FEServiceDeleteFailed EventReason = "FEServiceDeleteFailed" ComputeGroupsEmpty EventReason = "CGsEmpty" CGSqlExecFailed EventReason = "CGSqlExecFailed" //CGSuspendStatusRequestFailed EventReason = "CGSuspendStatusRequestFailed" //CGResumeReplicasInconsistency EventReason = "CGSuspendReplicasInconsistency" //CGResumeStatusRequestFailed EventReason = "CGResumeStatusRequestFailed" CGUniqueIdentifierDuplicate EventReason = "CGUniqueIdentifierDuplicate" CGUniqueIdentifierNotMatchRegex EventReason = "CGUniqueIdentifierNotMatchRegex" CGCreateResourceFailed EventReason = "CGCreateResourceFailed" CGApplyResourceFailed EventReason = "CGApplyResourceFailed" CGStatefulsetDeleteFailed EventReason = "CGStatefulsetDeleteFailed" CGServiceDeleteFailed EventReason = "CGServiceDeleteFailed" ConfigMapPathRepeated EventReason = "ConfigMapPathRepeated" WaitMetaServiceAvailable EventReason = "WaitMetaServiceAvailable" WaitFEAvailable EventReason = "WaitFEAvailable" ServiceApplyedFailed EventReason = "ServiceApplyedFailed" MSServiceDeletedFailed EventReason = "MSServiceDeletedFailed" MSStatefulsetDeleteFailed EventReason = "MSStatefulsetDeleteFailed" FDBAddressNotConfiged EventReason = "FDBAddressNotConfiged" )
type EventType ¶
type EventType string
define event type for sub controller, Type can be one of Normal, Warning.
type SubController ¶
type SubController interface { //Sync reconcile for sub controller. bool represent the component have updated. Sync(ctx context.Context, cluster *dorisv1.DorisCluster) error //clear all resource about sub-component. ClearResources(ctx context.Context, cluster *dorisv1.DorisCluster) (bool, error) //return the controller name, beController, feController,cnController for log. GetControllerName() string //UpdateStatus update the component status on src. UpdateComponentStatus(cluster *dorisv1.DorisCluster) error }
type SubDefaultController ¶
type SubDefaultController struct { K8sclient client.Client K8srecorder record.EventRecorder }
SubDefaultController define common function for all component about doris.
func (*SubDefaultController) CheckConfigMountPath ¶
func (d *SubDefaultController) CheckConfigMountPath(dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType)
generate map for mountpath:configmap
func (*SubDefaultController) ClassifyPodsByStatus ¶
func (d *SubDefaultController) ClassifyPodsByStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, replicas int32) error
func (*SubDefaultController) ClearCommonResources ¶
func (d *SubDefaultController) ClearCommonResources(ctx context.Context, dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType) (bool, error)
ClearCommonResources clear common resources all component have, as statefulset, service. response `bool` represents all resource have deleted, if not and delete resource failed return false for next reconcile retry.
func (*SubDefaultController) FeAvailable ¶
func (d *SubDefaultController) FeAvailable(dcr *dorisv1.DorisCluster) bool
func (*SubDefaultController) GetConfig ¶
func (d *SubDefaultController) GetConfig(ctx context.Context, configMapInfo *dorisv1.ConfigMapInfo, namespace string, componentType dorisv1.ComponentType) (map[string]interface{}, error)
func (*SubDefaultController) InitStatus ¶
func (d *SubDefaultController) InitStatus(dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType)
func (*SubDefaultController) PrepareReconcileResources ¶
func (d *SubDefaultController) PrepareReconcileResources(ctx context.Context, dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType) bool
PrepareReconcileResources prepare resource for reconcile response: bool, if true presents resource have ready for reconciling, if false presents resource is preparing.
func (*SubDefaultController) RecycleResources ¶
func (d *SubDefaultController) RecycleResources(ctx context.Context, dcr *dorisv1.DorisCluster, componentType dorisv1.ComponentType) error
RecycleResources pvc resource for recycle
func (*SubDefaultController) RestrictConditionsEqual ¶
func (d *SubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, est *appv1.StatefulSet)
RestrictConditionsEqual adds two StatefulSet, It is used to control the conditions for comparing. nst StatefulSet - a new StatefulSet est StatefulSet - an old StatefulSet
func (*SubDefaultController) UpdateStatus ¶
func (d *SubDefaultController) UpdateStatus(namespace string, status *dorisv1.ComponentStatus, labels map[string]string, replicas int32) error
UpdateStatus update the component status on src.