replication

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ControllerName hold this controller name.
	ControllerName = "kcp-replication-controller"

	// AnnotationKey is the name of the annotation key used to mark an object for replication.
	AnnotationKey = "internal.sharding.kcp.dev/replicate"
)
View Source
const (
	// ByShardAndLogicalClusterAndNamespaceAndName is the name for the index that indexes by an object's shard and logical cluster, namespace and name
	ByShardAndLogicalClusterAndNamespaceAndName = "kcp-byShardAndLogicalClusterAndNamespaceAndName"
)

Variables

This section is empty.

Functions

func IndexByShardAndLogicalClusterAndNamespace

func IndexByShardAndLogicalClusterAndNamespace(obj interface{}) ([]string, error)

IndexByShardAndLogicalClusterAndNamespace is an index function that indexes by an object's shard and logical cluster, namespace and name

func NewController

func NewController(
	shardName string,
	dynamicCacheClient dynamic.ClusterInterface,
	dynamicLocalClient dynamic.ClusterInterface,
	localApiExportInformer apisinformers.APIExportInformer,
	cacheApiExportInformer apisinformers.APIExportInformer,
) (*controller, error)

NewController returns a new replication controller.

The replication controller copies objects of defined resources that have the "internal.sharding.kcp.dev/replicate" annotation to the cache server.

The replicated object will be placed under the same cluster as the original object. In addition to that, all replicated objects will be placed under the shard taken from the shardName argument. For example: shards/{shardName}/clusters/{clusterName}/apis/apis.kcp.dev/v1alpha1/apiexports

func ShardAndLogicalClusterAndNamespaceKey

func ShardAndLogicalClusterAndNamespaceKey(shard, cluster, namespace, name string) string

ShardAndLogicalClusterAndNamespaceKey creates an index key from the given parameters. As of today this function is used by IndexByShardAndLogicalClusterAndNamespace indexer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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