With Cloud Code, you can create a Kubernetes cluster with Google Kubernetes Engine (GKE) or minikube.
Creating a GKE cluster and adding it to your KubeConfig
Cloud Code opens the Google Cloud console so that you can quickly create a cluster:
To open the Kubernetes Explorer, click Kubernetes Explorer or navigate to Tools > Cloud Code > Kubernetes > View Cluster Explorer.
In the header of the Kubernetes Explorer pane, click + Add GKE Cluster.
Choose Create a new GKE Cluster.
Choose Standard or Autopilot. For more information, see Comparing Autopilot and Standard modes
If prompted, click Open to permit Cloud Code to open the Google Cloud console.
In Google Cloud console, choose any configuration options that you want to customize and then click Create.
After the cluster is created, in IntelliJ, click Refresh.
After the name of your new cluster appears in the list, click the cluster name. Your new cluster is added to the configuration and set as the default context.
Working with an existing GKE cluster
If you have an existing Standard or Autopilot GKE cluster, you can set it as your active cluster and work with it using Cloud Code.
- In the header of the Kubernetes Explorer pane, click + Add GKE Cluster.
- Click Google Kubernetes Engine.
- Click your cluster name. Your cluster is added to the KubeConfig.
Setting a cluster as the default context
The active cluster is the cluster that your application is deployed to by default.
In the Kubernetes Explorer, right-click a cluster and then click Set as Current Context.
Removing a cluster from your KubeConfig
After you remove a cluster from your KubeConfig, the cluster is not available to deploy to.
In the Kubernetes Explorer, right-click a cluster and then click Remove From KubeConfig.
Creating and adding a cluster from another cloud provider
If you're using an on-premises cluster or a cluster from another provider such as Azure or AWS, use the provider's tools to create the cluster and add it to your KubeConfig.
Working with local clusters
To get Cloud Code working with a local cluster, make sure that
your default configuration (for example,
~/.kube/config) contains your local
cluster. This cluster must be set as the current context.
For example, if you were using a local cluster,
Docker Desktop, set your preferred cluster by running the following command:
kubectl config use-context docker-for-desktop