StatefulSet
The vCluster control plane typically runs as a StatefulSet to ensure data persists across restarts. This setup uses a PersistentVolume for state storage. However, if you set statefulSet.persistence.volumeClaim.enabled: false or omit the statefulSet.persistence.volumeClaimTemplates configuration, vCluster defaults to deploying the control plane as a Deployment, which does not retain state across restarts.
Configure high availability​
Use the highAvailability settings to run multiple replicas of the vCluster control plane. One pod acts as the leader, while the others remain on standby:
-
If the leader pod crashes, becomes unhealthy, or restarts, another pod automatically takes over leadership.
-
The number of available replicas determines how quickly a new leader can be elected.
-
You can fine-tune the leader election process using the following settings:
leaseDuration: Maximum time a leader can hold leadership without renewal.renewDeadline: Time a pod waits to renew its leadership before it gives up.retryPeriod: Interval between retries when attempting to acquire or renew leadership.
Schedule tenant cluster pods​
You can configure how and where tenant cluster pods are scheduled within the Kubernetes cluster. Configure the scheduling field with the following options to control pod placement in the cluster:
-
nodeSelector
Match specific node labels to guide the scheduler toward preferred nodes. Examples include:- Targeting nodes in a specific region
- Selecting nodes with a specific architecture or machine class
-
affinitySet rules to control how pods are scheduled in relation to other pods.- Use anti-affinity (repel the pod) to keep tenant cluster pods on separate nodes. A common technique is to make tenant cluster pods repel each other so that they are not scheduled on the same nodes.This increases resiliency if a node is scaled down or replaced.
- Use affinity (attract the pod) to group related pods together and reduce network latency for critical services.
-
tolerations
Allow pods to run on nodes with specific taints. Use this to schedule tenant cluster pods on nodes that would otherwise reject them. A common pattern is to taint nodes for non-tenant-cluster workloads and configure tenant cluster pods to tolerate the taint. This keeps tenant clusters separate from critical workloads. See Taints and Tolerations for more information. -
priorityClassName
Set the pod’s priority to control scheduling order and preemption. See the Pod Priority and Preemption documentation for details. -
podManagementPolicyControl how StatefulSets create and delete pods. See Pod Management Policies for details. -
topologySpreadConstraintsSpread pods evenly across zones, nodes, or other topology domains. See Pod Topology Spread Constraints and the comparison withpodAffinityandpodAntiAffinityfor more information.
Reuse an existing PersistenceVolumeClaim​
You can pre-provision a PersistenceVolumeClaim, and then configure vCluster to use it.
To do this, set the existing claim name in the chart values controlPlane.statefulSet.persistence.dataVolume under persistenceVolumeClaim.claimName:
controlPlane:
statefulSet:
persistence:
dataVolume:
- name: data
persistentVolumeClaim:
claimName: my-existing-pvc
vCluster image options​
There are currently 3 vCluster image builds you can use in statefulSet.image.repository:
loft-sh/vcluster-pro: The default image for the Helm chart. This image works for all use cases.loft-sh/vcluster-oss: An open source build of vClusterloft-sh/vcluster: Deprecated. Useloft-sh/vcluster-ossinstead.
Config reference​
statefulSet object ​
StatefulSet defines options for vCluster statefulSet deployed by Helm.
statefulSet object ​highAvailability object ​
HighAvailability holds options related to high availability.
highAvailability object ​replicas integer 1 ​
Replicas is the amount of replicas to use for the statefulSet.
replicas integer 1 ​leaseDuration integer 60 ​
LeaseDuration is the time to lease for the leader.
leaseDuration integer 60 ​renewDeadline integer 40 ​
RenewDeadline is the deadline to renew a lease for the leader.
renewDeadline integer 40 ​retryPeriod integer 15 ​
RetryPeriod is the time until a replica will retry to get a lease.
retryPeriod integer 15 ​resources object ​
Resources are the resource requests and limits for the statefulSet container.
resources object ​limits object map[ephemeral-storage:10Gi memory:4Gi] ​
Limits are resource limits for the container
limits object map[ephemeral-storage:10Gi memory:4Gi] ​requests object map[cpu:200m ephemeral-storage:1Gi memory:256Mi] ​
Requests are minimal resources that will be consumed by the container
requests object map[cpu:200m ephemeral-storage:1Gi memory:256Mi] ​scheduling object ​
Scheduling holds options related to scheduling.
scheduling object ​nodeSelector object {} ​
NodeSelector is the node selector to apply to the pod.
nodeSelector object {} ​affinity object {} ​
Affinity is the affinity to apply to the pod.
affinity object {} ​tolerations object[] [] ​
Tolerations are the tolerations to apply to the pod.
tolerations object[] [] ​priorityClassName string ​
PriorityClassName is the priority class name for the the pod.
priorityClassName string ​podManagementPolicy string Parallel ​
PodManagementPolicy is the statefulSet pod management policy.
podManagementPolicy string Parallel ​topologySpreadConstraints object[] [] ​
TopologySpreadConstraints are the topology spread constraints for the pod.
topologySpreadConstraints object[] [] ​security object ​
Security defines pod or container security context.
security object ​podSecurityContext object {} ​
PodSecurityContext specifies security context options on the pod level.
podSecurityContext object {} ​containerSecurityContext object map[allowPrivilegeEscalation:false runAsGroup:0 runAsUser:0] ​
ContainerSecurityContext specifies security context options on the container level.
containerSecurityContext object map[allowPrivilegeEscalation:false runAsGroup:0 runAsUser:0] ​probes object ​
Probes enables or disables the main container probes.
probes object ​livenessProbe object ​
LivenessProbe specifies if the liveness probe for the container should be enabled
livenessProbe object ​enabled boolean true ​
Enabled defines if this option should be enabled.
enabled boolean true ​failureThreshold integer 60 ​
Number of consecutive failures for the probe to be considered failed
failureThreshold integer 60 ​initialDelaySeconds integer 60 ​
Time (in seconds) to wait before starting the liveness probe
initialDelaySeconds integer 60 ​timeoutSeconds integer 3 ​
Maximum duration (in seconds) that the probe will wait for a response.
timeoutSeconds integer 3 ​periodSeconds integer 2 ​
Frequency (in seconds) to perform the probe
periodSeconds integer 2 ​readinessProbe object ​
ReadinessProbe specifies if the readiness probe for the container should be enabled
readinessProbe object ​enabled boolean true ​
Enabled defines if this option should be enabled.
enabled boolean true ​failureThreshold integer 60 ​
Number of consecutive failures for the probe to be considered failed
failureThreshold integer 60 ​timeoutSeconds integer 3 ​
Maximum duration (in seconds) that the probe will wait for a response.
timeoutSeconds integer 3 ​periodSeconds integer 2 ​
Frequency (in seconds) to perform the probe
periodSeconds integer 2 ​startupProbe object ​
StartupProbe specifies if the startup probe for the container should be enabled
startupProbe object ​enabled boolean true ​
Enabled defines if this option should be enabled.
enabled boolean true ​failureThreshold integer 300 ​
Number of consecutive failures allowed before failing the pod
failureThreshold integer 300 ​timeoutSeconds integer 3 ​
Maximum duration (in seconds) that the probe will wait for a response.
timeoutSeconds integer 3 ​periodSeconds integer 6 ​
Frequency (in seconds) to perform the probe
periodSeconds integer 6 ​persistence object ​
Persistence defines options around persistence for the statefulSet.
persistence object ​volumeClaim object ​
VolumeClaim can be used to configure the persistent volume claim.
volumeClaim object ​enabled string|boolean auto ​
Enabled enables deploying a persistent volume claim. If auto, vCluster will automatically determine
based on the chosen distro and other options if this is required.
enabled string|boolean auto ​accessModes string[] [ReadWriteOnce] ​
AccessModes are the persistent volume claim access modes.
accessModes string[] [ReadWriteOnce] ​retentionPolicy string Retain ​
RetentionPolicy is the persistent volume claim retention policy.
retentionPolicy string Retain ​size string 5Gi ​
Size is the persistent volume claim storage size.
size string 5Gi ​storageClass string ​
StorageClass is the persistent volume claim storage class.
storageClass string ​volumeClaimTemplates object[] [] ​
VolumeClaimTemplates defines the volumeClaimTemplates for the statefulSet
volumeClaimTemplates object[] [] ​dataVolume object[] [] ​
Allows you to override the dataVolume. Only works correctly if volumeClaim.enabled=false.
dataVolume object[] [] ​binariesVolume object[] [map[emptyDir:map[] name:binaries]] ​
BinariesVolume defines a binaries volume that is used to retrieve
distro specific executables to be run by the syncer controller.
This volume doesn't need to be persistent.
binariesVolume object[] [map[emptyDir:map[] name:binaries]] ​addVolumes object[] [] ​
AddVolumes defines extra volumes for the pod
addVolumes object[] [] ​addVolumeMounts object[] ​
AddVolumeMounts defines extra volume mounts for the container
addVolumeMounts object[] ​name string ​
This must match the Name of a Volume.
name string ​readOnly boolean ​
Mounted read-only if true, read-write otherwise (false or unspecified).
Defaults to false.
readOnly boolean ​mountPath string ​
Path within the container at which the volume should be mounted. Must
not contain ':'.
mountPath string ​subPath string ​
Path within the volume from which the container's volume should be mounted.
Defaults to "" (volume's root).
subPath string ​mountPropagation string ​
mountPropagation determines how mounts are propagated from the host
to container and the other way around.
When not set, MountPropagationNone is used.
This field is beta in 1.10.
mountPropagation string ​subPathExpr string ​
Expanded path within the volume from which the container's volume should be mounted.
Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
Defaults to "" (volume's root).
SubPathExpr and SubPath are mutually exclusive.
subPathExpr string ​enableServiceLinks boolean true ​
EnableServiceLinks for the StatefulSet pod
enableServiceLinks boolean true ​annotations object {} ​
Annotations are extra annotations for this resource.
annotations object {} ​labels object {} ​
Labels are extra labels for this resource.
labels object {} ​pods object ​
Additional labels or annotations for the statefulSet pods.
pods object ​annotations object {} ​
Annotations are extra annotations for this resource.
annotations object {} ​labels object {} ​
Labels are extra labels for this resource.
labels object {} ​image object ​
Image is the image for the controlPlane statefulSet container
It defaults to the vCluster pro repository that includes the optional pro modules that are turned off by default.
If you still want to use the pure OSS build, set the repository to 'loft-sh/vcluster-oss'.
image object ​registry string ghcr.io ​
Registry is the registry of the container image, e.g. my-registry.com or ghcr.io. This setting can be globally
overridden via the controlPlane.advanced.defaultImageRegistry option. Empty means docker hub.
registry string ghcr.io ​repository string loft-sh/vcluster-pro ​
Repository is the repository of the container image, e.g. my-repo/my-image
repository string loft-sh/vcluster-pro ​tag string ​
Tag is the tag of the container image, and is the default version.
tag string ​imagePullPolicy string ​
ImagePullPolicy is the policy how to pull the image.
imagePullPolicy string ​workingDir string ​
WorkingDir specifies in what folder the main process should get started.
workingDir string ​command string[] [] ​
Command allows you to override the main command.
command string[] [] ​args string[] [] ​
Args allows you to override the main arguments.
args string[] [] ​env object[] [] ​
Env are additional environment variables for the statefulSet container.
env object[] [] ​dnsPolicy string ​
Set DNS policy for the pod.
dnsPolicy string ​dnsConfig object ​
Specifies the DNS parameters of a pod.
dnsConfig object ​nameservers string[] ​
A list of DNS name server IP addresses.
This will be appended to the base nameservers generated from DNSPolicy.
Duplicated nameservers will be removed.
nameservers string[] ​searches string[] ​
A list of DNS search domains for host-name lookup.
This will be appended to the base search paths generated from DNSPolicy.
Duplicated search paths will be removed.
searches string[] ​initContainers object[] [] ​
InitContainers are additional init containers for the statefulSet.
initContainers object[] [] ​sidecarContainers object[] [] ​
SidecarContainers are additional sidecar containers for the statefulSet.
sidecarContainers object[] [] ​hostAliases object[] ​
HostAliases allows you to add custom entries to the /etc/hosts file of each Pod created.
hostAliases object[] ​ip string ​
ip string ​hostnames string[] ​
hostnames string[] ​runtimeClassName string ​
RuntimeClassName is the runtime class to set for the statefulSet pods.
runtimeClassName string ​