A Graphical Terminal for OpenShift

Nick Mitchell
The Graphical Terminal
5 min readJun 21, 2019

Kui is a graphical terminal — the CLI with a GUI twist. Kui is a hard-core CLI, but one that allows you to benefit, selectively and rapidly, from the graphics of a browser. In this blog, I will highlight using Kui to interact, visually, with OpenShift and the Operator Framework.

Kui helps with navigating raw models directly from your command line — no need to switch to a browser.

OpenShift is Redhat’s managed Kubernetes platform. OpenShift is part of a larger trend that introduces domain-specific management layers over the more generic Kubernetes base.

Co-evolving with OpenShift are a number of related subsystems, including the Operator Framework. A Kubernetes operator manages a set of resource types in your application. For example, in the animated GIF above, I am using Kui to navigate to the details of the Couchbase operator. This operator maps the world of Couchbase (databases, tables, views, etc.) into that of Kubernetes. It reflects each of these resource types into the Kubernetes model, and provides runtime facilities that bridge in to and out of that world.

Kui turns commands into graphical and clickable tables.

In the terminology of the Operator Framework, a cluster service provides a collection of such operators. It is a way for cloud providers to bundle operators into meaningful units. To the left, I use Kui to list the cluster services available to me, as a developer of my cluster. In response to my CLI command olm installed, Kui transparently offers a graphical point-and-click table UI. In addition, Kui plugin developers can extend the command set provided by platform CLIs — in this case, an optional plugin gives an installed command which is not part of the standard OpenShift CLI command set.

As seems to be par for the course these days, both OpenShift and the Operator Framework come with their own CLIs and browser-based console. For example, I could also generate the table of installed operators by first switching away from my beloved terminal to my browser, opening a new tab, remembering the URL of the OpenShift console, logging in (again…), and finally navigating through the complex menu structure of that console until I find the view that addresses by task: list the cluster services available to me.

Speaking as a die-hard user of CLIs: no thanks! Kui is the product of this angst, and a desire to help us all with this common scenario of enumerating and navigating complex YAML resource models. Parsing YAML and JSON with jq and jsonpath expressions is sometimes the fastest way to answer a question. However, more often than not, it is merely a less tedious option than that context switch to my browser. Before Kui, I would tolerate the ASCII art provided by kubectl and oc (OpenShift’s CLI), because the alternative was a slow transition to a browser console.

Still, I do not want to lose that powerful option, to grab the reigns away from a carefully curated graphical experience and roll my own. To the left, I am showing a scenario where I explore the details of a pod. I am using a combination of oc CLI commands and graphical point-and-click navigation. Towards the end, I go off the rails, and pipe the output to jq to help with that familiar iterative refinement of previous commands.

Kui can also help with understanding the diverse aspects of a resource. For example, most Kubernetes resources have three main components: metadata, the resource specification, and the status of the resource. OpenShift resources are no exception, and Kui allows you to explore these aspects with a few quick point and clicks.

To the left, I am expanding on the example from the first GIF. This time, I explore in more detail. First, I request a list of cluster services available to me. I click on one, the Couchbase provider, to explore it in more detail. From here, I can switch between viewing conditions, the provided resource types (“CRDs” in the Kubernetes lexicon), along with an HTML rendering of the description offered by the author of this operator. You will briefly see the raw YAML detail underlying all of this, including the base64-encoded icon that Kui shows in the upper right.

Kui does all of this with no innate knowledge of the oc CLI. It renders the tables, the point-and-click navigation, the status badges via a generic ASCII art parsing library. Kui invokes the underlying CLIs, from which it infers the structure of the ASCII output of the CLI, and turns the response into a mixture of plain ASCII and graphics.

For example, here I use the helm CLI, first to list my deployed charts, and then to get the status of a given chart. Note how the output of helm status interleaves plain text with graphical tables. I then click on one of the Deployments and proceed to explore: first to the Pods, then to the underlying Containers, and finally to the logs of one container.

This has been a quick tour of using Kui with OpenShift. Stay tuned, we will delve into the deeper aspects of OpenShift, such as project management, in subsequent blogs!

Kui came from IBM Research, but is open to everyone. It is Apache-2.0 licensed, and has a powerful and flexible extension and packaging mechanism. Join us on GitHub, or download a prebuilt binary.

The entirely personal views of Nick Mitchell, nighttime hacker and daytime hiker.

--

--