client

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInternalKubeconfigClient

func NewInternalKubeconfigClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, kubeconfig *operatorv1alpha1.Kubeconfig, cluster logicalcluster.Path, scheme *runtime.Scheme) (ctrlruntimeclient.Client, error)

NewInternalKubeconfigClient returns a kube client for a Kubeconfig that allows the kcp-operator to access the backend with elevated permissions. For Kubeconfigs pointing directly towards any type of shard, the client will also directly connect to that shard, but for Kubeconfigs using a FrontProxy, the client will instead use the operator-internal front-proxy (which specifically does not drop groups/permissions).

func NewRootShardClient

NewRootShardClient returns a new client for talking to the kcp root shard directly.

func NewRootShardProxyClient

func NewRootShardProxyClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, rootShard *operatorv1alpha1.RootShard, cluster logicalcluster.Path, scheme *runtime.Scheme) (ctrlruntimeclient.Client, error)

NewRootShardProxyClient returns a new client that connects to the operator's internal front-proxy.

func NewShardClient

NewShardClient returns a new client for talking to a kcp shard directly.

Types

type Addresser

type Addresser interface {
	// RootShard addresses a root shard.
	RootShard(rootShard *operatorv1alpha1.RootShard) Endpoint

	// RootShardProxy addresses the internal proxy deployed alongside the root shard.
	RootShardProxy(rootShard *operatorv1alpha1.RootShard) Endpoint

	// Shard addresses a shard.
	Shard(shard *operatorv1alpha1.Shard) Endpoint
}

Addresser resolves the components an operator has to talk to.

By default kcp-operator addresses components through their in-cluster service addresses. In deployments across multiple clusters the user must supply how kcp-operator can reach the components.

type Endpoint

type Endpoint struct {
	// URL is the base URL of the component.
	URL string

	// ServerName is the name verified during the TLS handshake.
	// Empty verifies the URL's host.
	ServerName string

	// DialContext connects to the address on the named network using
	// the provided context.
	// it has the same interfaces as [net.Dialer] DialContext.
	Dial func(ctx context.Context, network, address string) (net.Conn, error)
}

Endpoint is how kcp components are reached.

type InCluster

type InCluster struct{}

InCluster is the default implementation, targeting each component with the in-cluster service address.

func (InCluster) RootShard

func (InCluster) RootShard(rootShard *operatorv1alpha1.RootShard) Endpoint

func (InCluster) RootShardProxy

func (InCluster) RootShardProxy(rootShard *operatorv1alpha1.RootShard) Endpoint

func (InCluster) Shard

func (InCluster) Shard(shard *operatorv1alpha1.Shard) Endpoint

Jump to

Keyboard shortcuts

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