Documentation ¶
Index ¶
- Constants
- func DefaultBuildClientsFromConfig(kubeConfig []byte, clusterID cluster.ID, configOverrides ...func(*rest.Config)) (kube.Client, error)
- type ACTION
- type ClientBuilder
- type Cluster
- type ClusterStore
- func (c *ClusterStore) All() map[string]map[cluster.ID]*Cluster
- func (c *ClusterStore) Contains(clusterID cluster.ID) bool
- func (c *ClusterStore) Delete(secretKey string, clusterID cluster.ID)
- func (c *ClusterStore) Get(secretKey string, clusterID cluster.ID) *Cluster
- func (c *ClusterStore) GetByID(clusterID cluster.ID) *Cluster
- func (c *ClusterStore) GetExistingClustersFor(secretKey string) []*Cluster
- func (c *ClusterStore) HasSynced() bool
- func (c *ClusterStore) Len() int
- func (c *ClusterStore) Store(secretKey string, clusterID cluster.ID, value *Cluster)
- type Component
- type ComponentBuilder
- type ComponentConstraint
- type Controller
- type Fake
- type KclientComponent
Constants ¶
const (
MultiClusterSecretLabel = "istio/multiCluster"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientBuilder ¶
type ClientBuilder = func(kubeConfig []byte, clusterId cluster.ID, configOverrides ...func(*rest.Config)) (kube.Client, error)
ClientBuilder builds a new kube.Client from a kubeconfig. Mocked out for testing
type Cluster ¶
type Cluster struct { // ID of the cluster. ID cluster.ID // Client for accessing the cluster. Client kube.Client // contains filtered or unexported fields }
Cluster defines cluster struct
func (*Cluster) Run ¶
Run starts the cluster's informers and waits for caches to sync. Once caches are synced, we mark the cluster synced. This should be called after each of the handlers have registered informers, and should be run in a goroutine.
func (*Cluster) Stop ¶
func (c *Cluster) Stop()
Stop closes the stop channel, if is safe to be called multi times.
func (*Cluster) SyncDidTimeout ¶
type ClusterStore ¶
ClusterStore is a collection of clusters
func (*ClusterStore) All ¶
func (c *ClusterStore) All() map[string]map[cluster.ID]*Cluster
All returns a copy of the current remote clusters.
func (*ClusterStore) Get ¶
func (c *ClusterStore) Get(secretKey string, clusterID cluster.ID) *Cluster
func (*ClusterStore) GetExistingClustersFor ¶
func (c *ClusterStore) GetExistingClustersFor(secretKey string) []*Cluster
GetExistingClustersFor return existing clusters registered for the given secret
func (*ClusterStore) HasSynced ¶
func (c *ClusterStore) HasSynced() bool
func (*ClusterStore) Len ¶
func (c *ClusterStore) Len() int
type Component ¶
type Component[T ComponentConstraint] struct { // contains filtered or unexported fields }
func BuildMultiClusterComponent ¶
func BuildMultiClusterComponent[T ComponentConstraint](c ComponentBuilder, constructor func(cluster *Cluster) T) *Component[T]
BuildMultiClusterComponent constructs a new multicluster component. For each cluster, the constructor will be called. If the cluster is removed, the T.Close() method will be called. Constructors MUST not do blocking IO; they will block other operations. During a cluster update, a new component is constructed before the old one is removed for seamless migration.
func (*Component[T]) ForCluster ¶
type ComponentBuilder ¶
type ComponentBuilder interface {
// contains filtered or unexported methods
}
type ComponentConstraint ¶
type ComponentConstraint interface { Close() HasSynced() bool }
type Controller ¶
type Controller struct { ClientBuilder ClientBuilder // contains filtered or unexported fields }
Controller is the controller implementation for Secret resources
func NewController ¶
func NewController(kubeclientset kube.Client, namespace string, clusterID cluster.ID, meshWatcher mesh.Watcher, configOverrides ...func(*rest.Config), ) *Controller
NewController returns a new secret controller
func (*Controller) GetRemoteKubeClient ¶
func (c *Controller) GetRemoteKubeClient(clusterID cluster.ID) kubernetes.Interface
func (*Controller) HasSynced ¶
func (c *Controller) HasSynced() bool
func (*Controller) ListClusters ¶
func (c *Controller) ListClusters() []cluster.ID
func (*Controller) ListRemoteClusters ¶
func (c *Controller) ListRemoteClusters() []cluster.DebugInfo
ListRemoteClusters provides debug info about connected remote clusters.
func (*Controller) Run ¶
func (c *Controller) Run(stopCh <-chan struct{}) error
Run starts the controller until it receives a message over stopCh
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
func NewFakeController ¶
func NewFakeController() *Fake
type KclientComponent ¶
type KclientComponent[T controllers.ComparableObject] struct { // contains filtered or unexported fields }
func BuildMultiClusterKclientComponent ¶
func BuildMultiClusterKclientComponent[T controllers.ComparableObject](c ComponentBuilder, filter kubetypes.Filter) *KclientComponent[T]
BuildMultiClusterKclientComponent builds a simple Component that just wraps a single kclient.Client
func (*KclientComponent[T]) All ¶
func (m *KclientComponent[T]) All() []kclient.Client[T]
func (*KclientComponent[T]) ForCluster ¶
func (m *KclientComponent[T]) ForCluster(clusterID cluster.ID) kclient.Client[T]
ForCluster returns the client for the requests cluster Note: this may return nil.