Si se te solicita, haz clic en Abrir para permitir que Cloud Code abra la consola deGoogle Cloud .
En la Google Cloud consola, elige las opciones de configuración que quieras personalizar y, luego, haz clic en Crear.
Después de crear el clúster, en Cloud Code, haz clic en el ícono
Refresh.
Después de que el nombre de tu clúster nuevo aparezca en la lista, haz clic en el nombre del clúster. El clúster nuevo se agrega a tu kubeconfig y se establece como el contexto
predeterminado.
Sugerencia: Para crear un clúster de Kubernetes con la paleta de comandos, iníciala (presiona Ctrl/Cmd+Shift+P o haz clic en Ver > Paleta de comandos) y, luego, ejecuta el comando Cloud Code: Crear clúster de GKE.
Cómo trabajar con un clúster de GKE existente
Si tienes un clúster de GKE Standard o Autopilot existente, puedes configurarlo como clúster activo y trabajar con él con
Cloud Code.
Haz clic en Cloud Code y, luego, expande el explorador de Kubernetes.
Haz clic en agregarAgregar un clúster a KubeConfig.
Haz clic en Google Kubernetes Engine.
Haz clic en el nombre de tu clúster. Se agregará tu clúster a KubeConfig.
Cómo establecer un clúster como el contexto predeterminado
El clúster activo es el clúster en el que se implementa tu aplicación de forma predeterminada.
Haz clic en Cloud Code y, luego, expande el explorador de Kubernetes.
Haz clic con el botón derecho en un clúster y, luego, en Configurar como clúster activo.
Ejecuta una aplicación en GKE
Para ejecutar o depurar una aplicación en GKE, deberás definir el repositorio de imágenes de contenedor de tu proyecto.
Después de quitar un clúster de tu KubeConfig, este no estará disponible para implementarse.
Haz clic en Cloud Code y, luego, expande el explorador de Kubernetes.
Haz clic con el botón derecho en un clúster y, luego, en Quitar contexto del clúster.
Abre una terminal interactiva en un contenedor
Haz clic en Cloud Code y, luego, expande el explorador de Kubernetes.
Expande tu clúster de Minikube, expande Pods y, luego, expande
Contenedores.
Haz clic con el botón derecho en un contenedor y, luego, en Get Terminal.
Abre una dirección IP externa
Haz clic en Cloud Code y, luego, expande el explorador de Kubernetes.
Expande tu clúster de Minikube y, luego, Servicios.
Expande IPs externas, haz clic con el botón derecho en una dirección IP y, luego, en Abrir dirección.
Haz clic en Abrir.
Crea y agrega un clúster desde otro proveedor de servicios en la nube
Si usas un clúster local o uno de otro proveedor, como
Azure o AWS, usa las herramientas del proveedor para crear el clúster y agregarlo a
tu KubeConfig.
[[["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: 2025-09-04 (UTC)"],[[["\u003cp\u003eCloud Code allows you to create and manage Kubernetes clusters within Google Kubernetes Engine (GKE), supporting both Standard and Autopilot modes.\u003c/p\u003e\n"],["\u003cp\u003eYou can easily add existing GKE clusters to your KubeConfig within Cloud Code and set any cluster as the default context for application deployment.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code provides tools to interact with your cluster, such as opening an interactive terminal to a container and opening an external IP address.\u003c/p\u003e\n"],["\u003cp\u003eYou are able to remove a cluster from your KubeConfig, and create and add a cluster from other providers like Azure or AWS using their tools.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code enhances development with features such as debugging, file sync, hot reloading, and supports managing multiple KubeConfig files and developing microservice applications.\u003c/p\u003e\n"]]],[],null,["# Create and configure a GKE cluster in Cloud Code for VS Code\n\nWith Cloud Code, you can create a Kubernetes cluster with\nGoogle Kubernetes Engine (GKE).\n| **Note:** For developing and testing an app, create and run on a non-production cluster. For changes that will be rolled out to production, use an [automated CI/CD workflow](/docs/ci-cd).\n\nCreate a GKE cluster and add it to your KubeConfig\n--------------------------------------------------\n\nTo create a cluster:\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Click add **Add a Cluster to the KubeConfig**.\n3. Select **Google Kubernetes Engine** and then select **Yes** to enable the Google Kubernetes Engine API in your project.\n4. Choose **Standard** or **Autopilot** . For more information, see [Comparing Autopilot and Standard modes](/kubernetes-engine/docs/concepts/autopilot-overview#comparison).\n5. If prompted, click **Open** to permit Cloud Code to open the Google Cloud console.\n6. In Google Cloud console, choose any configuration options that you want to customize and then click **Create**.\n7. After the cluster is created, in Cloud Code, click the **Refresh** icon.\n8. After the name of your new cluster appears in the list, click the cluster name. Your new cluster is added to your kubeconfig and set as the default context.\n\n**Tip:** To create a Kubernetes cluster using the command palette, launch the\ncommand palette (press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e\n**Command Palette** ) and then run the **Cloud Code: Create GKE cluster**\ncommand.\n\nWork with an existing GKE cluster\n---------------------------------\n\nIf you have an existing Standard or Autopilot GKE cluster, you\ncan set it as your active cluster and work with it using\nCloud Code.\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Click add **Add a Cluster to the KubeConfig**.\n3. Click **Google Kubernetes Engine**.\n4. Click your cluster name. Your cluster is added to the KubeConfig.\n\nSet a cluster as the default context\n------------------------------------\n\nThe active cluster is the cluster that your application is deployed to by\ndefault.\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Right-click a cluster and then click **Set as Active Cluster**.\n\nRun an application on GKE\n-------------------------\n\nTo run or debug an application on GKE, you'll need to define\nthe container image repository for your project.\n\nWhen attempting to debug, you may be prompted to [authenticate your credentials\nto run and debug an application\nlocally](/code/docs/vscode/install#authenticate_credentials_for_debugging_applications_locally).\n\nTo learn more, see\n[get started with Cloud Code for Kubernetes](/code/docs/vscode/get-started-k8s#run_your_application)\n\n\nRemove a cluster from your KubeConfig\n-------------------------------------\n\nAfter you remove a cluster from your KubeConfig, the cluster is not available\nto deploy to.\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Right-click a cluster and then click **Remove Context Under Cluster**.\n\nOpen an interactive terminal to a container\n-------------------------------------------\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Expand your minikube cluster, expand **Pods** , and then expand **Containers**.\n3. Right-click a container and then click **Get Terminal**.\n\nOpen an external IP address\n---------------------------\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Expand your minikube cluster and then expand **Services**.\n3. Expand **External IPs** , right-click an IP address, and then click **Open Address**.\n4. Click **Open**.\n\nCreate and add a cluster from another cloud provider\n----------------------------------------------------\n\nIf you're using an on-premises cluster or a cluster from another provider such\nas Azure or AWS, use the provider's tools to create the cluster and add it to\nyour KubeConfig.\n\nWhat's next\n-----------\n\n- [Organize your cluster access using kubeconfig files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/).\n- Learn how to add, delete or switch between your [kubeconfig files in Cloud Code](/code/docs/vscode/kubeconfigs).\n- [Develop and debug parts of a microservice application](/code/docs/vscode/speed-up-k8s-development#develop_microservices_applications_using_skaffold_configurations) using Skaffold.\n- Use [file sync and hot reloading](/code/docs/vscode/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- [Debug your application in Cloud Code](/code/docs/vscode/debug).\n\nGet Support\n-----------\n\nTo send feedback, report issues on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-vscode/issues), or ask a question on [Stack Overflow](https://stackoverflow.com/questions/ask?tags=cloud-code-vscode)."]]