StatefulSet
The vCluster control plane is deployed as a StatefulSet, since vCluster requires a PersistentVolume resource to store data across restarts. When you configure statefulSet.persistence.volumeClaim.enabled: false
or you don't configure statefulSet.persistence.volumeClaimTemplates
, vCluster is deployed as a Deployment
.
High availability​
- The
highAvailability
settings let you run more than one pod for the vCluster control plane, with one running as the leader. - If the leader crashes, is unhealthy, or restarts, more pods take over leadership, depending on the number of replicas.
- Adjusting the leaseDuration / renewDeadline / retryPeriod changes the leader election behavior (how often a leader is renewed & retries when it cannot be renewed)
Scheduling​
scheduling
configures various scheduler behavior for different purposes. Examples of each follow:
nodeSelector
: Matches labels on nodes to make the scheduler "prefer" scheduling the virtual cluster pods on certain nodes. Do this to:- Target nodes in a region.
- Target a specific architecture or machine class.
affinity
: Value can be affinity (attract the pod) or anti-affinity (repel the pod).- Use anti-affinity to spread pods away from each other. A common technique is to make virtual cluster pods repel each other so that they are not scheduled on the same nodes. This increases resiliency in the event a node is scaled down or replaced by a cloud provider.
- Use affinity to group certain pods together to reduce network latency for critical services
tolerations
: Another method of influencing where the scheduler places pods. A common use is to "taint" nodes for non-virtual-cluster workloads and make virtual cluster workloads "tolerate" the taint. This results in separating critical apps from the more ephemeral vCluster instances.priorityClassName
: See Pod Priority and Preemption.podManagementPolicy
: See Pod Management Policies.topologySpreadConstraints
: See Pod Topology Spread Constraints.- Similar to podAffinity & podAntiAffinity in some ways. See Comparison with podAffinity and podAntiAffinity.
Re-using existing PersistenceVolumeClaim​
It is possible to pre-provision a PersistenceVolumeClaim, and then configure vCluster to use it.
To do that, set 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: A purely open-source build of vCluster
- loft-sh/vcluster: Deprecated. Use
loft-sh/vcluster-oss
as a replacement.
Config reference​
statefulSet
required object pro​
StatefulSet defines options for vCluster statefulSet deployed by Helm.
statefulSet
required object pro​highAvailability
required object pro​
HighAvailability holds options related to high availability.
highAvailability
required object pro​replicas
required integer 1 pro​
Replicas is the amount of replicas to use for the statefulSet.
replicas
required integer 1 pro​leaseDuration
required integer 60 pro​
LeaseDuration is the time to lease for the leader.
leaseDuration
required integer 60 pro​renewDeadline
required integer 40 pro​
RenewDeadline is the deadline to renew a lease for the leader.
renewDeadline
required integer 40 pro​retryPeriod
required integer 15 pro​
RetryPeriod is the time until a replica will retry to get a lease.
retryPeriod
required integer 15 pro​resources
required object pro​
Resources are the resource requests and limits for the statefulSet container.
resources
required object pro​scheduling
required object pro​
Scheduling holds options related to scheduling.
scheduling
required object pro​nodeSelector
required object {} pro​
NodeSelector is the node selector to apply to the pod.
nodeSelector
required object {} pro​affinity
required object {} pro​
Affinity is the affinity to apply to the pod.
affinity
required object {} pro​tolerations
required object[] [] pro​
Tolerations are the tolerations to apply to the pod.
tolerations
required object[] [] pro​priorityClassName
required string pro​
PriorityClassName is the priority class name for the the pod.
priorityClassName
required string pro​podManagementPolicy
required string Parallel pro​
PodManagementPolicy is the statefulSet pod management policy.
podManagementPolicy
required string Parallel pro​topologySpreadConstraints
required object[] [] pro​
TopologySpreadConstraints are the topology spread constraints for the pod.
topologySpreadConstraints
required object[] [] pro​security
required object pro​
Security defines pod or container security context.
security
required object pro​podSecurityContext
required object {} pro​
PodSecurityContext specifies security context options on the pod level.
podSecurityContext
required object {} pro​containerSecurityContext
required object map[allowPrivilegeEscalation:false runAsGroup:0 runAsUser:0] pro​
ContainerSecurityContext specifies security context options on the container level.
containerSecurityContext
required object map[allowPrivilegeEscalation:false runAsGroup:0 runAsUser:0] pro​probes
required object pro​
Probes enables or disables the main container probes.
probes
required object pro​