Documentation
¶
Index ¶
- Constants
- func GVRAndLogicalClusterKey(gvr schema.GroupVersionResource, cluster logicalcluster.Name) string
- func GenerateIdentitySecret(ctx context.Context, ns string, name string) (*corev1.Secret, error)
- func GroupResourceKey(gr schema.GroupResource) string
- func IdentityAndGroupResourceKey(identity string, gr schema.GroupResource) string
- func IndexByGVRAndLogicalCluster(obj interface{}) ([]string, error)
- func IndexByGroupResource(obj interface{}) ([]string, error)
- func IndexByIdentityAndGroupResource(obj interface{}) ([]string, error)
- type CachedResourceResource
- type Controller
Constants ¶
const ( ControllerName = "kcp-cached-resources-controller" DefaultIdentitySecretNamespace = "kcp-system" )
This Controller starts 1 published resource controller per shard. This is bit wasteful for now. We can optimize this by starting a single controller per logical cluster. But this required stopping and starting the controller when a new published resource is created. This would be fist optimization we need todo as follow-up before removing feature flag and making it enabled by default.
const ( // AnnotationResourceKind is set on CachedResource objects to record the Kind of the cached resource. AnnotationResourceKind = "cache.kcp.io/resource-kind" // AnnotationResourceScope records the REST scope of the cached resource: "Namespaced" or "Cluster". AnnotationResourceScope = "cache.kcp.io/resource-scope" )
const ( // ByGVRAndLogicalCluster is the name for the index that indexes by an object's gvr and logical cluster. ByGVRAndLogicalCluster = "kcp-byGVRAndLogicalCluster" // ByIdentityAndGroupResource is the name for the index that indexes by an object's identity hash and group/resource. ByIdentityAndGroupResource = "kcp-byIdentityAndGroupResource" ByGroupResource = "kcp-byGroupResource" )
Variables ¶
This section is empty.
Functions ¶
func GVRAndLogicalClusterKey ¶
func GVRAndLogicalClusterKey(gvr schema.GroupVersionResource, cluster logicalcluster.Name) string
GVRAndShardAndLogicalClusterAndNamespaceKey creates an index key from the given parameters. Key will be in the form of version.resource.group|cluster.
func GenerateIdentitySecret ¶
TODO: This is copy from apiexport controller. We should move it to a shared location.
func GroupResourceKey ¶ added in v0.32.0
func GroupResourceKey(gr schema.GroupResource) string
GroupResourceKey creates an index key from an identity hash and group/resource.
func IdentityAndGroupResourceKey ¶ added in v0.32.0
func IdentityAndGroupResourceKey(identity string, gr schema.GroupResource) string
IdentityAndGroupResourceKey creates an index key from an identity hash and group/resource.
func IndexByGVRAndLogicalCluster ¶
IndexByShardAndLogicalClusterAndNamespace is an index function that indexes by an object's gvr and logical cluster.
func IndexByGroupResource ¶ added in v0.32.0
IndexByGroupResource is an index function that indexes by an object's group/resource.
func IndexByIdentityAndGroupResource ¶ added in v0.32.0
IndexByIdentityAndGroupResource is an index function that indexes by an object's identity hash and group/resource. Objects with an empty identity hash are not indexed.
Types ¶
type CachedResourceResource ¶
type CachedResourceResource = committer.Resource[*cachev1alpha1.CachedResourceSpec, *cachev1alpha1.CachedResourceStatus]
type Controller ¶
type Controller struct {
CachedResourceIndexer cache.Indexer
CachedResourceLister cachev1alpha1listers.CachedResourceClusterLister
CachedResourceEndpointSliceInformer cacheinformers.CachedResourceEndpointSliceClusterInformer
// contains filtered or unexported fields
}
func NewController ¶
func NewController( shardName string, kcpClusterClient kcpclientset.ClusterInterface, kcpCacheClient kcpclientset.ClusterInterface, localDynamicClient kcpdynamic.ClusterInterface, globalDynamicClient kcpdynamic.ClusterInterface, kubeClusterClient kcpkubernetesclientset.ClusterInterface, namespaceInformer kcpcorev1informers.NamespaceClusterInformer, secretInformer kcpcorev1informers.SecretClusterInformer, cacheApiExtensionsClusterClient kcpapiextensionsclientset.ClusterInterface, cacheApiExtensionsClusterInformer kcpapiextensionsinformers.SharedInformerFactory, dynRESTMapper *dynamicrestmapper.DynamicRESTMapper, localDiscoveringDynamicKcpInformers *informer.DiscoveringDynamicSharedInformerFactory, globalDiscoveringDynamicKcpInformers *informer.DiscoveringDynamicSharedInformerFactory, cachedResourceInformer cacheinformers.CachedResourceClusterInformer, cachedResourceEndpointSliceInformer cacheinformers.CachedResourceEndpointSliceClusterInformer, ) (*Controller, error)
NewController returns a new controller for CachedResource objects.
Source Files
¶
- cachedresources_controller.go
- cachedresources_finalizer.go
- cachedresources_purge.go
- cachedresources_reconcile.go
- cachedresources_reconcile_annotations.go
- cachedresources_reconcile_checker.go
- cachedresources_reconcile_endpointslice.go
- cachedresources_reconcile_identity.go
- cachedresources_reconcile_replication.go
- cachedresources_reconcile_schema.go
- indexers.go