Vultr DocsLatest Content


How to Retrieve the Cluster Configuration for Vultr Kubernetes Engine Cluster

Updated on 10 September, 2025

Learn how to obtain your Vultr Kubernetes Engine (VKE) cluster configuration for kubectl access and management


Retrieving a Vultr Kubernetes Engine (VKE) cluster configuration allows you to access essential details about your Kubernetes cluster, including API endpoints, authentication credentials, and resource specifications. This process is crucial for managing and interacting with your VKE cluster effectively. Vultr Kubernetes Engine provides straightforward methods to retrieve these configurations, ensuring you have the necessary information to operate and scale your VKE cluster efficiently.

Follow this guide to retrieve the Vultr Kubernetes Engine cluster configuration from your Vultr account using the Vultr Customer Portal, API, CLI, or Terraform.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  • Terraform
  1. Navigate to Products and click Kubernetes.
  2. Click your target VKE cluster to open its management page.
  3. In the top-right corner, click Download Configuration.
  1. Send a GET request to the List all Kubernetes Clusters endpoint and note the target VKE cluster's ID.

    console
    $ curl "https://api.vultr.com/v2/kubernetes/clusters" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a GET request to the Get Kubernetes Cluster Kubeconfig endpoint to retrieve the config file for the target VKE cluster.

    console
    $ curl "https://api.vultr.com/v2/kubernetes/clusters/{cluster-id}/config" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -o kubeconfig.yaml
    
  1. List the available VKE clusters in your Vultr account and note the target VKE cluster's ID.

    console
    $ vultr-cli kubernetes list --summarize
    
  2. Retrieve the VKE cluster configuration file.

    console
    $ vultr-cli kubernetes config <cluster-id> --output-file "<your-path>"
    
  1. Use the vultr_kubernetes data source to read an existing cluster and output its kubeconfig.

    terraform
    data "vultr_kubernetes" "cluster" {
        # identify the cluster by id or label
        cluster_id = var.cluster_id
    }
    
    output "kubeconfig" {
        value = data.vultr_kubernetes.cluster.kubeconfig
    }
    
  2. Run terraform apply to fetch the kubeconfig.

    Example output:

    yaml
    Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
    
    Outputs:
    
    kubeconfig = <<EOT
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data: REDACTED
        server: https://vke-abc123.us-east-1.vultr-k8s.com:6443
    name: vke-abc123
    contexts:
    - context:
        cluster: vke-abc123
        user: vke-abc123-user
    name: vke-abc123
    current-context: vke-abc123
    kind: Config
    preferences: {}
    users:
    - name: vke-abc123-user
    user:
        token: REDACTED
    EOT
    

Comments

No comments yet.