clusters

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package clusters defines all vCluster instances used by e2e tests.

Each vCluster is defined in its own file (e.g., default.go, ha.go) with an embedded YAML template and a register() call.

The registry infrastructure (register, PreSetup, SetupFuncs, etc.) lives in this file.

Index

Constants

This section is empty.

Variables

View Source
var (
	CertsVClusterName = "certs-vcluster"
	CertsVCluster     = register(CertsVClusterName, certsVClusterYAML)
)
View Source
var (
	CLIVClusterName = "cli-vcluster"
	CLIVCluster     = register(CLIVClusterName, cliVClusterYAML)
)
View Source
var (
	CommonVClusterName = "common-vcluster"
	CommonVCluster     = register(CommonVClusterName, defaultVClusterYAML)
)
View Source
var (
	K8sDefaultEndpointVCluster     = CommonVCluster
	K8sDefaultEndpointVClusterName = CommonVClusterName
	NodesVCluster                  = CommonVCluster
	NodesVClusterName              = CommonVClusterName
	HelmChartsVCluster             = CommonVCluster
	HelmChartsVClusterName         = CommonVClusterName
	InitManifestsVCluster          = CommonVCluster
	InitManifestsVClusterName      = CommonVClusterName
	FromHostConfigMapsVCluster     = CommonVCluster
	FromHostConfigMapsVClusterName = CommonVClusterName
	FromHostSecretsVCluster        = CommonVCluster
	FromHostSecretsVClusterName    = CommonVClusterName
)

Aliases for backward compatibility. These existed as separate cluster definitions before consolidation into CommonVCluster. Tests in other repos (vcluster-pro) may reference them by name.

View Source
var (
	FromHostLimitClassesVClusterName = "fromhost-limitclasses-vcluster"
	FromHostLimitClassesVCluster     = register(FromHostLimitClassesVClusterName, fromHostLimitClassesVClusterYAML)
)
View Source
var (
	HAVClusterName = "ha-certs-vcluster"
	HAVCluster     = register(HAVClusterName, haVClusterYAML)
)
View Source
var (
	HAShortCertsVClusterName = "ha-short-certs-vcluster"
	HAShortCertsVCluster     = register(HAShortCertsVClusterName, haShortCertsVClusterYAML)
)
View Source
var (
	IsolationModeVClusterName = "isolation-mode-vcluster"
	IsolationModeVCluster     = register(IsolationModeVClusterName, isolationModeVClusterYAML)
)
View Source
var (
	KubeletProxyVClusterName = "kubelet-proxy-vcluster"
	KubeletProxyVCluster     = register(KubeletProxyVClusterName, KubeletProxyVClusterYAMLTemplate)
)
View Source
var (
	MetricsProxyVClusterName = "metricsproxy-vcluster"
	MetricsProxyVCluster     = registerWith(MetricsProxyVClusterName, metricsProxyVClusterYAML,
		[]RegisterOption{WithPreSetup(setup.MetricsServerPreSetup())},
	)
)
View Source
var (
	NodeSyncVClusterName = "node-sync-vcluster"
	NodeSyncVCluster     = register(NodeSyncVClusterName, nodeSyncVClusterYAML)
)
View Source
var (
	PluginVClusterName = "plugin-vcluster"
	PluginVCluster     = register(PluginVClusterName, pluginVClusterYAML)
)
View Source
var (
	RootlessVClusterName = "rootless-vcluster"
	RootlessVCluster     = register(RootlessVClusterName, rootlessVClusterYAML)
)
View Source
var (
	SchedulerVClusterName = "scheduler-vcluster"
	SchedulerVCluster     = register(SchedulerVClusterName, schedulerVClusterYAML)
)
View Source
var (
	ServiceSyncVClusterName = "service-sync-vcluster"
	ServiceSyncVCluster     = register(ServiceSyncVClusterName, serviceSyncVClusterYAML)
)
View Source
var (
	ShortCertsVClusterName = "short-certs-vcluster"
	ShortCertsVCluster     = register(ShortCertsVClusterName, shortCertsVClusterYAML)
)
View Source
var (
	SnapshotVClusterName = "snapshot-vcluster"
	SnapshotVCluster     = registerWith(SnapshotVClusterName, snapshotVClusterYAML,
		[]RegisterOption{WithPreSetup(setupcsi.SnapshotPreSetup(SnapshotVClusterName))},
	)
)

DefaultVClusterOptions are shared Helm/provider options for every vCluster.

View Source
var KubeletProxyVClusterYAMLTemplate string

Functions

func PrepareAndDeferCleanup

func PrepareAndDeferCleanup(deferCleanup func(args ...interface{})) error

PrepareAndDeferCleanup re-renders all vCluster YAML templates with the current flag values (--vcluster-image) and registers temp-file cleanup.

func SetupFuncs

func SetupFuncs() []setup.Func

SetupFuncs returns the Setup function for every registered vCluster. Only vClusters whose label matches the current --label-filter are provisioned.

Types

type PreSetupFunc

type PreSetupFunc func(ctx context.Context) error

PreSetupFunc runs before the vcluster is created. Use it to install host cluster prerequisites (CRDs, PVCs, namespaces) that the syncer needs at startup.

type RegisterOption

type RegisterOption func(e *vclusterEntry)

RegisterOption configures a vcluster registration.

func WithPreSetup

func WithPreSetup(fn PreSetupFunc) RegisterOption

WithPreSetup adds a function that runs before the vcluster is created.

Jump to

Keyboard shortcuts

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