Adding a Kubernetes cluster

With Cloud Code, you can create a Kubernetes cluster with GKE, minikube, AWS, and Azure. Additionally, you can work with a local cluster, if you're using Docker Desktop.

Creating a Kubernetes cluster with GKE

Using the GKE Explorer, you can quickly create a cluster:

  1. In the header of the Google Kubernetes Engine Explorer panel, click on the plus icon Create GKE cluster plus icon (visible only on mouseover) to launch the Create Cluster wizard.
  2. Then, select your project ID (or use the default one), zone/region, and preferred configuration (cluster name, number of nodes and machine type).
  3. Click 'Create Cluster'.

Creating a GKE cluster with the cluster creation wizard

Tip: Alternatively, you can also create a Kubernetes cluster using the Command Palette (Manage gear icon > Command Palette). Launch the Command Palette and use the command Cloud Code: Create GKE cluster to open the Create Cluster wizard.

Creating a Kubernetes cluster with minikube

You can use the minikube status bar (located in the VS Code status bar, adjacent to the Cloud Code status bar) to start, stop, pause, and view the status of a minikube cluster.

minikube status bar showing that the cluster is not running

To start a cluster, click on the minikube status bar and choose 'Start':

Starting a minikube cluster

To pause or stop a running cluster, click on the minikube status bar and choose your preferred action:

Stopping a minikube cluster

Creating an AWS cluster stack

If you'd like to create an AWS cluster stack, you can do so using the AWS EKS Cluster Explorer. Click on the three dotted 'More actions...' icon and select 'Create new AWS EKS Cluster Stack' to launch the Create Cluster wizard.

Note, you need to have the AWS CLI already installed and configured (by running 'aws configure') in order to create a cluster stack.

Once set up, select your configuration preferences (cluster name, machine type, region, machine count, and SSH key path) and click 'Create Cluster'; cluster stack creation takes about twenty minutes.

Creating an AWS cluster stack with the cluster creation wizard

Tip: Similar to creating a GKE cluster, you can also create an AWS EKS cluster stack using the Command Palette (Manage gear icon > Command Palette). Launch the Command Palette and use the command Cloud Code: Create AWS EKS Cluster Stack to open the Create Cluster wizard.

Creating an Azure cluster

If you'd like to create an AKS cluster, you can do so using the Azure Kubernetes Explorer. Click on the three dotted 'More actions...' icon and select 'Create Azure Kubernetes cluster' to launch the Create Cluster wizard.

Note, you need to have the Azure CLI already installed and on your PATH. You must also be logged in (by running az login) in order to create an Azure cluster.

Once set up, select your configuration preferences (resource group, location, cluster name, machine count, and machine type) and click 'Create Cluster'.

Tip: You can also create an Azure Kubernetes cluster using the Command Palette (Manage gear icon > Command Palette). Launch the Command Palette and use the command Cloud Code: Create Azure Kubernetes cluster to open the Create Cluster wizard.

Working with local clusters

In addition to minikube, you also have the option of working with Cloud Code if you're using Docker Desktop (for Mac or Windows).

The only additional setup required to get Cloud Code working with a local cluster is ensuring 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-for-desktop, with Docker Desktop, set your preferred cluster with the following command:

kubectl config use-context docker-for-desktop

Getting Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.