Utilisez cette page pour installer les composants par défaut de Knative Serving sur vos clusters GKE dans Google Cloud avec la configuration suivante :
Knative serving sur Google Cloud est configuré par défaut pour les clusters publics.
Les métriques Cloud Monitoring pour les clusters GKE Enterprise sur Google Cloud sont activées par défaut.
Avant de commencer
Pour installer Knative serving dans des clusters privés sur Google Cloud, vous devez effectuer une installation personnalisée.
Si Knative serving est installé dans votre cluster, vous devez vous assurer que le module complémentaire GKE n'existe pas avant d'effectuer l'installation du composant de parc. Si le module complémentaire est installé, vous devez suivre les étapes de mise à niveau vers les parcs GKE Enterprise.
Vérifier si le module complémentaire GKE est installé.
Pour vérifier si votre installation de Knative serving correspond au module complémentaire GKE, exécutez la commande suivante :
CLUSTER_LOCATION par la région où se trouve votre cluster.
Remplacez PROJECT_ID par l'ID de votre projet Google Cloud .
Résultats :
Module complémentaire GKE non installé :
Aucun élément n'est renvoyé à votre terminal si le module complémentaire n'a jamais été installé.
disabled=true est renvoyé si le module complémentaire a déjà été désinstallé.
Module complémentaire GKE installé : si le module complémentaire est installé dans votre cluster, les détails de configuration du module complémentaire sont renvoyés.
Exemple : loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL
Exemple :
L'exemple suivant montre que Knative serving a été installé dans le cluster my-addon-cluster via le module complémentaire GKE, qui est configuré pour gérer le trafic externe :
Vérifiez si l'état de appdevexperience est défini sur ACTIVE :
gcloud container fleet features list --project=PROJECT_ID
Remplacez PROJECT_ID par l'ID de votre projet Google Cloud .
Pour obtenir plus d'informations et découvrir des options supplémentaires, consultez la documentation de référence de gcloud container fleet features list.
Résultat :
NAME STATEappdevexperience ACTIVE
Pour chaque cluster GKE Enterprise sur lequel vous souhaitez installer Knative serving, exécutez la commande correspondante :
Cliquez sur le nom de votre cluster pour ouvrir le volet "Détails".
Exécutez cette commande pour vérifier si vous pouvez afficher les détails de la version Knative serving :
kubectl get all -n knative-serving -o 'go-template={{index .metadata.labels "serving.knative.dev/release"}}'
Vérifiez que tous les déploiements spécifiques à Knative serving sont en cours d'exécution sous les espaces de noms knative-serving et appdevexperience.
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,["# 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)."]]