Configure container image build preferences in Cloud Code for IntelliJ

To run or debug an application on Kubernetes, you'll need to set your preference for how your container image is built, by configuring it in the Develop on Kubernetes run configuration.

Specifying how your images are built

Once you set your container image, you can configure its build settings. Cloud Code supports Docker, Jib, and Buildpacks artifact types.

Navigate to the Run/Debug configuration selector in the Navigation bar or the top-level main menu: Run > Edit Configurations > Develop on Kubernetes and click the Build/Deploy tab.

Without skaffold.yaml

When importing an existing application without a skaffold.yaml file or running an application that doesn't have a skaffold.yaml, you're prompted to specify settings when initializing.

To edit the builder for an image, follow these steps:

  1. Click Initialize.
  2. Select the image name and then click Edit icon Edit.

    The builder and settings you specify are stored in your Skaffold configuration as your default build preference.

  3. To return to your Run Configuration dialog with your new settings, click Initialize.

    Specify build settings to be used in your Skaffold configuration

With an existing skaffold.yaml

On the Build/Deploy tab of your Run configuration settings, you can configure the build settings for your default profile.

You can also view the image name, builder, and builder arguments for all your existing images.

Filtering profiles by build environment

Using the Build environment filter input in the Cloud Code: Kubernetes run configuration panel, you can filter your skaffold profiles based on the build environment you're interested in.

  • By default, Any build environment will be selected. This filter shows all skaffold profiles in the selected skaffold profile:

    Deployment profile selection in Build/Deploy tab

  • If you're only interested in, for example, profiles that use Google Cloud Build to build skaffold artifacts, you can change the value of the Build environment filter combo box.

  • If you select a build environment that has no available profiles, you're prompted to create a new profile.

Creating a new skaffold profile

  1. To create a new profile, navigate to Run > Edit Configurations > Develop on Kubernetes and choose the Build/Deploy tab.

  2. In the Deployment profile box, click + Add.

  3. In the Create a new profile dialog, enter a profile name, select the build environment, and then click OK.

    After you've created the new profile, it will be automatically selected in the Deployment profile combo box in the run configuration panel.