Configurer un cluster GKE dans Cloud Code pour IntelliJ
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cloud Code permet de créer un cluster Kubernetes avec Google Kubernetes Engine (GKE).
.
Créer un cluster GKE et l'ajouter à votre KubeConfig
Cloud Code ouvre la console Google Cloud pour vous permettre de créer rapidement un cluster :
Pour ouvrir l'explorateur Kubernetes, cliquez sur Explorateur Kubernetes ou accédez à Outils > Cloud Code >
Kubernetes > Afficher l'explorateur de cluster.
Dans l'en-tête du volet de l'explorateur Kubernetes, cliquez sur + Connect to a GKE Cluster (Se connecter à un cluster GKE).
Choisissez Create a new GKE Cluster (Créer un cluster GKE) ou Create a new GKE Autopilot cluster (Créer un cluster GKE Autopilot). Pour savoir quel mode choisir, consultez Comparer les modes Autopilot et Standard.
Si vous y êtes invité, cliquez sur Ouvrir pour autoriser Cloud Code à ouvrir la consoleGoogle Cloud .
Dans la console Google Cloud , sélectionnez les options de configuration que vous souhaitez personnaliser, puis cliquez sur Créer.
Une fois le cluster créé, dans Cloud Code, dans l'explorateur Kubernetes, cliquez sur l'icône Actualiser.
Lorsque le nom de votre nouveau cluster apparaît dans la liste, cliquez dessus. Votre nouveau cluster est ajouté à la configuration et défini comme contexte par défaut.
Utiliser un cluster GKE existant
Si vous possédez un cluster GKE standard ou Autopilot, vous pouvez le définir comme cluster actif et l'utiliser avec Cloud Code.
Dans l'en-tête du volet de l'explorateur Kubernetes, cliquez sur + Ajouter un cluster GKE.
Cliquez sur Google Kubernetes Engine.
Cliquez sur le nom de votre cluster. Votre cluster est ajouté à KubeConfig.
Définir un cluster comme contexte par défaut
Le cluster actif est le cluster sur lequel votre application est déployée par défaut.
Dans l'explorateur Kubernetes, cliquez avec le bouton droit sur un cluster, puis cliquez sur Set as Current Context (Définir comme contexte actuel).
Exécuter une application sur GKE
Pour exécuter ou déboguer une application sur GKE, vous devez définir le dépôt d'images de conteneurs de votre projet.
Une fois que vous avez supprimé un cluster de votre KubeConfig, il n'est plus possible d'effectuer un déploiement sur ce cluster.
Dans l'explorateur Kubernetes, cliquez avec le bouton droit sur un cluster, puis cliquez sur Remove From KubeConfig (Supprimer de KubeConfig).
Créer et ajouter un cluster depuis un autre fournisseur cloud
Si vous utilisez un cluster sur site ou un cluster d'un autre fournisseur tel qu'Azure ou AWS, créez un cluster à l'aide des outils associés et ajoutez-le à votre KubeConfig.
Pour envoyer des commentaires ou signaler un problème dans votre IDE IntelliJ, accédez à Outils > Cloud Code > Aide / À propos > Envoyer des commentaires ou signaler un problème pour signaler un problème sur GitHub.
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/05 (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/05 (UTC)."],[[["\u003cp\u003eCloud Code facilitates the creation of a Kubernetes cluster using Google Kubernetes Engine (GKE) directly from the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eExisting Standard or Autopilot GKE clusters can be connected and managed within Cloud Code, and any cluster can be set as the default context for application deployment.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows for the management of cluster connections, including adding, removing, and setting the active cluster within the KubeConfig.\u003c/p\u003e\n"],["\u003cp\u003eUsers can utilize clusters from other providers, such as Azure or AWS, by creating them with the respective provider's tools and then adding them to their KubeConfig.\u003c/p\u003e\n"],["\u003cp\u003eCloud code offers features for advanced cluster management, such as organizing access with kubeconfig files, developing and debugging microservices with Skaffold, and using file sync and hot reloading for rapid development.\u003c/p\u003e\n"]]],[],null,["# Configure a GKE cluster in Cloud Code for IntelliJ\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\nCloud Code opens the Google Cloud console so that you can quickly\ncreate a cluster:\n\n1. To open the Kubernetes Explorer, click\n\n **Kubernetes Explorer** or navigate to **Tools** \\\u003e **Cloud Code** \\\u003e\n **Kubernetes** \\\u003e **View Cluster Explorer**.\n\n2. In the header of the Kubernetes Explorer pane, click\n **+ Connect to a GKE Cluster**.\n\n3. Choose **Create a new GKE Cluster** or\n **Create a new GKE Autopilot cluster** . For more information on which mode to\n choose, see\n [Comparing Autopilot and Standard modes](/kubernetes-engine/docs/concepts/autopilot-overview#comparison).\n\n4. If prompted, click **Open** to permit Cloud Code to open the\n Google Cloud console.\n\n5. In Google Cloud console, choose any configuration options that you want\n to customize and then click **Create**.\n\n6. After the cluster is created, in Cloud Code, in the Kubernetes\n explorer, click the **Refresh** icon.\n\n7. After the name of your new cluster appears in the list, click the cluster\n name. Your new cluster is added to the configuration and set as the default\n context.\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. In the header of the Kubernetes Explorer pane, click **+ Add GKE Cluster**.\n2. Click **Google Kubernetes Engine**.\n3. 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\nIn the Kubernetes Explorer, right-click a cluster and then click\n**Set as Current Context**.\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\nTo learn more, read about\n[storing your container images](/code/docs/intellij/configuring-container-image-settings).\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\nIn the Kubernetes Explorer, right-click a cluster and then click\n**Remove From KubeConfig**.\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/intellij/kubeconfigs).\n- [Develop and debug parts of a microservice application](/code/docs/intellij/speed-up-k8s-development#develop_microservices_applications_using_skaffold_configurations) using Skaffold.\n- Use [file sync and hot reloading](/code/docs/intellij/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- [Debug your application in Cloud Code](/code/docs/intellij/debug).\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]