Skip to main content

Use API

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

In order to access the vCluster platform management api, you'll need a vCluster platform 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 platform and connect to the management API:

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

# Retrieve management API kube-context afterwards:
vcluster platform connect management
warning

The vCluster platform 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 platform is installed in

Since the vCluster platform API server doesn't contain resources such as pods, services etc., some tools get confused and won't work with the vCluster platform 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
vcluster platform connect 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 vcluster platform connect 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.