Skip to main content

Custom Resources


Pro Feature

This feature is available in the vCluster Pro tier. Contact us for more details and to start a trial.

vCluster allows you to sync custom resources from the host cluster to the virtual cluster. Resources will only be read by vCluster and then synced in read-only mode into the vCluster. vCluster will copy the CRD itself in the beginning from the host to the virtual cluster and then start syncing the resources into the vCluster. This is especially helpful if you want to show certain resources inside the vCluster, such as ClusterIssuers (for cert-manager) or ClusterStores (for external-secrets). If you are looking to sync resources from the vCluster to the host cluster, see syncing custom resources to the host cluster

Only Cluster-Scoped Resource

This feature currently only works for cluster-scoped resources only.

No need to configure RBAC

vCluster will automatically add the required cluster RBAC permissions for retrieving the custom resource definition and syncing the resources from the host to the virtual cluster.

Example​

To configure vCluster to sync ClusterIssuers from the host cluster (from cert-manager):

sync:
fromHost:
customResources:
clusterissuers.cert-manager.io:
enabled: true
scope: Cluster

Config reference​

customResources required {key: object} pro​

CustomResources defines what custom resources should get synced read-only to the virtual cluster from the host cluster. vCluster will automatically add any required RBAC to the vCluster cluster role.

enabled required boolean pro​

Enabled defines if this option should be enabled.

scope required string pro​

Scope defines the scope of the resource

patches required object[] pro​

Patches patch the resource according to the provided specification.

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.

expression required string pro​

Expression transforms the value according to the given JavaScript expression.

reverseExpression required string pro​

ReverseExpression transforms the value according to the given JavaScript expression.

reference required object pro​

Reference treats the path value as a reference to another object and will rewrite it based on the chosen mode automatically. In single-namespace mode this will translate the name to "vxxxxxxxxx" to avoid conflicts with other names, in multi-namespace mode this will not translate the name.

apiVersion required string pro​

APIVersion is the apiVersion of the referenced object.

apiVersionPath required string pro​

APIVersionPath is optional relative path to use to determine the kind. If APIVersionPath is not found, will fallback to apiVersion.

kind required string pro​

Kind is the kind of the referenced object.

kindPath required string pro​

KindPath is the optional relative path to use to determine the kind. If KindPath is not found, will fallback to kind.

namePath required string pro​

NamePath is the optional relative path to the reference name within the object.

namespacePath required string pro​

NamespacePath is the optional relative path to the reference namespace within the object. If omitted or not found, namespacePath equals to the metadata.namespace path of the object.

labels required object pro​

Labels treats the path value as a labels selector.