IntelliJ IDEA 2021.1: Overview of Docker and Kubernetes updates

IntelliJ IDEA 2021.1 brings some updates to Kubernetes and Docker, making development more convenient. In this blog post, we will describe them in detail.

Click to download the latest trial version of IntelliJ IDEA

Governors

Quickly delete resources

Now you can delete all cluster resources in the current context directly from the editor-just click the run icon in the gutter and select delete .

Delete resource

Support Kustomize 3.7.0 components

We have added support for the new Kustomize 3.7.0 component. You can select this new option from the Kustomize version drop-down list in "Settings/Preference | Languages ​​& Frameworks | Kubernetes".

Kustomize 3.7.0

Support kind: List

If you want to use the content returned by the'kubectl get <resource type> -o yaml' command, or if you want to apply the resource list, I will tell you a good news: your IDE now supports kind: List!

In each resource in the list, you can rename the tag, use code assist and navigate through the groove icon. You can also convert a list into a multi-document YAML file by clicking Alt+Enter and selecting the relevant intent operation, and vice versa.

Support type: list

Non-default values ​​for Helm items

Helm chart is a set of parameterized Kubernetes resource descriptions. By default, the parameters are specified in values.yaml, but Helm allows any number of non-default Values ​​files to be used. Before v2021.1, the default values.yaml was the only option for code insight and running Helm commands.

In IntelliJ IDEA 2021.1, we can already use custom Values ​​files. Now, the IDE treats all files with "values" in their names as values ​​files.

To configure which value files the chart template will use, select Configure Helm Parameters or call Helm Lint or Helm Template from the context menu. A dialog box will open where you can add the required value file. If you want to skip this dialog when executing the Helm command, please check the box at the bottom.

rudder

You can also manually add values ​​by pasting in the additional value area.

Added value

Docker

Improved run/debug configuration

We have modified your run/debug configuration dialog box to make it more tidy and can be adjusted according to your needs. To add all necessary build options, click "Modify Options"; to add run options, click "Modify". The IDE will now verify each option to make sure it is compatible.

For Docker Compose, we support all existing options, including the option to declare environment variable files (.env).

Docker run/debug configuration

For Dockerfile, you don't have to remember all the running commands, because the code completion can be done in the " Run Options" field.

Complete run options

For images , you can use code completion to enter the image name in the image ID or name field.

Image completion in run/debug configuration

BuildKit support

We have added experimental support for BuildKit, which greatly increases the speed of building projects. You can activate this option in the run/debug configuration by clicking Modify option and then selecting Enable BuildKit (experimental) .

BuildKit in Docker

Building named stages separately from the entire multi-stage Dockerfile is now easier and faster. Just click the hammer icon next to the stage name, and the IDE will use BuildKit to build the image. If you add the "Run" section to the "Run/Debug Configuration", the icon will change. When you click on it, you will not only build an image, but also run a container.

BuildKit for Docker

UI enhancement in multi-stage Dockerfile

If you use multiple FROM statements in a Dockerfile, each FROM instruction will start a new phase. In v2021.1, you can now fold the stages and see a clear dividing line between them.

Multi-stage enhancement

Cancel Docker operation

If you decide to stop a running Dockerfile, you can easily stop it in the " Sever" tool window. Select the running project, bring up the context menu, and click Stop Deploy .

Cancel running

Environment variables and macros mounted by Docker

When using bind mount, you can now enter the path of a directory on the host faster. The completion mechanism allows you to select macros and environment variables in the bind mount options in Run/Debug.

Image completion in Dockerfiles

Adding image names becomes easier, because code completion is now available for them. Take a look:

Image complete

Well, this is today's content. If today's article does not solve your needs, you can click to get more free tutorials . Don’t forget to share your thoughts and suggestions with us in the comments. As a genuine IntelliJ IDEA partner, Huidu has launched the "Software Localization Service Season" activity (click to view details )! IntelliJ genuine authorized online order is now up to 3000 yuan off! As low as 1333! There are also a variety of authorization methods for you to choose.

====================================================

JetBrain technical exchange group is now open, QQ search group number "786598704 " or scan the QR code below to join

Guess you like

Origin blog.csdn.net/qq_42444778/article/details/115162637