constants

package
v0.29.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SkipTranslationAnnotation = "vcluster.loft.sh/skip-translate"
	SyncResourceAnnotation    = "vcluster.loft.sh/force-sync"

	PausedReplicasAnnotation = "loft.sh/paused-replicas"
	PausedDateAnnotation     = "loft.sh/paused-date"

	HostClusterPersistentVolumeAnnotation = "vcluster.loft.sh/host-pv"

	HostClusterVSCAnnotation = "vcluster.loft.sh/host-volumesnapshotcontent"

	// NodeSuffix is the dns suffix for our nodes
	NodeSuffix = "nodes.vcluster.com"

	// KubeletPort is the port we pretend the kubelet is running under
	KubeletPort = int32(10250)

	// LoftDirectClusterEndpoint is a cluster annotation that tells the loft cli to use this endpoint instead of
	// the default loft server address to connect to this cluster.
	LoftDirectClusterEndpoint = "loft.sh/direct-cluster-endpoint"

	// LoftDirectClusterEndpointInsecure specifies if we should use insecure connection for this cluster
	LoftDirectClusterEndpointInsecure = "loft.sh/direct-cluster-endpoint-insecure"

	VClusterNamespaceAnnotation = "vcluster.loft.sh/vcluster-namespace"
	VClusterNameAnnotation      = "vcluster.loft.sh/vcluster-name"
)
View Source
const (
	TokenLabelKey        = "vcluster.loft.sh/token"
	TokenNodeTypeKey     = "vcluster.loft.sh/token-node-type"
	NodeTypeControlPlane = "control-plane"
	NodeTypeWorker       = "worker"
)
View Source
const (
	IndexByAssigned      = "IndexByAssigned"
	IndexByIngressSecret = "IndexByIngressSecret"
	IndexByPodSecret     = "IndexByPodSecret"
	// IndexByHostName is used to map rewritten hostnames(advertised as node addresses) to nodenames
	IndexByHostName = "IndexByHostName"

	IndexByClusterIP = "IndexByClusterIP"

	// IndexRunningNonVClusterPodsByNode is only used when the vcluster scheduler is enabled.
	// It maps non-vcluster pods on the node to the node name, so that the node syncer may
	// calculate the allocatable resources on the node.
	IndexRunningNonVClusterPodsByNode = "IndexRunningNonVClusterPodsByNode"
)
View Source
const (
	VClusterNamespaceLabel = VClusterNamespaceAnnotation
	VClusterNameLabel      = VClusterNameAnnotation
)
View Source
const (
	VClusterFolder  = ".vcluster"
	ConfigFileName  = "config.json"
	ManagerFileName = "manager.json"
)
View Source
const (
	VClusterStandaloneEndpointsAnnotation = "vcluster.loft.sh/standalone-endpoints"
	VClusterStandaloneIPAddressEnvVar     = "VCLUSTER_STANDALONE_IP_ADDRESS"
)
View Source
const DefaultCacheSyncTimeout = time.Minute * 15
View Source
const (
	FieldManager = "vcluster"
)
View Source
const LoftChartRepo = "https://charts.loft.sh"

Variables

View Source
var (
	K3sKineEndpoint   = "unix:///data/server/kine.sock"
	K3sSqliteDatabase = "/data/server/db/state.db"

	DataDir = "/data"
	PKIDir  = filepath.Join(DataDir, "pki")

	K8sKineEndpoint   = "unix://" + filepath.Join(DataDir, "kine.sock")
	K8sSqliteDatabase = filepath.Join(DataDir, "state.db")

	EmbeddedEtcdData         = filepath.Join(DataDir, "etcd")
	EmbeddedCoreDNSAdminConf = filepath.Join(DataDir, "vcluster", "admin.conf")

	ServerCAKey         = filepath.Join(PKIDir, "server-ca.key")
	ServerCACert        = filepath.Join(PKIDir, "server-ca.crt")
	ClientCACert        = filepath.Join(PKIDir, "client-ca.crt")
	RequestHeaderCACert = filepath.Join(PKIDir, "front-proxy-ca.crt")

	FrontProxyClientCert = filepath.Join(PKIDir, "front-proxy-client.crt")
	FrontProxyClientKey  = filepath.Join(PKIDir, "front-proxy-client.key")

	SAKey  = filepath.Join(PKIDir, "sa.key")
	SACert = filepath.Join(PKIDir, "sa.pub")

	APIServerCert = filepath.Join(PKIDir, "apiserver.crt")
	APIServerKey  = filepath.Join(PKIDir, "apiserver.key")

	APIServerKubeletClientCert = filepath.Join(PKIDir, "apiserver-kubelet-client.crt")
	APIServerKubeletClientKey  = filepath.Join(PKIDir, "apiserver-kubelet-client.key")

	AdminKubeConfig       = filepath.Join(PKIDir, "admin.conf")
	ControllerManagerConf = filepath.Join(PKIDir, "controller-manager.conf")
	SchedulerConf         = filepath.Join(PKIDir, "scheduler.conf")

	BinariesDir                = "/binaries"
	K8sAPIServerBinary         = filepath.Join(BinariesDir, "kube-apiserver")
	K8sControllerManagerBinary = filepath.Join(BinariesDir, "kube-controller-manager")
	K8sSchedulerBinary         = filepath.Join(BinariesDir, "kube-scheduler")
	KineBinary                 = "/usr/local/bin/kine"

	// DefaultVClusterConfigLocation is the default location of the vCluster config within the container
	DefaultVClusterConfigLocation = "/var/lib/vcluster/config.yaml"

	// VClusterNamespaceInHostMappingSpecialCharacter is an empty string that mean vCluster host namespace
	// in the config.sync.fromHost.*.selector.mappings
	VClusterNamespaceInHostMappingSpecialCharacter = ""

	SystemPriorityClassesAllowList = []string{
		"system-node-critical",
		"system-cluster-critical",
	}
)
View Source
var (
	CoreDNSLabelKey   = "k8s-app"
	CoreDNSLabelValue = "vcluster-kube-dns"
)
View Source
var CoreDNSVersionMap = map[string]string{
	"1.33": "coredns/coredns:1.12.0",
	"1.32": "coredns/coredns:1.11.3",
	"1.31": "coredns/coredns:1.11.3",
	"1.30": "coredns/coredns:1.11.3",
}

Functions

func DefaultBackgroundProxyImage added in v0.23.3

func DefaultBackgroundProxyImage(version string) string

func GetVclusterUserAgent added in v0.15.1

func GetVclusterUserAgent() string

returns vcluster user agent with a constant name part used by the API server for FieldManager

func PausedAnnotation added in v0.10.0

func PausedAnnotation(isRestore bool) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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