Downloading the Kubeconfig File
You can download the kubeconfig file of a cluster.
Downloading the Kubeconfig File Using Cockpit
-
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. -
Click the Clusters tab.
The list of your clusters created within the project appears. -
Hover over the row of the cluster you want to download the kubeconfig file and click the
action menu.
A drop-down menu appears. -
Click
Download Kubeconfig.
The DOWNLOAD KUBECONFIG dialog box appears. -
In the Kubeconfig validity period field, specify the desired Time To Live (TTL) for the certificate.
-
(optional) In the User field, type the name of the user.
-
(optional) In the Group field, type the name of the group.
-
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.
$ 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.
-
-
{
"ResponseContext": {
"RequestId": "string"
},
"Cluster": {
"request_id": "string",
"data": {
"kubeconfig": "string"
}
}
}