Documentation ¶
Index ¶
- func NewFakeTenantCluster(vc *v1alpha1.Virtualcluster, fakeClientSet clientset.Interface, ...) (*fakeCluster, error)
- type CacheOptions
- type Cluster
- func (c *Cluster) AddEventHandler(objectType runtime.Object, handler clientgocache.ResourceEventHandler) error
- func (c *Cluster) GetClientSet() (clientset.Interface, error)
- func (c *Cluster) GetClusterName() string
- func (c *Cluster) GetDelegatingClient() (client.Client, error)
- func (c *Cluster) GetOwnerInfo() (string, string, string)
- func (c *Cluster) GetSpec() (*v1alpha1.VirtualclusterSpec, error)
- func (c *Cluster) SetSynced()
- func (c *Cluster) Start() error
- func (c *Cluster) Stop()
- func (c *Cluster) WaitForCacheSync() bool
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeTenantCluster ¶
Types ¶
type CacheOptions ¶
type CacheOptions struct { // Resync is the period between cache resyncs. // A cache resync triggers event handlers for each object watched by the cache. // It can be useful if your level-based logic isn't perfect. Resync *time.Duration // Namespace can be used to watch only a single namespace. // If unset (Namespace == ""), all namespaces are watched. Namespace string }
CacheOptions is embedded in Options to configure the new Cluster's cache.
type Cluster ¶
type Cluster struct { // Config is the rest.config used to talk to the apiserver. Required. RestConfig *rest.Config Options // contains filtered or unexported fields }
Each Cluster object represents a tenant master in Virtual Cluster architecture.
Cluster implements the ClusterInterface used by MultiClusterController in github.com/kubernetes-sigs/multi-tenancy/incubator/virtualcluster/pkg/syncer/mccontroller/mccontroller.go.
It stores a Kubernetes client, cache, and other cluster-scoped dependencies. The dependencies are lazily created in getters and cached for reuse. It is not thread safe.
func NewTenantCluster ¶
func NewTenantCluster(key, namespace, name, uid string, vclister vclisters.VirtualclusterLister, configBytes []byte, o Options) (*Cluster, error)
New creates a new Cluster.
func (*Cluster) AddEventHandler ¶
func (c *Cluster) AddEventHandler(objectType runtime.Object, handler clientgocache.ResourceEventHandler) error
AddEventHandler instructs the Cluster's cache to watch objectType's resource, if it doesn't already, and to add handler as an event handler.
func (*Cluster) GetClientSet ¶
GetClientSet returns a clientset client without any informer caches. All client requests go to apiserver directly.
func (*Cluster) GetClusterName ¶
GetClusterName returns the unique cluster name, aka, the root namespace name.
func (*Cluster) GetDelegatingClient ¶
GetDelegatingClient returns a lazily created controller-runtime DelegatingClient. It is used by other Cluster getters, and by reconcilers. TODO: consider implementing Reader, Writer and StatusClient in Cluster and forwarding to actual delegating client.
func (*Cluster) GetSpec ¶
func (c *Cluster) GetSpec() (*v1alpha1.VirtualclusterSpec, error)
GetSpec returns the virtual cluster spec.
func (*Cluster) Start ¶
Start starts the Cluster's cache and blocks, until an empty struct is sent to the stop channel.
func (*Cluster) WaitForCacheSync ¶
WaitForCacheSync waits for the Cluster's cache to sync, OR until an empty struct is sent to the stop channel.
type Options ¶
type Options struct {
CacheOptions
}
Options are the arguments for creating a new Cluster.