Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento descrive come installare l'interfaccia a riga di comando Kf.
In genere, l'interfaccia a riga di comando Kf viene installata quando hai già accesso a un cluster GKE su cui è in esecuzione Kf.
Ciò significa che puoi iniziare a utilizzare i comandi Kf senza dover prima creare il tuo cluster GKE.
Dopo aver installato l'interfaccia a riga di comando Kf e aver eseguito la connessione al cluster Kf, puoi eseguire qualsiasi comando Kf.
Per un elenco completo dei comandi Kf disponibili, consulta il
riferimento ai comandi Kf.
Prima di iniziare
Prima di poter utilizzare l'interfaccia a riga di comando di Kf, devi avere accesso a un cluster GKE su cui è in esecuzione un'installazione completa di Kf.
Ciò significa che hai eseguito il seguente comando per connetterti al cluster:
Esegui l'upgrade dell'interfaccia a riga di comando
Se hai già installato l'interfaccia a riga di comando Kf, puoi utilizzare la procedura riportata di seguito per eseguire l'upgrade alla versione corrente.
Installa l'interfaccia a riga di comando:
Linux
Questo comando installa la CLI di Kf per tutti gli utenti del sistema. Segui le istruzioni nella scheda Cloud Shell per installarlo solo per te.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-02 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.6/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.6.1/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.6.1/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.6.1/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.6.1/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.6.1/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.6.1/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.6.1/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.6.1/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.6.1\n Server version: v1.21.3-gke.2001\n kf\\[\"app.kubernetes.io/version\"\\]: v2.6.1\n ..."]]