Pods
By default, this is enabled.
Sync all Pod resources, including ephemeral containers, from the virtual cluster to the host cluster.
Automatically apply tolerations to all pods synced by vCluster​
Kubernetes has a concept of Taints and Tolerations, which is used for controlling scheduling.
If you have a use case that requires vCluster to sync all pods and automatically set a toleration on those pods, then you can achieve this with the enforceTolerations
option. You can pass multiple toleration expressions, and the syncer adds them to every new pod that vCluster syncs.
sync:
toHost:
pods:
enabled: true
enforceTolerations:
- key: "example-key"
operator: "Equal"
value: "example-value"
effect: "NoSchedule"
- key: "another-key"
operator: "Exists"
effect: "PreferNoSchedule"
vCluster does not support setting the tolerationSeconds
field of a toleration. If your use case requires this, open an issue in the vCluster repo on GitHub.
Replace container images when pods are synced​
If certain images used within the virtual cluster are not accessible in the host cluster due to registry restrictions or security policies, translateImage
can map these to equivalent, permitted images in the host cluster's registry.
sync:
toHost:
pods:
enabled: true
translateImage:
"virtualcluster/image:tag": "hostcluster/alternative-image:tag"
Use secrets for ServiceAccount tokens​
A host Pod requires a ServiceAccount token to communicate with the virtual clusters API. If you don't want to create these secrets in the host cluster, disable this option. vCluster then adds annotations to the pods.
Config reference​
Disabling the syncing of this resource could cause the vCluster to not work properly.
pods
required object pro​
Pods defines if pods created within the virtual cluster should get synced to the host cluster.
pods
required object pro​enabled
required boolean true pro​
Enabled defines if pod syncing should be enabled.
enabled
required boolean true pro​translateImage
required object {} pro​
TranslateImage maps an image to another image that should be used instead. For example this can be used to rewrite
a certain image that is used within the virtual cluster to be another image on the host cluster
translateImage
required object {} pro​enforceTolerations
required string[] [] pro​
EnforceTolerations will add the specified tolerations to all pods synced by the virtual cluster.
enforceTolerations
required string[] [] pro​useSecretsForSATokens
required boolean false pro​
UseSecretsForSATokens will use secrets to save the generated service account tokens by virtual cluster instead of using a
pod annotation.
useSecretsForSATokens
required boolean false pro​rewriteHosts
required object pro​
RewriteHosts is a special option needed to rewrite statefulset containers to allow the correct FQDN. virtual cluster will add
a small container to each stateful set pod that will initially rewrite the /etc/hosts file to match the FQDN expected by
the virtual cluster.
rewriteHosts
required object pro​enabled
required boolean true pro​
Enabled specifies if rewriting stateful set pods should be enabled.
enabled
required boolean true pro​initContainer
required object pro​
InitContainer holds extra options for the init container used by vCluster to rewrite the FQDN for stateful set pods.
initContainer
required object pro​translate
required object[] pro​
Translate the patch according to the given patches.
translate
required object[] pro​path
required string pro​
Path is the path within the patch to target. If the path is not found within the patch, the patch is not applied.
path
required string pro​expression
required object pro​
Expression transforms the value according to the given JavaScript expression.
expression
required object pro​reference
required object pro​
Reference rewrites the value value according to the name.
reference
required object pro​apiVersion
required string pro​
APIVersion is the apiVersion of the referenced object.
apiVersion
required string pro​kind
required string pro​
Kind is the kind of the referenced object.
kind
required string pro​namePath
required string pro​
NamePath is the optional path to the reference name within the object. If omitted namePath equals to the
translate patch path.
namePath
required string pro​namespacePath
required string pro​
NamespacePath is the optional path to the reference namespace within the object. If omitted namespacePath equals to the
metadata.namespace path of the object.
namespacePath
required string pro​