logicalclustermigration

package
v0.32.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package logicalclustermigration implements migrating logical clusters between shards.

The migration process is roughly:

- LogicalClusterMigration is created by an admin anywhere - LogicalClusterMigration is propagated to the cache server

After the propagation the origin and destination shards see the LCMigration through their cache server informer and can react to changes on it, while making changes by using the client going through the front-proxy.

Origin shard (reconcilePreparing):

  • Sets itself in the .status.originShard
  • Annotates the LC to prevent access
  • Configures informers to ignore objects related to the LC
  • Cancels all active connections to the LC
  • Purges all objects in informers related to the LC

Destination shard (reconcileMigrating):

  • Configures informers to ignore objects related to the LC
  • Copies over all objects from the origin shard and writes them directly to the etcd

Origin shard (reconcileOriginCleanup):

  • Purges all objects, including the LC from etcd

Destination shard (reconcileDestinationFinalize):

  • Updates the LC to remove the annotation
  • Resyncs all informers so they pick up the LC's objects

The front-proxy automatically bars access to the LC and routes requests to the new shard by discovering the objects on the shards directly.

Index

Constants

View Source
const (
	ControllerName = "kcp-logicalcluster-migration"

	// MigratingAnnotationKey is the annotation set on the LogicalCluster object to
	// indicate it is currently being migrated. The value is the cluster path
	// of the LogicalClusterMigration object that triggered the migration.
	MigratingAnnotationKey = "internal.kcp.io/migrating"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(
	shardName string,
	kcpClusterClient kcpclientset.ClusterInterface,
	externalLogicalClusterAdminConfig *rest.Config,
	etcdClient *clientv3.Client,
	etcdStoragePrefix string,
	cachedLogicalClusterMigrationInformer migrationv1alpha1informers.LogicalClusterMigrationClusterInformer,
	localLogicalClusterInformer corev1alpha1informers.LogicalClusterClusterInformer,
	cachedShardInformer corev1alpha1informers.ShardClusterInformer,
	migratingLogicalClusters *MigratingLogicalClusters,
	cancelLogicalClusterConnections func(logicalcluster.Path, error),
	ddsif *informer.DiscoveringDynamicSharedInformerFactory,
) (*Controller, error)

func (*Controller) Start

func (c *Controller) Start(ctx context.Context, numThreads int)

type MigratingLogicalClusters

type MigratingLogicalClusters struct {
	// contains filtered or unexported fields
}

MigratingLogicalClusters tracks which logical clusters are in migration.

func NewMigratingLogicalClusters

func NewMigratingLogicalClusters() *MigratingLogicalClusters

func (*MigratingLogicalClusters) Get

Get returns the migration object path for a migrating logical cluster.

func (*MigratingLogicalClusters) IsMigrating

func (m *MigratingLogicalClusters) IsMigrating(name logicalcluster.Name) bool

IsMigrating returns whether the logical cluster is currently being migrated.

func (*MigratingLogicalClusters) Remove

Remove marks a logical cluster as no longer migrating.

func (*MigratingLogicalClusters) Set

func (m *MigratingLogicalClusters) Set(name logicalcluster.Name, migrationPath string) error

Set marks a logical cluster as migrating. The migrationPath is the path to the LogicalClusterMigration that triggered the migration in the form <workspace path>:<migration name>.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL