Usa esta página para instalar los componentes predeterminados de Knative serving en tus clústeres de GKE en Google Cloud con la siguiente configuración:
Knative serving en Google Cloud está configurado para clústeres públicos de forma predeterminada.
Las métricas de Cloud Monitoring para GKE Enterprise en los clústeres de Google Cloud están habilitadas de forma predeterminada.
Antes de comenzar
Para instalar Knative serving en clústeres privados en Google Cloud, debes realizar una instalación personalizada.
Si Knative serving está instalada en tu clúster, debes asegurarte de que el “complemento de GKE” no exista antes de realizar estos pasos de instalación del componente de flota. Si tienes instalado el "complemento", debes seguir los pasos para actualizar a las flotas de GKE Enterprise.
Verifica si el "complemento de GKE" está instalado.
Para verificar si la instalación de Knative serving es el “complemento de GKE”, ejecuta el siguiente comando:
CLUSTER_LOCATION por la ubicación en la que se encuentra el clúster.
PROJECT_ID por el ID del proyecto de Google Cloud.
Resultados:
“Complemento de GKE” no instalado:
No se muestra nada en tu terminal si nunca se instaló el complemento.
Se muestra disabled=true si el complemento se desinstaló antes.
"Complemento de GKE" está instalado: Si el complemento está instalado en tu clúster, los detalles de configuración del complemento se muestran.
Ejemplo: loadBalancerType=LOAD_BALANCER_TYPE_EXTERNAL
Ejemplo:
En el siguiente ejemplo, se muestra que Knative serving se instaló en el clúster my-addon-cluster a través del “Complemento de GKE”, que está configurado para controlar tráfico externo:
Haz clic en el nombre de tu clúster para abrir el panel de detalles.
Ejecuta este comando para verificar si puedes ver los detalles de la versión de Knative serving:
kubectl get namespace knative-serving -o 'go-template={{index .metadata.labels "serving.knative.dev/release"}}'
Verifica que todas las implementaciones específicas de Knative serving estén en estado de ejecución en los espacios de nombres knative-serving y appdevexperience.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2024-09-01 (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)."]]