Documentation
¶
Overview ¶
Package tablegroup implements the controller for the TableGroup resource.
The TableGroup controller acts as a "middle-manager" in the Multigres hierarchy, sitting between the root MultigresCluster and the leaf Shard resources.
Responsibilities:
Shard Lifecycle Management: It watches TableGroup resources and creates, updates, or deletes (prunes) child Shard resources to match the list of fully resolved shard specifications provided in the TableGroup spec.
Status Aggregation: It monitors the status of all owned Shards and aggregates them into the TableGroup's status (e.g., ReadyShards / TotalShards), providing a summarized view for the parent MultigresCluster controller.
Design Note: This controller is intentionally "dumb" regarding configuration logic. It does not perform template resolution or defaulting. It expects fully resolved specs to be pushed down from the parent MultigresCluster controller, and its only job is to enforce that state on the child Shards.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildShard ¶
func BuildShard( tg *multigresv1alpha1.TableGroup, shardSpec *multigresv1alpha1.ShardResolvedSpec, scheme *runtime.Scheme, ) (*multigresv1alpha1.Shard, error)
BuildShard constructs the desired Shard resource.
Types ¶
type TableGroupReconciler ¶
type TableGroupReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
TableGroupReconciler reconciles a TableGroup object.
func (*TableGroupReconciler) Reconcile ¶
func (r *TableGroupReconciler) Reconcile( ctx context.Context, req ctrl.Request, ) (ctrl.Result, error)
Reconcile reads the state of the TableGroup and ensures its child Shards are in the desired state.
+kubebuilder:rbac:groups=multigres.com,resources=tablegroups,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=multigres.com,resources=tablegroups/status,verbs=get;update;patch +kubebuilder:rbac:groups=multigres.com,resources=tablegroups/finalizers,verbs=update +kubebuilder:rbac:groups=multigres.com,resources=shards,verbs=get;list;watch;create;update;patch;delete
func (*TableGroupReconciler) SetupWithManager ¶
func (r *TableGroupReconciler) SetupWithManager( mgr ctrl.Manager, opts ...controller.Options, ) error
SetupWithManager sets up the controller with the Manager.