Documentation ¶
Index ¶
- Constants
- Variables
- func CheckReconfigureUpdateProgress(pods []corev1.Pod, configKey, version string) int32
- func DeleteConfigMapFinalizer(cli client.Client, ctx intctrlutil.RequestCtx, obj client.Object) error
- func GetClientFactory() createReconfigureClient
- func GetComponentPods(params reconfigureParams) ([]corev1.Pod, error)
- func GetReloadOptions(cli client.Client, ctx context.Context, ...) (*appsv1alpha1.ReloadOptions, *appsv1alpha1.FormatterConfig, error)
- func NeedReloadVolume(config appsv1alpha1.ComponentConfigSpec) bool
- func NewReconfigurePolicy(cc *appsv1alpha1.ConfigConstraintSpec, cfgPatch *cfgcore.ConfigPatchInfo, ...) (reconfigurePolicy, error)
- func ReconcileConfigSpecsForReferencedCR[T generics.Object, PT generics.PObject[T]](client client.Client, ctx intctrlutil.RequestCtx, obj PT) error
- func RegisterPolicy(policy appsv1alpha1.UpgradePolicy, action reconfigurePolicy)
- type AutoReloadPolicy
- type ComponentValidateHandler
- type ConfigConstraintReconciler
- type ConfigTemplateHandler
- type ExecStatus
- type GetPodsFunc
- type OnlineUpdatePodFunc
- type ReconfigureRequestReconciler
- type RestartContainerFunc
- type ReturnedStatus
- type RollingUpgradeFuncs
- type ValidateConfigMap
- type ValidateConfigSchema
Constants ¶
const (
ConfigReconcileInterval = time.Second * 1
)
Variables ¶
var ConfigurationRequiredLabels = []string{ constant.AppNameLabelKey, constant.AppInstanceLabelKey, constant.KBAppComponentLabelKey, constant.CMConfigurationTemplateNameLabelKey, constant.CMConfigurationTypeLabelKey, constant.CMConfigurationSpecProviderLabelKey, }
Functions ¶
func CheckReconfigureUpdateProgress ¶
CheckReconfigureUpdateProgress checks pods of the component is ready.
func DeleteConfigMapFinalizer ¶
func DeleteConfigMapFinalizer(cli client.Client, ctx intctrlutil.RequestCtx, obj client.Object) error
func GetClientFactory ¶
func GetClientFactory() createReconfigureClient
GetClientFactory support ut mock
func GetComponentPods ¶
GetComponentPods get all pods of the component.
func GetReloadOptions ¶
func GetReloadOptions(cli client.Client, ctx context.Context, configSpecs []appsv1alpha1.ComponentConfigSpec) (*appsv1alpha1.ReloadOptions, *appsv1alpha1.FormatterConfig, error)
func NeedReloadVolume ¶
func NeedReloadVolume(config appsv1alpha1.ComponentConfigSpec) bool
func NewReconfigurePolicy ¶
func NewReconfigurePolicy(cc *appsv1alpha1.ConfigConstraintSpec, cfgPatch *cfgcore.ConfigPatchInfo, policy appsv1alpha1.UpgradePolicy, restart bool) (reconfigurePolicy, error)
func ReconcileConfigSpecsForReferencedCR ¶
func ReconcileConfigSpecsForReferencedCR[T generics.Object, PT generics.PObject[T]](client client.Client, ctx intctrlutil.RequestCtx, obj PT) error
func RegisterPolicy ¶
func RegisterPolicy(policy appsv1alpha1.UpgradePolicy, action reconfigurePolicy)
Types ¶
type AutoReloadPolicy ¶
type AutoReloadPolicy struct{}
func (AutoReloadPolicy) GetPolicyName ¶
func (receiver AutoReloadPolicy) GetPolicyName() string
func (AutoReloadPolicy) Upgrade ¶
func (receiver AutoReloadPolicy) Upgrade(params reconfigureParams) (ReturnedStatus, error)
type ComponentValidateHandler ¶
type ComponentValidateHandler func(component *appsv1alpha1.ClusterComponentDefinition) error
type ConfigConstraintReconciler ¶
type ConfigConstraintReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
ConfigConstraintReconciler reconciles a ConfigConstraint object
func (*ConfigConstraintReconciler) Reconcile ¶
func (r *ConfigConstraintReconciler) 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 ConfigConstraint 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.11.2/pkg/reconcile
func (*ConfigConstraintReconciler) SetupWithManager ¶
func (r *ConfigConstraintReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ConfigTemplateHandler ¶
type ConfigTemplateHandler func([]appsv1alpha1.ComponentConfigSpec) (bool, error)
type ExecStatus ¶
type ExecStatus string
ExecStatus defines running result for Reconfiguring policy (fsm). ESNone describes policy has finished and quit. ESRetry describes fsm is running. ESFailed describes fsm is failed and exited. ESNotSupport describes fsm does not support the feature. ESAndRetryFailed describes fsm is failed in current state, but can be retried. +enum
const ( ESNone ExecStatus = "None" ESRetry ExecStatus = "Retry" ESFailed ExecStatus = "Failed" ESNotSupport ExecStatus = "NotSupport" ESAndRetryFailed ExecStatus = "FailedAndRetry" )
type GetPodsFunc ¶
type OnlineUpdatePodFunc ¶
type ReconfigureRequestReconciler ¶
type ReconfigureRequestReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
ReconfigureRequestReconciler reconciles a ReconfigureRequest object
func (*ReconfigureRequestReconciler) Reconcile ¶
func (r *ReconfigureRequestReconciler) 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 ReconfigureRequest 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.11.2/pkg/reconcile
func (*ReconfigureRequestReconciler) SetupWithManager ¶
func (r *ReconfigureRequestReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type RestartContainerFunc ¶
type ReturnedStatus ¶
type ReturnedStatus struct { Status ExecStatus SucceedCount int32 ExpectedCount int32 }
type RollingUpgradeFuncs ¶
type RollingUpgradeFuncs struct { GetPodsFunc GetPodsFunc RestartContainerFunc RestartContainerFunc OnlineUpdatePodFunc OnlineUpdatePodFunc }
func GetConsensusRollingUpgradeFuncs ¶
func GetConsensusRollingUpgradeFuncs() RollingUpgradeFuncs
func GetDeploymentRollingUpgradeFuncs ¶
func GetDeploymentRollingUpgradeFuncs() RollingUpgradeFuncs
func GetReplicationRollingUpgradeFuncs ¶
func GetReplicationRollingUpgradeFuncs() RollingUpgradeFuncs
func GetStatefulSetRollingUpgradeFuncs ¶
func GetStatefulSetRollingUpgradeFuncs() RollingUpgradeFuncs
type ValidateConfigMap ¶
type ValidateConfigSchema ¶
type ValidateConfigSchema func(tpl *appsv1alpha1.CustomParametersValidation) (bool, error)