vcluster

package
v0.3.61 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigDataMissing = errors.New("config data not found")
)

Functions

func New

func New(getApplication application.GetterFunc) *application.Provisioner

New returns a new initialized provisioner object.

Types

type Client

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

Client provides vcluster services for standard client-go apps.

func NewClient

func NewClient(client kubernetes.Interface) *Client

NewClient returns vcluster abstraction with a client-go client.

func (*Client) ClientConfig

func (c *Client) ClientConfig(ctx context.Context, namespace string, external bool) (*clientcmdapi.Config, error)

ClientConfig returns a raw client configuration.

func (*Client) GetSecret

func (c *Client) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error)

GetSecret provides an implementation specific way to get a secret.

func (*Client) Kubeconfig

func (c *Client) Kubeconfig(ctx context.Context, namespace string, external bool) (string, error)

Kubeconfig return the Kubernetes configuration file blob.

func (*Client) RESTConfig

func (c *Client) RESTConfig(ctx context.Context, namespace string, external bool) (*rest.Config, error)

RESTConfig returns a REST client configuration.

type ConfigGetter

type ConfigGetter interface {
	// GetSecret provides an implementation specific way to get a secret.
	GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error)
}

ConfigGetter abstracts the fact that we call this code from a controller-runtime world, and a kubectl one, each having wildly different client models.

type ControllerRuntimeClient

type ControllerRuntimeClient struct{}

ControllerRuntimeClient provides vcluster services for controllers.

func NewControllerRuntimeClient

func NewControllerRuntimeClient() *ControllerRuntimeClient

NewControllerRuntimeClient returns vcluster abstraction with a controller runtime client.

func (*ControllerRuntimeClient) Client

func (c *ControllerRuntimeClient) Client(ctx context.Context, namespace string, external bool) (client.Client, error)

Client returns a controller runtime client able to access resources in the vcluster.

func (*ControllerRuntimeClient) ClientConfig

func (c *ControllerRuntimeClient) ClientConfig(ctx context.Context, namespace string, external bool) (*clientcmdapi.Config, error)

ClientConfig returns a raw client configuration.

func (*ControllerRuntimeClient) GetSecret

func (c *ControllerRuntimeClient) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error)

GetSecret provides an implementation specific way to get a secret.

func (*ControllerRuntimeClient) Kubeconfig

func (c *ControllerRuntimeClient) Kubeconfig(ctx context.Context, namespace string, external bool) (string, error)

Kubeconfig return the Kubernetes configuration file blob.

func (*ControllerRuntimeClient) RESTConfig

func (c *ControllerRuntimeClient) RESTConfig(ctx context.Context, namespace string, external bool) (*rest.Config, error)

RESTConfig returns a REST client configuration.

type RemoteCluster

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

func NewRemoteCluster

func NewRemoteCluster(namespace string, labeller coreunikornv1.ResourceLabeller) *RemoteCluster

NewRemoteCluster return a new instance of a remote cluster generator.

func (*RemoteCluster) Config

Config implements the remotecluster.Generator interface.

func (*RemoteCluster) ID

ID implements the remotecluster.Generator interface.

type VCluster

type VCluster interface {
	// ClientConfig returns a raw client configuration.
	ClientConfig(ctx context.Context, namespace string, external bool) (*clientcmdapi.Config, error)

	// RESTConfig returns a REST client configuration.
	RESTConfig(ctx context.Context, namespace string, external bool) (*rest.Config, error)

	// Kubeconfig return the Kubernetes configuration file blob.
	Kubeconfig(ctx context.Context, namespace string, external bool) (string, error)
}

VCluster provides services around virtual clusters.

Jump to

Keyboard shortcuts

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