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. Click on the plus icon Create GKE cluster plus icon to launch the Create Cluster wizard. Then, select your project ID (or use the default one), zone/region, and preferred configuration (cluster name, number of nodes and machine type) to create your 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 GKE cluster with the Command Palette

Creating a Kubernetes cluster with Minikube

From the Kubernetes Explorer, use the three-dotted 'More actions...' icon next to the Cluster Context Explorer panel and select 'Open Minikube dashboard'.

You can use this dashboard to start, stop, and get the status of a Minikube cluster.

Minikube dashboard

Starting a Minikube cluster

To create a Minikube cluster, first choose the VM driver to use. The current list of supported VM drivers are virtualbox, vmwarefusion, kvm, xhyve, hyperv, hyperkit, kvm2, and none.

You can pass additional flags to the Minikube start command using the 'Additional Flags' field.

Then, click the 'Start Cluster' button.

Starting a Minikube cluster

Stopping a Minikube cluster

To stop a running cluster, click on the 'Stop Cluster' button on the Minikube dashboard.

Stopping a Minikube cluster

Checking the status of a Minikube cluster

To monitor the status of your running Minikube clusters, refer to the 'Minikube status' section of the Minikube dashboard and refresh the section for the latest state of each cluster.

Status of 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.