config

package
v0.20.2-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultHostsRewriteImage = "library/alpine:3.20"
)

Variables

This section is empty.

Functions

func ValidateConfigAndSetDefaults added in v0.20.0

func ValidateConfigAndSetDefaults(config *VirtualClusterConfig) error

Types

type Clients added in v0.20.0

type Clients struct {
	UncachedVirtualClient client.Client
	CachedVirtualClient   client.Client

	UncachedHostClient client.Client
	CachedHostClient   client.Client

	HostConfig    *rest.Config
	VirtualConfig *rest.Config
}

type ControllerContext added in v0.20.0

type ControllerContext struct {
	Context context.Context

	LocalManager          ctrl.Manager
	VirtualManager        ctrl.Manager
	VirtualRawConfig      *clientcmdapi.Config
	VirtualClusterVersion *version.Info

	WorkloadNamespaceClient client.Client

	Config   *VirtualClusterConfig
	StopChan <-chan struct{}

	// PreServerHooks are extra filters to inject into the server before everything else
	PreServerHooks []Filter

	// PostServerHooks are extra filters to inject into the server after everything else
	PostServerHooks []Filter

	// AcquiredLeaderHooks are hooks to start after vCluster acquired leader
	AcquiredLeaderHooks []Hook
}

type Filter added in v0.20.0

type Filter func(http.Handler, Clients) http.Handler

type Hook added in v0.15.3

type Hook func(ctx *ControllerContext) error

type VirtualClusterConfig added in v0.20.0

type VirtualClusterConfig struct {
	// Holds the vCluster config
	config.Config `json:",inline"`

	// WorkloadConfig is the config to access the workload cluster
	WorkloadConfig *rest.Config `json:"-"`

	// WorkloadClient is the client to access the workload cluster
	WorkloadClient kubernetes.Interface `json:"-"`

	// ControlPlaneConfig is the config to access the control plane cluster
	ControlPlaneConfig *rest.Config `json:"-"`

	// ControlPlaneClient is the client to access the control plane cluster
	ControlPlaneClient kubernetes.Interface `json:"-"`

	// Name is the name of the vCluster
	Name string `json:"name"`

	// WorkloadService is the name of the service of the vCluster
	WorkloadService string `json:"workloadService,omitempty"`

	// WorkloadNamespace is the namespace of the target cluster
	WorkloadNamespace string `json:"workloadNamespace,omitempty"`

	// WorkloadTargetNamespace is the namespace of the target cluster where the workloads should get created in
	WorkloadTargetNamespace string `json:"workloadTargetNamespace,omitempty"`

	// ControlPlaneService is the name of the service for the vCluster control plane
	ControlPlaneService string `json:"controlPlaneService,omitempty"`

	// ControlPlaneNamespace is the namespace where the vCluster control plane is running
	ControlPlaneNamespace string `json:"controlPlaneNamespace,omitempty"`
}

VirtualClusterConfig wraps the config and adds extra info such as name, serviceName and targetNamespace

func ParseConfig added in v0.20.0

func ParseConfig(path, name string, setValues []string) (*VirtualClusterConfig, error)

func (VirtualClusterConfig) DisableMissingAPIs added in v0.20.0

func (v VirtualClusterConfig) DisableMissingAPIs(discoveryClient discovery.DiscoveryInterface) error

DisableMissingAPIs checks if the apis are enabled, if any are missing, disable the syncer and print a log

func (VirtualClusterConfig) LegacyOptions added in v0.20.0

LegacyOptions converts the config to the legacy cluster options

func (VirtualClusterConfig) VirtualClusterKubeConfig added in v0.20.0

func (v VirtualClusterConfig) VirtualClusterKubeConfig() config.VirtualClusterKubeConfig

Jump to

Keyboard shortcuts

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