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 ¶
var ( CertsVClusterName = "certs-vcluster" CertsVCluster = register(CertsVClusterName, certsVClusterYAML) )
var ( CLIVClusterName = "cli-vcluster" CLIVCluster = register(CLIVClusterName, cliVClusterYAML) )
var ( CommonVClusterName = "common-vcluster" CommonVCluster = register(CommonVClusterName, defaultVClusterYAML) )
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.
var ( FromHostLimitClassesVClusterName = "fromhost-limitclasses-vcluster" FromHostLimitClassesVCluster = register(FromHostLimitClassesVClusterName, fromHostLimitClassesVClusterYAML) )
var ( HAVClusterName = "ha-certs-vcluster" HAVCluster = register(HAVClusterName, haVClusterYAML) )
var ( HAShortCertsVClusterName = "ha-short-certs-vcluster" HAShortCertsVCluster = register(HAShortCertsVClusterName, haShortCertsVClusterYAML) )
var ( IsolationModeVClusterName = "isolation-mode-vcluster" IsolationModeVCluster = register(IsolationModeVClusterName, isolationModeVClusterYAML) )
var ( KubeletProxyVClusterName = "kubelet-proxy-vcluster" KubeletProxyVCluster = register(KubeletProxyVClusterName, KubeletProxyVClusterYAMLTemplate) )
var ( MetricsProxyVClusterName = "metricsproxy-vcluster" MetricsProxyVCluster = registerWith(MetricsProxyVClusterName, metricsProxyVClusterYAML, []RegisterOption{WithPreSetup(setup.MetricsServerPreSetup())}, ) )
var ( NodeSyncVClusterName = "node-sync-vcluster" NodeSyncVCluster = register(NodeSyncVClusterName, nodeSyncVClusterYAML) )
var ( PluginVClusterName = "plugin-vcluster" PluginVCluster = register(PluginVClusterName, pluginVClusterYAML) )
var ( RootlessVClusterName = "rootless-vcluster" RootlessVCluster = register(RootlessVClusterName, rootlessVClusterYAML) )
var ( SchedulerVClusterName = "scheduler-vcluster" SchedulerVCluster = register(SchedulerVClusterName, schedulerVClusterYAML) )
var ( ServiceSyncVClusterName = "service-sync-vcluster" ServiceSyncVCluster = register(ServiceSyncVClusterName, serviceSyncVClusterYAML) )
var ( ShortCertsVClusterName = "short-certs-vcluster" ShortCertsVCluster = register(ShortCertsVClusterName, shortCertsVClusterYAML) )
var ( SnapshotVClusterName = "snapshot-vcluster" SnapshotVCluster = registerWith(SnapshotVClusterName, snapshotVClusterYAML, []RegisterOption{WithPreSetup(setupcsi.SnapshotPreSetup(SnapshotVClusterName))}, ) )
var DefaultVClusterOptions = []support.ClusterOpts{ providervcluster.WithPath(filepath.Join(os.Getenv("GOBIN"), "vcluster")), providervcluster.WithLocalChartDir("../chart"), providervcluster.WithUpgrade(true), providervcluster.WithBackgroundProxyImage(constants.GetVClusterImage()), }
DefaultVClusterOptions are shared Helm/provider options for every vCluster.
var HostCluster = cluster.Define( cluster.WithName(constants.GetHostClusterName()), cluster.WithProvider(kind.NewProvider()), cluster.WithConfigFile("e2e-kind.config.yaml"), )
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 ¶
SetupFuncs returns the Setup function for every registered vCluster. Only vClusters whose label matches the current --label-filter are provisioned.
Types ¶
type PreSetupFunc ¶
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.