Documentation
¶
Index ¶
- func NewInternalKubeconfigClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, ...) (ctrlruntimeclient.Client, error)
- func NewRootShardClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, ...) (ctrlruntimeclient.Client, error)
- func NewRootShardProxyClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, ...) (ctrlruntimeclient.Client, error)
- func NewShardClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, ...) (ctrlruntimeclient.Client, error)
- type Addresser
- type Endpoint
- type InCluster
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 ¶
func NewRootShardClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, rootShard *operatorv1alpha1.RootShard, cluster logicalcluster.Path, scheme *runtime.Scheme) (ctrlruntimeclient.Client, error)
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 ¶
func NewShardClient(ctx context.Context, c ctrlruntimeclient.Client, addr Addresser, shard *operatorv1alpha1.Shard, cluster logicalcluster.Path, scheme *runtime.Scheme) (ctrlruntimeclient.Client, error)
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