clusters

package
v0.0.0-...-686994a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeClient

func MakeClient(ctx context.Context, client client.Client, cluster types.NamespacedName) (kubernetes.Interface, error)

MakeClient creates a kubernetes client for the given workload cluster. The client is created using the kubeconfig secret of the workload cluster, which is fetched from the management cluster using client.

Types

type Connection

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

Connection is a connection to a workload cluster. A connection can be shared between multiple controllers.

func NewConnection

func NewConnection(client kubernetes.Interface, nodeAttacher func(ni corev1_informers.NodeInformer)) *Connection

NewConnection creates a new connection to a workload cluster. The nodeAttacher function is called when the connection is started. It's purpose is to attach reconciliation loops to the node informer.

func (*Connection) Shutdown

func (conn *Connection) Shutdown()

func (*Connection) Start

func (conn *Connection) Start(ctx context.Context)

type Connections

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

Connections is a collection of connections to workload clusters. It providers wrappers for getting and patching nodes in workload clusters that automatically recreate connections when the authentication expires.

func NewConnections

func NewConnections(client client.Client, contextFactory func() context.Context) *Connections

func (*Connections) AddConn

func (cc *Connections) AddConn(ctx context.Context, log logr.Logger, cluster types.NamespacedName, conn *Connection)

func (*Connections) DeleteConn

func (cc *Connections) DeleteConn(log logr.Logger, cluster types.NamespacedName)

func (*Connections) GetConn

func (cc *Connections) GetConn(cluster types.NamespacedName) *Connection

func (*Connections) GetNode

func (cc *Connections) GetNode(ctx context.Context, params GetNodeParams) (*corev1.Node, error)

func (*Connections) PatchNode

func (cc *Connections) PatchNode(ctx context.Context, params PatchNodeParams) error

func (*Connections) ReauthConn

func (cc *Connections) ReauthConn(ctx context.Context, params ReauthParams) error

type GetNodeParams

type GetNodeParams struct {
	Log     logr.Logger
	Cluster types.NamespacedName
	Name    string
}

type PatchNodeParams

type PatchNodeParams struct {
	Log        logr.Logger
	Cluster    types.NamespacedName
	Name       string
	MergePatch []byte
}

type ReauthParams

type ReauthParams struct {
	Cluster types.NamespacedName
	Log     logr.Logger
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL