IntelliJ IDEA 2018.1: Kubernetes support

The upcoming IntelliJ IDEA 2018.1 Ultimate Edition introduces initial support for Kubernetes via a brand new Kubernetes plugin. The new plugin supports the Kubernetes resource files from v1.5 up to the recently released v1.9.

The IntelliJ IDEA enhancements for Kubernetes include: code completion, inspections, quick-fixes for Kubernetes resource files, icons in the gutter for easier navigation, pop-up documentation, and live templates. Read on for more details and screenshots.

ij_ku1

Please note that the Kubernetes plugin is not bundled, so before using this new functionality you need to install the plugin. Go to Preferences | Plugins | Kubernetes plugin, or download the plugin from the website.

The new Kubernetes plugin is compatible with all paid JetBrains IDEs: PhpStorm, WebStorm, PyCharm Professional, RubyMine, AppCode, CLion, GoLand, and DataGrip.

Once the Kubernetes plugin is installed, you can create and edit the YAML and JSON Kubernetes resource files in IntelliJ IDEA. The new plugin will look for the presence of apiVersion and kind fields in the files, and if these are present it will consider such files as Kubernetes resource files.

Working with Kubernetes resource files can be challenging as you need to include all the mandatory fields, and those fields differ depending on the applied Kubernetes API version and the kind type. This means having to consult the Kubernetes documentation often as you create Kubernetes resource files. To make it easier for you to work with Kubernetes, the new plugin has a full bag of improvements.

For a start, the Kubernetes plugin has a built-in Live Template that allows you to quickly create the type of YAML Kubernetes resource file that you need:

2018-03-02 14_52_26

The new plugin now contains several predefined Kubernetes templates, and you can invoke the necessary Live Template by typing its abbreviation.

If you want to add your own Live Template or to customize an existing one, go to Preferences | Live Templates | Kubernetes.

Code completion now works for YAML Kubernetes resource files. The Kubernetes plugin offers the correct values you can use within the resources.

KubCompletion (1)

To help you really quickly create the required YAML definition file for Kubernetes, start typing the required key and invoke Smart Completion. The new plugin will auto-complete all the required keys from all the levels below.

SmartDeep

For YAML Kubernetes resource files, the plugin provides an ability to navigate between a label definition and a label selector. Use the icons in the gutter.

image10

You can also navigate and jump from a label selector to a label definition inside the editor if there is a direct match for a label, both for the key and for the value.

image15

When you rename a key or a value in YAML Kubernetes files, the plugin will also rename all their usages.

image8

The Kubernetes plugin will alert you whenever you select deprecated Kubernetes properties (available for the YAML files only).

image12

In addition to this, you’ll get a warning for the YAML files if you try to use properties that are not applicable for the specified elements with the applied apiVersion and kind.

image7

The plugin highlights elements with missing keys in YAML Kubernetes resource definition files and provides a quick-fix to add the required keys.

image13

Another enhancement in this area is that IntelliJ IDEA will now warn you about redundant keys. Use the provided quick-fix to remove redundant keys in YAML Kubernetes resource files.

Our new plugin also detects non-editable keys in YAML Kubernetes resource files and highlights them in the editor. Note that there’s an easy way to remove all such read-only keys from the current YAML file via a handy quick-fix.

image5

The IDE previews the important information from the folded area in YAML Kubernetes files.

2018-03-02 16_52_37

You can also invoke the documentation for any keys in YAML or Kubernetes resource files by simply pressing ^J (macOS) or Ctrl + Q (Windows and Linux). Click the hyperlink in the Quick Documentation Lookup to navigate to more detailed information.

image14

Support for JSON Kubernetes resource files

Although the JSON format is not recommended for Kubernetes resource files, it is still supported by Kubernetes. The new plugin provides some limited support for JSON Kubernetes resource files based on the JSON schema functionality.

Currently, only code completion is available for JSON Kubernetes resource files.

image2

The new plugin validates the current keys according to the JSON schema and alerts you when incorrect properties or values are used.

image16

Also, the plugin highlights elements with any missing required properties and then advises you about the appropriate properties that should be added.

image1

Duplicated properties are also detected in JSON Kubernetes files.

image4

The Quick Documentation Lookup is also available for JSON Kubernetes resource files.

image3

We would like to learn more about your experience with Kubernetes and IntelliJ IDEA. Please share your experience with us. Feature requests and improvement suggestions are very welcome! We are currently actively working to support Kubernetes even better, and your feedback can influence the roadmap for Kubernetes support a lot. Add a comment here, tweet at us or create an issue in YouTrack.

Happy developing!

About Zlata Kalyuzhnaya

IntelliJ IDEA Marketing Manager at JetBrains. twitter: @ZlataKalyuzhnay ‏
This entry was posted in Featured Plugins and tagged , . Bookmark the permalink.

25 Responses to IntelliJ IDEA 2018.1: Kubernetes support

  1. Lin says:

    Will it be an open source project?

  2. Ladislav This says:

    Is the plugin itself pluggable? I.e., would someone be able to add support for OpenShift-specific resources? Or Istio resources?

  3. Tim Van Holder says:

    Big blog post mentioning “Kubernetes” a zillion times. Absolutely no explanation of what Kubernetes actually is, and no link to the Kubernetes website. Yes, I can google it, but that seems like basic information to start an article like this with.

  4. Mariusz says:

    That’s a great news! Any plans for Helm chart editing support?

  5. Dmitry says:

    This is awesome! YAML is not as people friendly as it is advertised.
    What about Helm templates? Are they supported or going to be supported eventually?

  6. Rob Cleghorn says:

    How about Helm support?

  7. Micha Zeidler says:

    Same here, Helm support would be awesome.

  8. Gohar Aziz says:

    Is Rider IDE support in the pipeline?

  9. Brian says:

    Is it possible to disable for a file or directory? It is horrible with helm templates so I’ve had to disable the plugin altogether.

  10. Pingback: GoLand 2018.1 EAP 5: Dep Integration, Smarter Auto-Imports, Scratch Files, Faster Rename and Find Usages, and More | GoLand Blog

  11. Erik says:

    If manual installed, will this plugin still only work in the Ultimate version of IDEA 2018.1+ ?

  12. Mykola Ulianytskyi says:

    Without Helm support this feature is useless…

Leave a Reply

Your email address will not be published. Required fields are marked *