Kubernetes and Docker Updates in IntelliJ IDEA 2021.3
Though we’ve already described the majority of significant features IntelliJ IDEA 2021.3 will deliver, this blog highlights the best updates for Kubernetes and Docker. You still have time to test them out before the major release goes live.
Here is the feature overview that will provide some details of the introduced changes.
Improved formatting for Helm templates
You can format your Helm templates and be sure of the correct result. We’ve fixed all the related issues, and the formatting is now much more reliable. To see the improvement, go to Code| Reformat code or Reformat file or press ⌥ ⌘L on macOS or Ctrl+Alt+L on Windows and Linux.
Highlighting of block elements in Helm templates
We’ve added highlighting of such block elements as if, else, range, with, and define in Helm templates. This makes it a lot easier to work with code that contains Go templates inclusions.
Language injection in ConfigMap resources
IntelliJ IDEA now supports automatic code injections of various languages in ConfigMap resources for keys with extensions like .yaml, .json, .properties, and so on. The injected pieces of code are highlighted in green, and it is possible to use our code insight functionality inside them, including code completion, error highlighting, and others.
Repeat the latest command
It is now possible to rerun your latest helm command from the Services tool window. All you have to do is click the new icon in the top right-hand corner. For example, you run the helm lint command, and after it completes, you can click the icon to repeat it.
Connection to Docker from Minikube
It is now possible to connect to a Docker daemon from Minikube. To do so, go to Preferences/ Settings | Build, Execution, Deployment and select the new Minikube radio button. Next to it, the IDE will automatically display the detected Minikube’s docker-daemon environments that you can use for connecting.
Previously you could connect to a Docker daemon via Minikube manually, and you can still use this approach. In this case, you should call the Minikube docker-env command in the terminal to get the necessary information for your connection. Then in Preferences/ Settings | Build, Execution, Deployment, select the TCP socket radio button and fill in the information from the terminal – Engine API URL and Certificates folder.
IntelliJ IDEA now supports Podman as an alternative way to manage pods, containers, and images. Before using Podman in the IDE, configure a connection to it by following the official instructions or the ones we provide for macOS in one of the issues.
After you’ve installed and configured Podman on your OS, you can connect to it via Preferences/ Settings | Build, Execution, Deployment | Docker by selecting the TCP socket radio button and filling in the fields under it.
If you are interested in more advanced support, please share your concerns and desires and vote for the issues devoted to Podman.
Easier connection process
You can now connect to Docker much faster, by simply double-clicking on the necessary node or using the new shortcut – ⌘Enter on macOS or Ctrl+Enter on Windows and Linux. The same applies to the Start container action.
In the upcoming release, you will notice several changes to the Docker registry. First off, the IDE now displays all the available registries in the separate nodes of the Services tool window.
Keeping the registry content up-to-date at all times might have required a lot of resources from your machine. That’s why we recommend that you click the refresh icon in the top left-hand corner from time to time.
To add the registries, go to Preferences/Settings | Build, Execution, Deployment | Docker | Docker Registry. Previously we had support only for the Docker Hub registry. In v2021.3, you’ll be able to use more registries to store and distribute Docker images. We’ve added support for GitLab (registry.gitlab.com) and JetBrains Space (<username>.registry.jetbrains.space).
You can expand the registry nodes in the Services tool window, select the necessary image, and pull it to the desired location. If you have several Docker connections, the IDE will ask you where to pull the image.
What’s more, it is possible to push images to any added registry. In the Push dialog, the IDE automatically detects the namespaces available in the given registry and lets you choose one from the drop-down list. This should save you some time as you don’t have to type the namespaces anymore.
Last but not least, you can use image completion for images from the JetBrains Space, GitLab, and Docker Hub registries.
Support for Compose V2
IntelliJ IDEA now supports Compose V2, which allows you to run all of the Docker Compose commands as docker compose, instead of docker-compose with a hyphen.
To activate this option, go to Preferences/ Settings | Build, Execution, Deployment | Docker | Tools and tick the Use Compose V2 checkbox.
New Clean up action
We’ve implemented the new Clean up action that works the same way as the prune command that you use when working with Docker via the terminal.
When you right-click on the Networks/Volumes/Containers/Images nodes, select Clean up to have the IDE get rid of the unused objects.
It is also possible to apply this action to the Docker root node to prune all of the unnecessary objects in one click.
You can now track all of the commands applied to images. To do so, select the image and go to the Layers tab that displays the list of commands. When you choose a command, you can click on the Analyze image for more information link in the right part of the screen to see more details about the changes applied to each layer.
Save container as image
If you have a preconfigured container that you want to use later, you can save it as an image locally and push it to continue using it remotely when you need it. Go to the Services tool window, right-click on the container, and select Image | Save as a new Image.
These are the most prominent features that we will deliver in IntelliJ IDEA 2021.3. Please test them and share your feedback with us.
Subscribe to Blog updates
Java Best Practices
Good code follows certain rules, and knowing them increases your chances of success. We’d like to share some Java best practices that will help you on your way. We'll cover the must-know tips and tricks, from broad advice on software development to Java- and project-specific know-how. Let's get star…
IntelliJ IDEA 2024.1 EAP 6: Improved Workflow for Logs, Inline Breakpoints, In-Editor Code Review, and MoreEarly Access Program
IntelliJ IDEA 2024.1 EAP 6 is here! This new build is packed with a bunch of updates anticipated for the next major release. Highlights include an enhanced user experience with logs, advanced debugging capabilities, and improved integration with version control systems. You can download the new v…
The New Terminal (Beta) Is Now in JetBrains IDEs
The new terminal (Beta) is now in JetBrains IDEs and will be available in the new UI starting from the 2024.1 version of the IDEs.
‘HelloWorld’ and ‘main()’ meet minimalistic
"Just ignore the terms class, public, static and arg for now; we'll talk about it later". If you have ever mentioned these lines to a new Java student, who is about to execute their first 'HelloWorld' program, know that this is changing. If you are that student, well, congratulations, getting starte…