Stay organized with collections Save 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 your PATH
.
Cloud Code comes with a collection of code sample templates to get you started quickly. To create a Kubernetes application using an existing sample, follow these steps:
Ctrl
/Cmd
+Shift
+P
or click View > Command Palette) and then run Cloud Code: New Application.Choose a preferred application location on your local machine and then click Create new application to save.
Cloud Code clones the sample you chose and opens your new project for use.
All language sample applications have nearly the same structure. This is not the only supported structure but is recommended when starting.
For example, the Node.js Guestbook application structure looks like:
.
|---- .vscode
| └---- launch.json
|---- kubernetes-manifests
| |---- guestbook-backend.deployment.yaml
| |---- guestbook-backend.service.yaml
| |---- guestbook-frontend.deployment.yaml
| |---- guestbook-frontend.service.yaml
| |---- mongo.deployment.yaml
| └---- mongo.service.yaml
|---- src
| |---- backend
| | |---- Dockerfile
| | |---- index.js
| | |---- app.js
| | └---- package.json
| |---- frontend
| |---- Dockerfile
| |---- index.js
| | |---- app.js
| └---- package.json
└---- skaffold.yaml
Taking a closer look at this Kubernetes Guestbook Node.js sample app, here are some key files and their uses:
extensions.json
: prompt requesting download of related extensions when opening this projectlaunch.json
: launch configuration (of type cloudcode.kubernetes
) to run or debug the Kubernetes applicationtasks.json
: configuration information for Visual Studio Code Tasksguestbook-backend.deployment.yaml
: Pod specification for the backend nodesguestbook-frontend.deployment.yaml
: Pod specification for the frontend nodesmongo.deployment.yaml
: Pod specification for the database(backend|frontend)/app.js
: Node.js code with the web server logic(backend|frontend)/Dockerfile
: used to build the container image for our programskaffold.yaml
: config file for Skaffold, which Cloud Code uses to build, deploy and debug Kubernetes applicationsFor steps to use an existing project, see use Cloud Code with an existing Kubernetes application.
Note: For developing and testing an app, create and run the application on a non-production cluster.Before running your application, ensure you're set up to deploy your app to your preferred Kubernetes context. You can specify this in your configuration.
ConfigurationWhen using the Cloud Code: Develop on Kubernetes run configuration, you can customize your deployment by configuring available settings.
To add or edit configurations, go to
Run>
Open Configurationsand then edit or add configurations.
Create and deploy to a minikube cluster Start a minikube clusterCloud Code automatically installs and manages minikube. If you opted out of dependency management, add the minikube binary to your PATH
.
Ctrl
/Cmd
+Shift
+P
or click View > Command Palette) and then run the Cloud Code: Control minikube command.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 the Development sessions section of Cloud Code.
View the URLs by clicking Portfoward URLs in the Development sessions section, then click the URL link to open your browser with your running application.
Ctrl
/Cmd
+Shift
+P
or click View > Command Palette) and then run the Cloud Code: Control minikube command.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 clustersIn addition to minikube, you can work with Cloud Code if you're using Docker Desktop (for Mac or Windows).
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:
kubectl config use-context docker-for-desktop
What's next
To send feedback, report issues on
GitHub, or ask a question on
Stack Overflow.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["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-08-07 UTC."],[[["Cloud Code simplifies Kubernetes development by managing minikube and providing templates for quick application creation."],["Users can create new Kubernetes applications using pre-built samples in various languages like Node.js, Go, Python, and Java."],["The structure of sample applications, such as the Node.js Guestbook, includes configuration files like `launch.json`, deployment specifications in `kubernetes-manifests`, and server logic in `src`."],["Cloud Code enables running and debugging applications on a minikube cluster and offers features like port forwarding to view deployed apps."],["The tool supports working with other local clusters like Docker Desktop and allows the use of clusters from other providers by adding them to your KubeConfig."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4