Use minikube for local development in Cloud Code for Cloud Shell
Stay organized with collectionsSave and categorize content based on your preferences.
Cloud Code automatically installs and manages minikube. If
you opted out of dependency management, add the minikube binary to yourPATH.
Before you begin
InstallGitso that Cloud Code
can perform Git operations, like cloning a sample.
Create an application from a template
Cloud Code comes with a collection ofcode sampletemplates to get you started quickly. To create a Kubernetes application using
an existing sample, follow these steps:
Launch the Command Palette (pressCtrl/Cmd+Shift+Por clickView>Command Palette) and then runCloud Code: New Application.
SelectKubernetes applicationfor the type of sample.
Select a sample based on the language you'd like to use from the available
options: NodeJS, Go, Python, Java.
Choose a preferred application location on your local machine and then clickCreate new applicationto save.
Cloud Code clones the sample you chose and opens your new
project for use.
Before running your application, ensure you're set up to deploy your app to
your preferred Kubernetes context. You can specify this in yourconfiguration.
Configuration
When using theCloud Code: Develop on Kubernetesrun configuration, you can
customize your deployment by configuring available settings.
To add or edit configurations, go toRun>Open Configurationsand then
edit or add configurations.
Create and deploy to a minikube cluster
Start a minikube cluster
Cloud Code automatically installs and manages minikube. If
you opted out of dependency management, add the minikube binary to yourPATH.
Launch the Command Palette (pressCtrl/Cmd+Shift+Por clickView>Command Palette) and
then run theCloud Code: Control minikubecommand.
ClickminikubeforChoose a Minikube cluster (profile) to controland then clickStart.
Run on minikube
Launch the Command Palette and runCloud Code: Run on Kubernetes.
ClickYesforUse current context (minikube) to run the app?
Cloud Code runs your app in a your minikube cluster. If
prompted, authorize Cloud Shell to use your credentials to make a
Google Cloud API call.
View the deployment details in theDevelopment sessionssection ofCloud Code.
View the URLs by clickingPortfoward URLsin theDevelopment sessionssection, then click the URL link to open your browser with your running
application.
Open an interactive terminal to a container
ClickCloud Codeand then expand theDevelopment Sessionssection.
ExpandDeployed Resources, then expandPods.
Right-click a container and then clickGet Terminal.
Pause or stop a minikube cluster
Launch the Command Palette (pressCtrl/Cmd+Shift+Por clickView>Command Palette) and then run theCloud Code: Control minikubecommand.
After theChoose a Minikube cluster (profile) to controloption
populates, clickminikubeand then clickStoporPause.
Create and add 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.
Work with other local clusters
In addition tominikube, you can work with
Cloud Code if you're using Docker Desktop (forMacorWindows).
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-for-desktop, with
Docker Desktop, set your preferred cluster by running the following command:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eCloud Code simplifies Kubernetes application development by automatically managing minikube, which can be started or stopped via the command palette.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create new applications from pre-built templates available in various languages, or use Cloud Code with an existing project.\u003c/p\u003e\n"],["\u003cp\u003eBefore running an application, it is essential to set the preferred Kubernetes context in the configuration.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows for interactive terminal access to containers within the development sessions, and users can view their app's URLs via the Portforward URLs option.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code can also be used with local clusters, like Docker Desktop, by ensuring the cluster is set as the current context in the default configuration.\u003c/p\u003e\n"]]],[],null,["# Use minikube for local development in Cloud Code for Cloud Shell\n\nCloud Code automatically installs and manages minikube. If\nyou opted out of dependency management, add the minikube binary to your `PATH`.\n\nBefore you begin\n----------------\n\n- Install [Git](https://git-scm.com/downloads) so that Cloud Code can perform Git operations, like cloning a sample.\n\nCreate an application from a template\n-------------------------------------\n\nCloud Code comes with a collection of\n[code sample](https://github.com/GoogleCloudPlatform/cloud-code-samples#readme)\ntemplates to get you started quickly. To create a Kubernetes application using\nan existing sample, follow these steps:\n\n1. Launch the Command Palette (press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e **Command Palette** ) and then run **Cloud Code: New Application**.\n2. Select **Kubernetes application** for the type of sample.\n3. Select a sample based on the language you'd like to use from the available options: NodeJS, Go, Python, Java.\n4. Choose a preferred application location on your local machine and then click\n **Create new application** to save.\n\n Cloud Code clones the sample you chose and opens your new\n project for use.\n\nUse your own application\n------------------------\n\nFor steps to use an existing project, see\n[use Cloud Code with an existing Kubernetes application](/code/docs/shell/use-existing-app).\n| **Note:** For developing and testing an app, create and run the application on a non-production cluster. \n| For changes that will be rolled out to production, use an [automated CI/CD workflow](/docs/ci-cd).\n\nSet your Kubernetes context\n---------------------------\n\nBefore running your application, ensure you're set up to deploy your app to\nyour preferred Kubernetes context. You can specify this in your\n[configuration](#configuration).\n\nConfiguration\n-------------\n\nWhen using the **Cloud Code: Develop on Kubernetes** run configuration, you can\ncustomize your deployment by configuring available settings.\nTo add or edit configurations, go to **Run** \\\u003e **Open Configurations** and then edit or add configurations.\n\nCreate and deploy to a minikube cluster\n---------------------------------------\n\n### Start a minikube cluster\n\nCloud Code automatically installs and manages minikube. If\nyou opted out of dependency management, add the minikube binary to your `PATH`.\n\n1. Launch the Command Palette (press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e **Command Palette** ) and then run the **Cloud Code: Control minikube** command.\n2. Click **minikube** for **Choose a Minikube cluster (profile) to control** and then click **Start**.\n\n### Run on minikube\n\n1. Launch the Command Palette and run **Cloud Code: Run on Kubernetes**.\n2. Click **Yes** for **Use current context (minikube) to run the app?**\n3. Cloud Code runs your app in a your minikube cluster. If\n prompted, authorize Cloud Shell to use your credentials to make a\n Google Cloud API call.\n\n View the deployment details in the **Development sessions** section of\n **Cloud Code**.\n4. View the URLs by clicking **Portfoward URLs** in the **Development sessions**\n section, then click the URL link to open your browser with your running\n application.\n\n### Open an interactive terminal to a container\n\n1. Click **Cloud Code** and then expand the **Development Sessions** section.\n2. Expand **Deployed Resources** , then expand **Pods**.\n3. Right-click a container and then click **Get Terminal**.\n\n### Pause or stop a minikube cluster\n\n1. Launch the Command Palette (press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e **Command Palette** ) and then run the **Cloud Code: Control minikube** command.\n2. After the **Choose a Minikube cluster (profile) to control** option populates, click **minikube** and then click **Stop** or **Pause**.\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 as\nAzure or AWS, use the provider's tools to create the cluster and add it to your\nKubeConfig.\n\nWork with other local clusters\n------------------------------\n\nIn addition to\n[minikube](https://minikube.sigs.k8s.io/docs/start/), you can work with\nCloud Code if you're using Docker Desktop (for\n[Mac](https://docs.docker.com/docker-for-mac/) or\n[Windows](https://docs.docker.com/docker-for-windows/)).\n\nTo get Cloud Code working with a local cluster, make sure that\nyour default configuration (for example, `~/.kube/config`) contains your local\ncluster. This cluster must be set as the current context.\n\nFor example, if you were using a local cluster, `docker-for-desktop`, with\nDocker Desktop, set your preferred cluster by running the following command: \n\n kubectl config use-context docker-for-desktop\n\nWhat's next\n-----------\n\n- Use [file sync and hot reloading](/code/docs/shell/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- [Debug your application in Cloud Code](/code/docs/shell/debug)"]]