Quickstart

This page shows you how to get started with Cloud Code using your own Kubernetes project or using the sample Hello World application.

Before you begin

The following tools are expected to be installed and set up on your system and available on the PATH of your machine:

Installing the plugin

To install the Cloud Code plugin:

  • Open IntelliJ IDEA (or any supported JetBrains IDE).
  • From your plugins marketplace (File > Settings > Plugins or for Mac OS X, IntelliJ IDEA > Preferences > Plugins), search for the 'Cloud Code' plugin and install it. You may be prompted to restart your IDE to activate the plugin.

Adding Cloud Code support to your existing Kubernetes projects

For existing Kubernetes projects, follow these steps to add Cloud Code support:

  • If your project has a Dockerfile and Kubernetes resources, Cloud Code will prompt you with a notification to automatically create necessary configuration files and run targets.

    Create Kubernetes targets notification

    Once created, your project is ready to use the Cloud Code's continuous development and deployment features.

  • Alternatively, use Tools > Cloud Code > Kubernetes > Add Kubernetes Support to analyze the project's Kubernetes resources, generate a Skaffold configuration, and add two run configurations for deployment and continuous deployment to a Kubernetes cluster.

Creating an application

To create an application using an existing sample:

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

  4. 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

Deploying your application

To deploy an application:

  • Make sure you have access to a container image repository used by the project.

    To replace the project image repository, specify it using the Run/Debug configurations dialog on the top taskbar under Edit Configurations... > Kubernetes Deploy / Continuous Deploy > Image options > Default image repository.

    For example, for Docker Hub, use 'docker.io/{account}'.

  • Now that your application is ready for deployment, choose Kubernetes Deploy from the Run/Debug configurations dialog on the top taskbar to deploy the application.

    Kubernetes deployment run configurations

Initiating continuous deployment

To initiate continuous deployment for your application:

  • Choose the Kubernetes Continuous Deploy run target from the Run/Debug configurations dialog on the top taskbar to continuously redeploy changes and watch application logs.

    Any changes to your code will automatically be built, pushed, and deployed to a new version of your application.

  • View application logs in the output window. Once the deployment has started, you'll see the list of forwarded ports for the deployed application.

    Viewing streamed logs from the Kubernetes application

  • Access your application services locally using one of the ports listed in the IDE Event log.

    Using event log to find port-forwarded services

Debugging your application

To debug your application:

  • Click the debug action for Kubernetes Continuous Deploy to start the development cycle in debug mode on your Kubernetes cluster.

    Starting the Kubernetes cluster development cycle in debug mode

  • Cloud Code will attach a debug session.

    You can now perform all the tasks you normally do when debugging local code, like setting breakpoints and stepping through code, except with the added advantage of debugging against a live Kubernetes cluster.

Viewing logs

While you can see a live stream of the logs from running pods within the terminal output from your continuous deployment, you can also view logs from a specific pod by navigating to the Kubernetes explorer.

To view logs from a specific pod, follow these steps:

  1. Navigate to the Kubernetes Explorer. It can be accessed either from the side panel on the right or using Tools > Cloud Code > Kubernetes > View Cluster Explorer.

    Kubernetes Explorer panel open using the tab on the right side taskbar

  2. Select the pod you'd like to see logs from.

  3. Right click the pod and select Stream Logs. Alternatively, you can stream logs for individual containers running in pods.

    This will output logs to the Kubernetes Explorer Console.

    Streaming logs from a pod using its right-click menu to output logs into the Kubernetes Explorer Console

Additionally, you can check up on the status of your deployment in the following ways:

  • Pod status: Running pods will have colored status marks next to their labels; red for failed state, yellow for starting/terminating, and green for healthy, running state.

    Pod status is healthy as observed by the green check mark next to the pod label

  • Deployed resource descriptions: You can run a kubectl describe on your deployed resources to display its details by right-clicking and choosing Describe.

    Describe option available when right-clicking an appropriate resource within the Kubernetes Explorer panel and choosing Describe

What's Next

Getting Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.
Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Code for IntelliJ