IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
Docker and Kubernetes Updates in IntelliJ IDEA 2021.2
Apart from other helpful features we’ve described over the EAP period, IntelliJ IDEA 2021.2 contains some useful updates for Kubernetes and Docker. You can test them now by getting the latest build from our website, the free Toolbox App, or snaps for Ubuntu.
The following feature overview will help you browse through numerous changes.
Docker Compose
Services synchronization
Previously your IDE displayed only running services in the Services tool window. Starting with this EAP, you can make all of your Docker Compose applications appear there, even if they are not running. To display them, you can click the cycle arrows icon right in the editor window.
New icons for service states
We’ve implemented new icons for the different states of your services. The tooltips will prompt you on what each icon means.
Improved logs
Every service node now features a log.
The container logs have been improved as well. We’ve added options to show timestamps and previous sessions. If you don’t need these options, you can disable them in Preferences/Settings | Build, Execution, Deployment | Docker | Console by unticking the Fold previous sessions in the Log console checkbox.
More options in Run/Debug Configurations
We’ve added more options to the Docker Compose Run/Debug Configurations. You can now select Enable BuildKit, Enable compatibility mode, and Specify project name when you click Modify options. The latter allows you to name your project the way you want, as it inherits the name from the folder where the Docker Compose application is located by default.
New actions for containers
Quickly start, pause, unpause, and restart your containers with these new conveniently located buttons!
You can apply these actions to several containers at once. Just select two or more containers by holding the Command (Ctrl) key and then click the action button.
Smart way to delete images
Previously, there were cases where it was problematic to delete images as they had existing dependencies. In IntelliJ IDEA 2021.2, it is now possible to see all of the image dependencies and select which ones you want to get rid of.
New Networks and Volumes nodes
It is now possible to see all of the existing networks in the Services tool window. Note that the networks for a Docker-Compose application are located under the corresponding compose node, while all the others are in the new Networks node.
We’ve also added a Volumes node that contains all the Docker Volumes. With their help, you can save data locally and share it between containers. It is easy to delete volumes in the same way as images – please see the section above.
Support for version 3 of Docker Compose
We’ve added support for version 3 of the Docker Compose file format. This means that the IDE can correctly validate options available in v3 and code completion works for them.
Docker
Work with Docker via SSH
You can now connect to Docker via SSH and work with it as you would with a locally installed Docker. To configure an SSH connection, go to Preferences | Settings / Build, Execution, Deployment / Docker, select the On SSH machine radio button, click … in the window that appears, and then enter the SSH connection parameters. That’s it – you’re good to go!
Kubernetes
Support for alias in Helm chart dependencies
In Helm, charts can depend on other charts. The dependencies section allows you to manage chart dependencies. This section is located in Chart.yaml (api v2) or in requirements.yaml (api v1). Apart from the default name, version, and repository fields, each required entry can contain the alias field, which we’ve added support for in v2021.2.
This field states an alternative name of the current dependency. Here are the cases when you may need to use alias:
- If an existing dependency is used several times, and you want to distinguish between these usages. In the example below, the postgresql dependency has the alternative name anchor-feeds-db.
- If the chart name uses symbols not applicable in GoTemplate identifiers, alias lets you fix it.
Custom namespaces
When working with a Kubernetes cluster, you may be granted access to particular namespaces but won’t receive the list of all of the cluster namespaces. In this case, you can now specify the list of available namespaces in Preferences / Settings | Tools | Kubernetes. Kubernetes will use them instead of requesting namespaces from the cluster.
Favorite namespaces
If you have multiple namespaces and don’t want to scroll to the necessary one, it is now possible to mark your favorite namespaces with a star. They will then appear at the top of the list, while the remaining namespaces will be sorted alphabetically.
These were the most notable changes that we’ll deliver in 2021.2! You can try them out now in the Beta build and share your feedback.
Happy developing!