Documentation
¶
Index ¶
- type ClusterClientGetter
- type Controller
- func (c *Controller) BaseURL(shardName string) (string, bool)
- func (c *Controller) ClusterContext(parent context.Context, cluster logicalcluster.Name) (context.Context, context.CancelFunc)
- func (c *Controller) Lookup(path logicalcluster.Path) (index.Result, bool)
- func (c *Controller) LookupURL(path logicalcluster.Path) (index.Result, bool)
- func (c *Controller) Ready() error
- func (c *Controller) RecentlyMigrated(cluster logicalcluster.Name) bool
- func (c *Controller) Start(ctx context.Context, numThreads int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterClientGetter ¶ added in v0.11.0
type ClusterClientGetter func(shard *corev1alpha1.Shard) (kcpclientset.ClusterInterface, error)
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller watches Shards on the root shard, and then starts informers for every Shard, watching the Workspaces on them. It then updates the workspace index, which maps logical clusters to shard URLs.
func NewController ¶
func NewController( ctx context.Context, shardInformer corev1alpha1informers.ShardInformer, clientGetter ClusterClientGetter, ) *Controller
func (*Controller) BaseURL ¶ added in v0.34.0
func (c *Controller) BaseURL(shardName string) (string, bool)
func (*Controller) ClusterContext ¶ added in v0.33.0
func (c *Controller) ClusterContext(parent context.Context, cluster logicalcluster.Name) (context.Context, context.CancelFunc)
func (*Controller) Lookup ¶
func (c *Controller) Lookup(path logicalcluster.Path) (index.Result, bool)
func (*Controller) LookupURL ¶ added in v0.11.0
func (c *Controller) LookupURL(path logicalcluster.Path) (index.Result, bool)
func (*Controller) Ready ¶ added in v0.34.0
func (c *Controller) Ready() error
Ready reports whether the index knows the workspaces and logical clusters of every Shard: for each Shard the lister knows, the per-shard informers have been started and have completed their initial list. Until then a lookup of a cluster on a not yet indexed shard answers "not found", which the proxy turns into a 404 and the service account authenticator into a 401, so this is a readiness check rather than a liveness one. A Shard whose informers are not running yet, e.g. because its client cannot be built, keeps the index not ready.
Cordoned Shards, those carrying the unschedulable annotation, are left out: cordoning is how a shard is put into maintenance, and a shard that is down for maintenance must not keep every proxy out of rotation, least of all on a proxy restart during the maintenance. Their workspaces are routable once their informers have synced.
func (*Controller) RecentlyMigrated ¶ added in v0.33.0
func (c *Controller) RecentlyMigrated(cluster logicalcluster.Name) bool