client

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func NewShardIdentityClient added in v0.9.1

func NewShardIdentityClient(ctx context.Context, c ctrlruntimeclient.Client, endpoint Endpoint, shard *operatorv1alpha1.Shard, cluster logicalcluster.Path, scheme *runtime.Scheme) (ctrlruntimeclient.Client, error)

NewShardIdentityClient returns a new client for talking to the given endpoint as the shard itself, using the shard's own (system:masters) client certificate. This is required for managing the shard's own Shard object, which kcp protects against writes by anyone else.

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