Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Ce document explique comment installer la CLI Kf.
Vous installez généralement la CLI Kf lorsque vous avez déjà accès à un cluster GKE exécutant Kf.
Vous pouvez donc commencer à utiliser les commandes Kf sans avoir à créer votre propre cluster GKE.
Après avoir installé la CLI Kf et vous être connecté au cluster Kf, vous pouvez exécuter l'une des commandes Kf.
Pour obtenir la liste complète des commandes Kf disponibles, consultez la documentation de référence des commandes Kf.
Avant de commencer
Pour utiliser la CLI Kf, vous devez avoir accès à un cluster GKE exécutant une installation Kf complète.
Cela signifie que vous avez exécuté la commande suivante pour vous connecter au cluster :
Cette commande installe la CLI Kf pour tous les utilisateurs du système. Suivez les instructions de l'onglet Cloud Shell pour l'installer juste pour vous.
kf sera installé sur votre instance Cloud Shell si vous utilisez bash, et vous devrez peut-être modifier les instructions pour les autres interfaces système.
Cette commande télécharge kf dans le répertoire actuel. Si vous souhaitez l'appeler depuis un emplacement autre que le répertoire actuel, ajoutez-le au chemin d'accès.
Si vous disposez déjà d'une installation de la CLI Kf, vous pouvez utiliser la procédure suivante pour la mettre à niveau vers la version actuelle.
Installez la CLI :
Linux
Cette commande installe la CLI Kf pour tous les utilisateurs du système. Suivez les instructions de l'onglet Cloud Shell pour l'installer juste pour vous.
kf sera installé sur votre instance Cloud Shell si vous utilisez bash, et vous devrez peut-être modifier les instructions pour les autres interfaces système.
kf sera téléchargé dans le répertoire actuel. Si vous souhaitez l'appeler depuis un emplacement autre que le répertoire actuel, ajoutez-le au chemin d'accès.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Install the Kf CLI\n\nThis document describes how to install the Kf CLI.\nYou typically install the Kf CLI when you already\nhave access to a GKE cluster running Kf.\nThat means that you can get started using Kf commands without\nhaving to first create your own GKE cluster.\n\nAfter installing the Kf CLI and connecting to the\nKf cluster, you can run any of the Kf commands.\nFor a complete list of the available Kf commands, see the\n[Kf command reference](/migrate/kf/docs/2.11/cli).\n\nBefore you begin\n----------------\n\nBefore you can use the Kf CLI, you must have\naccess to a GKE cluster running a full Kf installation.\nThat means that you have run the following command to connect to the cluster: \n\n```\ngcloud container clusters get-credentials CLUSTER_NAME \\\n --project=CLUSTER_PROJECT_ID \\\n --zone=CLUSTER_LOCATION\n```\n\nInstall the CLI\n---------------\n\n1. Install the Kf CLI:\n\n ### Linux\n\n This command installs the Kf CLI for all users on the system. Follow the\n instructions in the Cloud Shell tab to install it just for yourself. \n\n gcloud storage cp gs://kf-releases/v2.11.28/kf-linux /tmp/kf\n chmod a+x /tmp/kf\n sudo mv /tmp/kf /usr/local/bin/kf\n\n ### Mac\n\n This command installs `kf` for all users on the system. \n\n gcloud storage cp gs://kf-releases/v2.11.28/kf-darwin /tmp/kf\n chmod a+x /tmp/kf\n sudo mv /tmp/kf /usr/local/bin/kf\n\n ### Cloud Shell\n\n This command installs `kf` on your Cloud Shell instance if you use `bash`,\n the instructions may need to be modified for other shells. \n\n mkdir -p ~/bin\n gcloud storage cp gs://kf-releases/v2.11.28/kf-linux ~/bin/kf\n chmod a+x ~/bin/kf\n echo \"export PATH=$HOME/bin:$PATH\" \u003e\u003e ~/.bashrc\n source ~/.bashrc\n\n ### Windows\n\n This command downloads `kf` to current directory. Add it to the path if you\n want to call if from anywhere other than the current directory. \n\n gcloud storage cp gs://kf-releases/v2.11.28/kf-windows.exe kf.exe\n\nUpgrade the CLI\n---------------\n\nIf you have an existing installation of the Kf CLI,\nthen you can use the following procedure to upgrade it to the current version.\n\n1. Install the CLI:\n\n ### Linux\n\n This command installs the Kf CLI for all users on the system. Follow the\n instructions in the Cloud Shell tab to install it just for yourself. \n\n gcloud storage cp gs://kf-releases/v2.11.28/kf-linux /tmp/kf\n chmod a+x /tmp/kf\n sudo mv /tmp/kf /usr/local/bin/kf\n\n ### Mac\n\n This command installs `kf` for all users on the system. \n\n gcloud storage cp gs://kf-releases/v2.11.28/kf-darwin /tmp/kf\n chmod a+x /tmp/kf\n sudo mv /tmp/kf /usr/local/bin/kf\n\n ### Cloud Shell\n\n This command installs `kf` on your Cloud Shell instance if you use `bash`,\n the instructions may need to be modified for other shells. \n\n mkdir -p ~/bin\n gcloud storage cp gs://kf-releases/v2.11.28/kf-linux ~/bin/kf\n chmod a+x ~/bin/kf\n echo \"export PATH=$HOME/bin:$PATH\" \u003e\u003e ~/.bashrc\n source ~/.bashrc\n\n ### Windows\n\n This downloads `kf` to current directory. Add it to the path if you\n want to call if from anywhere other than the current directory. \n\n gcloud storage cp gs://kf-releases/v2.11.28/kf-windows.exe kf.exe\n\n2. Validate the Kf CLI and\n Kf server versions match:\n\n - The CLI version is listed under `Kf Client`.\n - The Kf server version is listed under `kf[\"app.kubernetes.io/version\"]`.\n\n $ kf debug\n ...\n Version:\n Kf Client: v2.11.28\n Server version: v1.31.1-gke.2105000\n kf\\[\"app.kubernetes.io/version\"\\]: v2.11.28\n ..."]]