Creating an application from a template
Cloud Code comes with a collection of starter templates to get you started quickly. To create a Kubernetes application using an existing sample, follow these steps:
- Open File > New Project.
- Select Cloud Code: Kubernetes.
- Select a template from the list of starter applications.
Pick a name for your project. Once you click Finish, Cloud Code will clone your chosen template and open your newly created project for use.
For Java templates, you'll be prompted to import Maven projects to sync your pom.xml. Click 'Import Changes' to continue.
You'll also be prompted to automatically create Kubernetes run and development IDE run targets for the project with a notification.
Click 'Create Cloud Code Kubernetes Run Configurations'.
Optional:Alternatively, you can manually create run targets.
- Select the 'Run Configuration' drop down, and click 'Edit Configurations'.
- Click the '+' Add New Configuration button to add a new Run Configuration.
Browse to 'Cloud Code: Kubernetes'.
Fill in a name for your new Configuration.
Click 'OK' to create your run target.
Specifying an image repository
Lastly, you'll need to enable access to the image repository where the project image is about to be pushed.
By default, the project is configured to use Google Container Registry. Once you have your repository set up (Google Container Registry, DockerHub, private repository, etc.), edit the run targets and specify it as a default image repository in run target settings. These are accessible from the Run/Debug configurations dialog on the top taskbar under 'Edit Configurations...' > 'Develop on Kubernetes' > 'Image options' > 'Default image repository'.
Here are examples of how to specify the default image repository for some common registries:
- Docker Hub:
- GCP Container Repository (GCR):
- AWS Container Repository (ECR):
- Azure Container Registry (ACR):
The resulting image name is concatenated from the specified default image
repository and the image name from the project's Kubernetes resources. For the
'java-guestbook' example, and GCR image repository as the default one, the
resulting full image name would be
Using your own application
If you'd like to use a project of your own, refer to this guide on setting up your application.