Skip to main content

Authentication

Access keys​

Access keys allow you to authenticate with the platform API endpoints and the vCluster CLI in non-interactive environments, for example, in CI/CD pipelines.

Create an access key​

  1. Go to the Profile view using the menu on the left

  2. Switch to the Access Keys tab

  3. Click the button to create a new access key

  4. In the drawer that appears on the right, use the field Display Name to specify a Name for your access key

  5. OPTIONAL: Expand the Limit Access Key Scope section to specify which clusters, namespaces and virtual clusters this access key can be used for

  6. On the very bottom, click on the button to create this access key

Use access keys​

Log in using the CLI​

You can use an access key to log into the platform from non-interactive environments:

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

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

# Retrieve users
kubectl get users

Manually create kube config​

Optionally, you can manually create your kube config by first generating an access key and then using the following template:

my-kube-config.yaml
apiVersion: v1
kind: Config
clusters:
- cluster:
server: https://$LOFT_URL/kubernetes/management
# Optional: if the server uses an insecure certificate
# insecure-skip-tls-verify: true
name: loft
contexts:
- context:
cluster: loft
user: loft
name: loft
current-context: loft
users:
- name: loft
user:
token: $ACCESS_KEY

Replace the following placeholders:

  • $LOFT_URL: the loft host you connect to
  • $ACCESS_KEY: the access key

Save the modified template as my-kube-config.yaml.

You can access your virtual cluster using the newly created kube config file:

KUBECONFIG=my-kube-config.yaml kubectl get users