cluster-api: sigs.k8s.io/cluster-api/controllers/remote Index | Files | Directories

package remote

import "sigs.k8s.io/cluster-api/controllers/remote"

Index

Package Files

cluster.go cluster_cache.go cluster_cache_reconciler.go stoppable_cache.go

func NewClusterClient Uses

func NewClusterClient(ctx context.Context, c client.Client, cluster client.ObjectKey) (client.Client, error)

NewClusterClient returns a Client for interacting with a remote Cluster using the given scheme for encoding and decoding objects.

func RESTConfig Uses

func RESTConfig(ctx context.Context, c client.Reader, cluster client.ObjectKey) (*restclient.Config, error)

RESTConfig returns a configuration instance to be used with a Kubernetes client.

type ClusterCacheReconciler Uses

type ClusterCacheReconciler struct {
    Log     logr.Logger
    Client  client.Client
    Tracker *ClusterCacheTracker
}

ClusterCacheReconciler is responsible for stopping remote cluster caches when the cluster for the remote cache is being deleted.

func (*ClusterCacheReconciler) Reconcile Uses

func (r *ClusterCacheReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile reconciles Clusters and removes ClusterCaches for any Cluster that cannot be retrieved from the management cluster.

func (*ClusterCacheReconciler) SetupWithManager Uses

func (r *ClusterCacheReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

type ClusterCacheTracker Uses

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

ClusterCacheTracker manages client caches for workload clusters.

func NewClusterCacheTracker Uses

func NewClusterCacheTracker(log logr.Logger, manager ctrl.Manager) (*ClusterCacheTracker, error)

NewClusterCacheTracker creates a new ClusterCacheTracker.

func (*ClusterCacheTracker) GetClient Uses

func (t *ClusterCacheTracker) GetClient(ctx context.Context, cluster client.ObjectKey) (client.Client, error)

GetClient returns a client for the given cluster.

func (*ClusterCacheTracker) Watch Uses

func (t *ClusterCacheTracker) Watch(ctx context.Context, input WatchInput) error

Watch watches a remote cluster for resource events. If the watch already exists based on input.Name, this is a no-op.

type ClusterClientGetter Uses

type ClusterClientGetter func(ctx context.Context, c client.Client, cluster client.ObjectKey) (client.Client, error)

ClusterClientGetter returns a new remote client.

type WatchInput Uses

type WatchInput struct {
    // Name represents a unique watch request for the specified Cluster.
    Name string

    // Cluster is the key for the remote cluster.
    Cluster client.ObjectKey

    // Watcher is the watcher (controller) whose Reconcile() function will be called for events.
    Watcher Watcher

    // Kind is the type of resource to watch.
    Kind client.Object

    // EventHandler contains the event handlers to invoke for resource events.
    EventHandler handler.EventHandler

    // Predicates is used to filter resource events.
    Predicates []predicate.Predicate
}

WatchInput specifies the parameters used to establish a new watch for a remote cluster.

type Watcher Uses

type Watcher interface {
    // Watch watches src for changes, sending events to eventHandler if they pass predicates.
    Watch(src source.Source, eventHandler handler.EventHandler, predicates ...predicate.Predicate) error
}

Watcher is a scoped-down interface from Controller that only knows how to watch.

Directories

PathSynopsis
fake

Package remote imports 24 packages (graph) and is imported by 14 packages. Updated 2020-10-29. Refresh now. Tools for package owners.