cli

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 80 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RestoreResourceQuota = "vcluster-restore"
)

Variables

View Source
var AllowedDistros = []string{config.K8SDistro, config.K3SDistro}
View Source
var CreatedByVClusterAnnotation = "vcluster.loft.sh/created"
View Source
var ErrPlatformDriverRequired = errors.New("cannot resume a virtual cluster that is paused by the platform, please run 'vcluster use driver platform' or use the '--driver platform' flag")

Functions

func AddVClusterHelm

func AddVClusterHelm(
	ctx context.Context,
	options *AddVClusterOptions,
	globalFlags *flags.GlobalFlags,
	args []string,
	log log.Logger,
) error

func CleanupSyncedNamespaces added in v0.26.0

func CleanupSyncedNamespaces(
	ctx context.Context,
	mainPhysicalNamespace string,
	vClusterName string,
	restConfig *rest.Config,
	k8sClient *kubernetes.Clientset,
	logger log.Logger,
) error

CleanupSyncedNamespaces identifies all physical namespaces that were managed by this vCluster.

  1. Namespaces created on host as result of vCluster syncing will be deleted.
  2. Namespaces imported into the vCluster from host will be cleaned up by removing all vCluster-related metadata from the namespace itself and all resources within it.

func ConnectHelm

func ConnectHelm(ctx context.Context, options *ConnectOptions, globalFlags *flags.GlobalFlags, vClusterName string, command []string, log log.Logger) error

func ConnectPlatform

func ConnectPlatform(ctx context.Context, options *ConnectOptions, globalFlags *flags.GlobalFlags, vClusterName string, command []string, log log.Logger) error

func CreateHelm

func CreateHelm(ctx context.Context, options *CreateOptions, globalFlags *flags.GlobalFlags, vClusterName string, log log.Logger) error

func CreatePlatform

func CreatePlatform(ctx context.Context, options *CreateOptions, globalFlags *flags.GlobalFlags, virtualClusterName string, log log.Logger) error

func DeleteHelm

func DeleteHelm(ctx context.Context, platformClient platform.Client, options *DeleteOptions, globalFlags *flags.GlobalFlags, vClusterName string, log log.Logger) error

func DeletePlatform

func DeletePlatform(ctx context.Context, platformClient platform.Client, options *DeleteOptions, vClusterName string, log log.Logger) error

func DescribeHelm

func DescribeHelm(ctx context.Context, flags *flags.GlobalFlags, output io.Writer, name, format string) error

func DescribePlatform

func DescribePlatform(ctx context.Context, globalFlags *flags.GlobalFlags, output io.Writer, l log.Logger, name, projectName, format string) error

func ListHelm

func ListHelm(ctx context.Context, options *ListOptions, globalFlags *flags.GlobalFlags, log log.Logger) error

func ListPlatform

func ListPlatform(ctx context.Context, options *ListOptions, globalFlags *flags.GlobalFlags, logger log.Logger, projectName string, showUserOwned bool) error

func PauseHelm

func PauseHelm(ctx context.Context, globalFlags *flags.GlobalFlags, vClusterName string, log log.Logger) error

func PausePlatform

func PausePlatform(ctx context.Context, options *PauseOptions, cfg *cliconfig.CLI, vClusterName string, log log.Logger) error

func PauseVCluster added in v0.24.0

func PauseVCluster(
	ctx context.Context,
	kubeClient *kubernetes.Clientset,
	vCluster *find.VCluster,
	log log.Logger,
) error

func Restore added in v0.24.0

func Restore(ctx context.Context, args []string, globalFlags *flags.GlobalFlags, snapshot *snapshot.Options, pod *pod.Options, newVCluster bool, log log.Logger) error

func ResumeHelm

func ResumeHelm(ctx context.Context, globalFlags *flags.GlobalFlags, vClusterName string, log log.Logger) error

func ResumePlatform

func ResumePlatform(ctx context.Context, options *ResumeOptions, config *config.CLI, vClusterName string, log log.Logger) error

func Snapshot added in v0.24.0

func Snapshot(ctx context.Context, args []string, globalFlags *flags.GlobalFlags, snapshotOpts *snapshot.Options, podOptions *pod.Options, log log.Logger) error

Types

type AddVClusterOptions

type AddVClusterOptions struct {
	Project                  string
	ImportName               string
	Restart                  bool
	Insecure                 bool
	AccessKey                string
	Host                     string
	CertificateAuthorityData []byte
	All                      bool
}

type ConnectOptions

type ConnectOptions struct {
	Driver string

	ServiceAccountClusterRole string
	PodName                   string
	Address                   string
	KubeConfigContextName     string
	Server                    string
	KubeConfig                string
	ServiceAccount            string
	BackgroundProxyImage      string
	LocalPort                 int
	ServiceAccountExpiration  int
	Print                     bool
	UpdateCurrent             bool
	BackgroundProxy           bool
	Insecure                  bool

	Project string
}

type CreateOptions

type CreateOptions struct {
	Driver string

	KubeConfigContextName string
	ChartVersion          string
	ChartName             string
	ChartRepo             string
	LocalChartDir         string
	Distro                string
	Values                []string
	SetValues             []string
	Print                 bool

	KubernetesVersion string

	CreateNamespace      bool
	UpdateCurrent        bool
	BackgroundProxy      bool
	BackgroundProxyImage string
	Add                  bool
	Expose               bool
	ExposeLocal          bool
	Restore              string
	Connect              bool
	Upgrade              bool

	// Platform
	Project         string
	Cluster         string
	Template        string
	TemplateVersion string
	Links           []string
	Annotations     []string
	Labels          []string
	Params          string
	SetParams       []string
	Description     string
	DisplayName     string
	Team            string
	User            string
	UseExisting     bool
	Recreate        bool
	SkipWait        bool
}

CreateOptions holds the create cmd options

type DeleteOptions

type DeleteOptions struct {
	Driver string

	Project             string
	Wait                bool
	KeepPVC             bool
	DeleteNamespace     bool
	DeleteContext       bool
	DeleteConfigMap     bool
	AutoDeleteNamespace bool
	IgnoreNotFound      bool
}

type DescribeOutput

type DescribeOutput struct {
	Distro       string   `json:"distro"`
	Version      string   `json:"version"`
	BackingStore string   `json:"backingStore"`
	ImageTags    ImageTag `json:"imageTags"`
}

type ImageTag

type ImageTag struct {
	APIServer string `json:"apiServer,omitempty"`
	Syncer    string `json:"syncer,omitempty"`
}

type ListOptions

type ListOptions struct {
	Driver string

	Output string
}

type ListProVCluster added in v0.26.0

type ListProVCluster struct {
	ListVCluster
	Project string
}

ListProVCluster holds information about a vCluster along with the associated project name

type ListVCluster

type ListVCluster struct {
	Created    time.Time
	Name       string
	Namespace  string
	Version    string
	Status     string
	AgeSeconds int
	Connected  bool
}

ListVCluster holds information about a cluster

type PauseOptions

type PauseOptions struct {
	Driver string

	Project       string
	ForceDuration int64
}

type ResumeOptions

type ResumeOptions struct {
	Driver string

	Project string
}

Jump to

Keyboard shortcuts

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