Cobra Forum

Plesk Panel => Web Application => Topic started by: Suhitha on Sep 10, 2025, 01:43 AM

Title: How to Retrieve the Cluster Configuration for Vultr Kubernetes Engine Cluster
Post by: Suhitha on Sep 10, 2025, 01:43 AM
Question: How to Retrieve the Cluster Configuration for Vultr Kubernetes Engine Cluster


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

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.


Vultr API

1.Send a GET request to the List all Kubernetes Clusters endpoint and note the target VKE cluster's ID.

[color=blue]console[/color]


$ 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.

[color=blue]console[/color]


$ curl "https://api.vultr.com/v2/kubernetes/clusters/{cluster-id}/config" \
    -X GET \
    -H "Authorization: Bearer ${VULTR_API_KEY}" \
    -o kubeconfig.yaml


Vultr CLI

1.List the available VKE clusters in your Vultr account and note the target VKE cluster's ID.

[color=blue]console[/color]


$ vultr-cli kubernetes list --summarize

2.Retrieve the VKE cluster configuration file.

[color=blue]console[/color]


$ vultr-cli kubernetes config <cluster-id> --output-file "<your-path>"


Terraform

1.Use the vultr_kubernetes data source to read an existing cluster and output its kubeconfig.

[color=blue]terraform[/color]


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:

[color=blue]yaml[/color]


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