Télécharger le fichier kubeconfig

Vous pouvez télécharger le fichier kubeconfig d’un cluster.

Télécharger le fichier kubeconfig avec Cockpit

  1. Dans le dashboard Projets, cliquez sur le nom du projet pour lequel vous voulez télécharger le fichier kubeconfig d’un cluster.
    Le volet de détails du projet apparaît.

  2. Cliquez sur l’onglet Clusters.
    La liste de vos clusters créés dans le projet apparaît.

  3. Placez le curseur de la souris sur le rang du cluster pour lequel vous voulez télécharger le fichier kubeconfig et cliquez sur le menu IconDotMenu d’actions.
    Un menu déroulant apparaît.

  4. Cliquez sur IconDownload Télécharger kubeconfig.
    La boîte de dialogue TÉLÉCHARGER KUBECONFIG apparaît.

  5. Dans le champ Durée de validité du kubeconfig, spécifiez la durée de vie (TTL) souhaitée pour le certificat.

  6. (optionnel) Dans le champ Utilisateur, tapez le nom de l’utilisateur.

  7. (optionnel) Dans le champ Groupe, tapez le nom du groupe.

  8. Cliquez sur Télécharger.
    Le fichier kubeconfig est téléchargé.

    Votre fichier contient des informations sensibles. Conservez-le dans un répertoire sécurisé.

Télécharger le fichier kubeconfig avec octl

À ce jour, cette section est disponible en anglais uniquement.

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"
    }
  }
}

Télécharger le fichier kubeconfig avec OKS CLI