Downloading the Kubeconfig File

You can download the kubeconfig file of a cluster.

Downloading the Kubeconfig File Using Cockpit

  1. In the Projects dashboard, click the name of the project for which you want to download the cluster kubeconfig file.
    The project details panel appears.

  2. Click the Clusters tab.
    The list of your clusters created within the project appears.

  3. Hover over the row of the cluster you want to download the kubeconfig file and click the IconDotMenu action menu.
    A drop-down menu appears.

  4. Click IconDownload Download Kubeconfig.
    The DOWNLOAD KUBECONFIG dialog box appears.

  5. In the Kubeconfig validity period field, specify the desired Time To Live (TTL) for the certificate.

  6. (optional) In the User field, type the name of the user.

  7. (optional) In the Group field, type the name of the group.

  8. Click Download.
    The kubeconfig file is downloaded.

    Store your file in a secure directory as it contains sensitive information.

Downloading the Kubeconfig File Using octl

The GetKubeconfig command gets the kubeconfig file for a specific cluster. You can specify query parameters for the kubeconfig file.

Request sample
$ octl kube api GetKubeconfig <cluster_id> --profile "default" \
  --User "string" \
  --Group "string" \
  --Ttl "string"

This command contains the following options that you need to specify:

  • Group: (optional) The group of the kubeconfig file.

  • Ttl: (optional) The time to live (TTL) of the kubeconfig file.

  • User: (optional) The user of the kubeconfig file.

The GetKubeconfig command returns the following elements:

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the API request.

  • Cluster: The kubeconfig details associated with the cluster.

    • request_id: The ID of the API request.

    • data: The kubeconfig data for the cluster.

      • kubeconfig: The content of the kubeconfig file used to configure access to the cluster.

Result sample
{
  "ResponseContext": {
    "RequestId": "string"
  },
  "Cluster": {
    "request_id": "string",
    "data": {
      "kubeconfig": "string"
    }
  }
}

Downloading the Kubeconfig File Using OKS CLI