Se Knative Serving è installato nel cluster, devi assicurarti che
il "componente aggiuntivo GKE" non esista prima di eseguire questi
passaggi di installazione del componente del parco risorse. Se hai installato il "componente aggiuntivo", devi invece seguire i passaggi per l'upgrade ai parchi risorse GKE Enterprise.
Controlla se il "componente aggiuntivo GKE" è
installato.
Per verificare se l'installazione di Knative Serving è l'add-on GKE, esegui questo comando:
CLUSTER_LOCATION con la
posizione
in cui si trova il cluster.
PROJECT_ID con l'ID del tuo progetto Google Cloud .
Risultati:
"Componente aggiuntivo GKE" non installato:
Se il componente aggiuntivo non è mai stato installato, non viene restituito nulla al terminale.
disabled=true viene restituito se il componente aggiuntivo è stato disinstallato in precedenza.
"Componente aggiuntivo GKE" è installato: se il componente aggiuntivo è installato nel tuo cluster, vengono restituiti i dettagli di configurazione del componente aggiuntivo.
Esempio: loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL
Esempio:
Il seguente esempio mostra che Knative Serving è stato installato nel cluster my-addon-cluster tramite il "componente aggiuntivo GKE", che è configurato per gestire il traffico esterno:
Fai clic sul nome del cluster per aprire il riquadro dei dettagli.
Esegui questo comando per verificare se riesci a visualizzare i dettagli della versione di Knative serving:
kubectl get all -n knative-serving -o 'go-template={{index .metadata.labels "serving.knative.dev/release"}}'
Verifica che tutti i deployment specifici di Knative Serving siano in stato di esecuzione negli spazi dei nomi knative-serving e appdevexperience.
[[["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-04 UTC."],[],[],null,["# Installing Knative serving on Google Cloud\n\nLearn how to install Knative serving in your GKE clusters on Google Cloud. Knative serving now uses Cloud Service Mesh and GKE Enterprise fleets. [Learn what's new and changed with Knative serving\nfleet installations](/kubernetes-engine/enterprise/knative-serving/docs/install).\n\n\u003cbr /\u003e\n\nWarning: Performing the steps on this page will perform a new installation of Knative serving and irreversibly overwrite your previous non-fleet installation. Do not proceed with the following steps in your [clusters for which you previously enabled\nKnative serving](/kubernetes-engine/enterprise/knative-serving/archive/docs/setup). \n\nFor previous \"free-trial\" installations of Knative serving, you must first [upgrade Knative serving to use GKE Enterprise\nfleets](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade).\n\nUse this page to install the default components of Knative serving on\nyour GKE clusters in Google Cloud with the following configuration:\n\n- Knative serving on Google Cloud is configured for public clusters by\n default.\n\n- Cloud Monitoring metrics for GKE Enterprise on Google Cloud clusters are enabled by\n default.\n\nBefore you begin\n----------------\n\n- To install Knative serving in private clusters on Google Cloud, you must\n perform a [custom installation](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/custom).\n\n- You must ensure that you meet the\n [installation prerequisites](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/prerequisites).\n\n- If Knative serving is installed in your cluster, you must ensure that the\n \"*GKE add-on* \" does not exist before you perform these\n fleet component installation steps. If you have the \"*add-on* \" installed, you\n must instead [follow the steps for upgrading to GKE Enterprise\n fleets](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade).\n\n #### Check if the \"*GKE add-on*\" is\n installed.\n\n\n To check if your installation of Knative serving is the\n \"*GKE add-on*\", run the following command: \n\n ```bash\n gcloud container clusters describe \\\n CLUSTER_NAME \\\n --region CLUSTER_LOCATION \\\n --project PROJECT_ID --format='get(addonsConfig.cloudRunConfig)'\n ```\n\n\n Replace:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with the name of your cluster.\n - \u003cvar translate=\"no\"\u003eCLUSTER_LOCATION\u003c/var\u003e with the [location](/compute/docs/regions-zones#identifying_a_region_or_zone) where your cluster is located.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of your Google Cloud project.\n\n\n Results:\n - **\"*GKE add-on*\" not installed** :\n - Nothing is returned to your terminal if the add-on was never installed.\n - `disabled=true` is returned if the add-on was previously uninstalled.\n - **\"*GKE add-on*\" is installed** : If the add-on is installed in your cluster, the configuration details for the add-on are returned. Example: `loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL`\n\n Example:\n :\n The following example demonstrates that Knative serving was installed in the\n `my-addon-cluster` cluster through the \"*GKE add-on* \", which\n is configured to handle external traffic: \n\n ```bash\n gcloud container clusters describe my-addon-cluster \\\n --region us-central1-c --project my-gcp-project \\\n --format='get(addonsConfig.cloudRunConfig)'\n ```\n\n\n Response:\n\n ```bash\n loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL\n ```\n\n \u003cbr /\u003e\n\nInstalling Knative serving\n--------------------------\n\nTo install the default components of Knative serving:\n\n1. Enable Knative serving in your fleet:\n\n gcloud container fleet cloudrun enable --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of your Google Cloud project.\n\n For details and additional options, see the\n [gcloud container fleet cloudrun enable](/sdk/gcloud/reference/container/hub/cloudrun/enable)\n reference.\n2. Optional: Verify that the Knative serving feature component is\n enabled:\n\n ### Console\n\n View if the Knative serving component is **Enabled** in the\n Google Cloud console:\n\n [Go to Feature Manager](https://console.cloud.google.com/kubernetes/features)\n\n ### Command line\n\n View if the `appdevexperience` state is `ACTIVE`: \n\n gcloud container fleet features list --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of your Google Cloud project.\n\n For details and additional options, see the\n [gcloud container fleet features list](/sdk/gcloud/reference/container/hub/features/list)\n reference.\n\n Result: \n\n NAME STATE\n appdevexperience ACTIVE\n\n3. For each GKE Enterprise cluster where you want to install Knative serving,\n\n run the corresponding command:\n\n gcloud container fleet cloudrun apply --gke-cluster=\u003cvar translate=\"no\"\u003eCLUSTER_LOCATION\u003c/var\u003e/\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_LOCATION\u003c/var\u003e with the [region or zone](/compute/docs/regions-zones#available) in which your cluster is located.\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with the ID of your cluster or the fully qualified identifier for the cluster.\n\n For details and additional options, see the\n [gcloud container fleet cloudrun apply](/sdk/gcloud/reference/container/hub/cloudrun/apply)\n reference.\n\n \u003cbr /\u003e\n\n\n4. Verify that Knative serving has been enabled in your cluster:\n 1. Open the Google Cloud console:\u003cbr /\u003e\n\n [Go to GKE clusters](https://console.cloud.google.com/kubernetes/list/overview)\n 2. Click on the name of your cluster to open the details pane.\u003cbr /\u003e\n\n \u003cbr /\u003e\n\n 3. Run this command to check if you can see the Knative serving version details: `kubectl get all -n knative-serving -o 'go-template={{index .metadata.labels \"serving.knative.dev/release\"}}'`\n 4. Verify that all Knative serving specific deployments are in running status under `knative-serving` and `appdevexperience` namespaces.\n\nWhat's next\n-----------\n\n[Set up your installation of Knative serving](/kubernetes-engine/enterprise/knative-serving/docs/setup)."]]