Creating an application

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:

  1. Open File > New Project.
  2. Select Cloud Code: Kubernetes.
  3. Select a template from the list of starter applications. List of templates available: Python, Go, NodeJS, Java hello world and guestbook applications
  4. 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.

    Import Maven changes notification

  5. You'll also be prompted to automatically create Kubernetes deployment and continuous development IDE run targets for the project with a notification.

    Click 'Create Cloud Code Kubernetes Run Configurations'.

    Create Kubernetes targets notification

  6. 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' and select either 'Kubernetes Continuous Deploy' or 'Kubernetes Deploy'.

      Cloud Code: Kubernetes option in menu

    • 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'.

Specifying the default image repository in run target settings

Here are examples of how to specify the default image repository for some common registries:

  • Docker Hub: docker.io/{account}
  • GCP Container Repository (GCR): gcr.io/{project_id}
  • AWS Container Repository (ECR): {aws_account_id}.dkr.ecr.{region}.amazonaws.com/{my-app}
  • Azure Container Registry (ACR): {my_acr_name}.azurecr.io/{my-app}

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 gcr.io/{project_id}/gcr.io/gcp-dev-tools/java-guestbook.

Using your own application

If you'd like to use a project of your own, refer to this guide on setting up your application.

Getting Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.
هل كانت هذه الصفحة مفيدة؟ يرجى تقييم أدائنا:

إرسال تعليقات حول...

Cloud Code for IntelliJ