Skip to main content

Use API

The vCluster.Pro management API is a Kubernetes API server that only serves virtual resources (not persisted in etcd) that facilitate interaction with vCluster.Pro. These resources are primarily used by the vCluster.Pro UI and CLI to change state in the Kubernetes cluster where vCluster.Pro is installed in, without the need to have cluster wide access.

In order to access the vCluster.Pro management api, you'll need a vCluster.Pro access key. See access keys for more information how to create a new access key.

After you have obtained an access key, login into vCluster.Pro and connect to the management API:

vcluster pro login [domain] --access-key=[ACCESS_KEY]

# Retrieve management API kube-context afterwards:
loft use management
danger

The vCluster.Pro management API does only support resources in the API group management.loft.sh and you won't be able to query any pods, namespaces or other kubernetes resources from it.

To view what resources are available in the management API Kubernetes server, you can take a look at the API reference.

Optional: Connect to the Kubernetes Cluster vCluster.Pro is installed in

Since the vCluster.Pro API server doesn't contain resources such as pods, services etc., some tools get confused and won't work with the vCluster.Pro API server directly (such as ArgoCD). Instead of using loft use management to access the resources, you can run the following command instead:

# Get a context to the cluster where loft is installed in instead
loft use cluster loft-cluster

# You can also query the management.loft.sh resources here through kubectl
kubectl get users.management.loft.sh

# Other resources also exist here
kubectl get pods

The main difference between this approach and loft use management is that all requests are routed through an actual Kubernetes cluster, which can be wanted if other resources are needed, but also expose all APIs to the requester, which is why we recommend to use loft use management if possible.