Kubernetes Plugin for Eclipse Che

Artem Zatsarynnyi
May 6, 2019 · 5 min read

Introduction

In this blog post, we will present the benefits of using VSCode extensions within Eclipse Che 7, using as an example the VSCode Kubernetes Tools.

One of the goals of Eclipse Che 7 is to allow developers to use any supported editor to work on their projects. A developer would still be able to share their development environment with their team, but would be able to use their preferred editor for coding. Today, it is possible to choose from a few editors: Eclipse Theia IDE, the traditional Eclipse desktop IDE, Jupyter IDE, or Eclipse Dirigible IDE.

One of the most widely used code editors today is VSCode. It is really fast, has minimal UI, is language agnostic, and provides an active plugins ecosystem. In Eclipse Che 7, we use Eclipse Theia as the default code editor. Theia provides a very similar user experience to VSCode.

At Red Hat, we have been leading the work to ensure that VS Code extensions can be run with Theia. Currently, you can install any extension from the VSCode Marketplace that uses the API calls that are already covered in Theia, e.g. Workspace API, Languages API, Debugger API, Tasks API.

You might ask: “Why should I run a VS Code extension with Eclipse Che, when I can use VSCode instead?”

First of all, with Che, there is no need to install the extension dependencies like the build system, editor, VCS, etc…They can be pre-packaged in a container image where the extension will run.

Second, Eclipse Che is a true Kubernetes-native development environment — it runs directly inside your enterprise cluster on any Kubernetes (including Red Hat OpenShift).

As a result, you can have a central Kubernetes cluster for your development teams and anyone in the team can immediately get access to a fully setup developer workspace pod without having to spend time installing or configuring anything.

The Kubernetes Plugin

The Eclipse Che Kubernetes Plugin uses VSCode Kubernetes Tools with all the required dependencies, e.g. kubectl, already packaged into the plugin’s own container.

In the following short video, you can see a sample Node.js project imported into a Che 7 workspace, with the Che Kubernetes Plugin activated and running on a local Kubernetes cluster. The video demonstrates:

  • Containerizing an application and deploying it into the cluster;
  • Checking on the app post-deployment;
  • Iterating and deploying a new version.

Under the Hood, How Does it Work?

In this section, we’ll take a closer look at how Che plugins work.

Eclipse Che 7 managed workspaces very differently from previous versions. One of the key aspects of the new workspace model is that the IDE and developer tools run in separate sidecar containers from the main workspace runtime. Here are a few benefits of this architecture:

  • simple packaging — Che 7 plugins are actually microservices packaged in their own sidecar containers, bringing their own dependencies;
  • plugin execution is isolated from the other tools and from application containers;
  • each plugin has its own lifecycle.

How does Che know which plugins to install into your workspace and where to get it? There are two main steps that Eclipse Che follows when running a Che Plugin consists of two steps:

  • look for plugin meta-data;
  • start a plugin sidecar container.

We can tell Che which plugins we want to use in our development environment as part of the configuration of a workspace. When the Che Server starts a workspace, it looks for the metadata for the desired plugins on the Che plugin registry (see Che Plugin Registry).

If you are developing a new plugin which is not yet included in the registry, it is possible to specify a link to the plugin metadata. In fact, we used this method in the earlier example using a Devfile.

This metadata is then passed to the Che Plugin Broker, which starts a sidecar container, and downloads the plugin files if necessary. If the Che plugin includes a VSCode extension for Theia editor, for example, the broker will download the extension from the VSCode marketplace and start it in a sidecar container.

To allow VSCode Kubernetes Tools to be run inside of Eclipse Che, we have implemented most of the VSCode Plugin APIs for Eclipse Theia, including:

  • Workspace APIs;
  • Window APIs;
  • Debug APIs;
  • Language APIs;
  • contribution points for views, menus, configurations, languages, debuggers.

Try the Kubernetes Plugin Today!

If you’re eager to try the Che Kubernetes Plugin yourself, here are the detailed instructions on installing and running it in the latest version of Eclipse Che — https://github.com/azatsarynnyy/blog-files/blob/master/k8s-plugin/try.md

Learn more?

Let me know in the comments if you have any feedback or questions regarding Eclipse Che, Eclipse Theia, Che Plugins or Theia Plugins. Also, don’t hesitate to reach out to me on Twitter.

In case you’ve faced some issues or has any ideas related to some projects used in this article, below are the links:

Try Eclipse Che 7 Now!

Want to give a try to the new version of Eclipse Che 7? Try the following:

Click on the following factory URL: https://che.openshift.io/f?id=factoryvbwekkducozn3jsn

Or Create your account on che.openshift.io, create a new workspace and select “Che 7” stack.

You can also test that locally, by installing the latest version of Eclipse Che: Quick Start with Eclipse Che.

Get Involved!

Quick Start with Eclipse Che.

Join the community:

  • Support: You can ask questions, report bugs, and request features using GitHub issues.
  • Public Chat: Join the public eclipse-che Mattermost channel to discuss with community and contributors.
  • Weekly Meetings: Join us in our Che community meeting every second Monday.

Mailing list: che-dev@eclipse.org

Eclipse Che Blog

News and articles for Eclipse Che - next-generation Eclipse…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store