Featured image for OpenShift operators.

The Web Terminal Operator in Red Hat OpenShift provides a web terminal with common cluster tooling pre-installed. The operator gives you the power and flexibility to work with your product directly through the OpenShift web console, eliminating the need to have all your tooling installed locally.

This article is an overview of the new features introduced in Web Terminal Operator 1.3. These improvements include depending on the newly released DevWorkspace Operator, adding support for saving your home directory, and updating our tooling to be compatible with OpenShift 4.8.

DevWorkspace Operator dependency

Previously, the Web Terminal Operator relied on an embedded version of the DevWorkspace controller to provide support for web terminals. That meant that in order to get the latest and greatest changes for the DevWorkspace controller, you had to wait three months for a new Web Terminal Operator release. As of Web Terminal 1.3, we have extracted that dependency, released the DevWorkspace Operator as its own separate operator, and now depend on that for providing support for web terminals. What this means for you is that the engine “under the hood” (the DevWorkspace Operator) will be updated every six weeks, instead of the standard three-month schedule for the Web Terminal Operator.

Saving your home directory

With Web Terminal 1.3, you will be able to mount your home directory and persist changes to your web terminal over multiple restarts. This feature isn’t enabled by default and it requires some additional configuration. This additional configuration depends on whether or not you already have a web terminal.

Note: Only a web terminal that has a volume and volume mount for /home/user will persist the home directory. Details follow.

If you already have a web terminal

In order to persist the home directory over multiple restarts, you will need to update the custom resource to mount a volume into the web terminal tooling container:

First, get your web terminal custom resource in your namespace and open it up for editing:

oc get dw -n ${your_namespace}
oc edit dw ${your web terminal name} -n ${your_namespace}

Now that you have your custom resource open for editing, modify the DevWorkspace custom resource components section to add a mount for the storage. This can be done by first defining a volume in spec.template.components and then mounting that volume in the web terminal tooling container. The highlighted portion of the YAML file in Figure 1 shows what you need to add in order to get the mount.

The configuration of your DevWorkspace must have a section mounting the /home/user directory
Figure 1: Configuration file with a section mounting the /home/user directory.

Once your custom resource has been edited and saved, you can start a new web terminal and create changes under /home/user. Your changes will persist over multiple restarts.

Note: If you are editing the custom resource inside a web terminal, the web terminal will automatically apply the changes and then close the active web terminal. To reopen the web terminal with the changes applied, click the Restart Terminal button.

If you don’t already have a web terminal

In order to persist the home directory if you don’t already have a web terminal, you can edit your configuration file and add the following fields. In the YAML shown, replace ${your namespace} with the namespace where you want to create the web terminal.

Note: If you are an admin, you must create your web terminal in openshift-terminal, otherwise you will not be able to connect to the web terminal through the OpenShift web console. If the openshift-terminal namespace does not currently exist, you must start your first web terminal through the UI so that the namespace is provisioned.

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: web-terminal
  namespace: ${your namespace}
  annotations:
    controller.devfile.io/restricted-access: "true"
  labels:
    console.openshift.io/terminal: "true"
spec:
  started: true
  routingClass: 'web-terminal'
  template:
    components:
    - name: web-terminal-exec
      plugin:
        kubernetes:
          name: web-terminal-exec
          namespace: openshift-operators
    - name: web-terminal-tooling
      plugin:
        kubernetes:
          name: web-terminal-tooling
          namespace: openshift-operators
        components:
        - name: web-terminal-tooling
          container:
            volumeMounts:
            - name: home-storage
              path: "/home/user"
    - name: home-storage
      volume: {}

Once your web terminal custom resource has been created, you can start a web terminal and all your changes under /home/user will be persisted by default.

Tooling update

We have updated the default binaries in Web Terminal Operator 1.3 to include the latest versions of the built-in command-line tools, as shown in Table 1.

Table 1: Command-line tools in Web Terminal Operator 1.3.
Binary Old version New version
oc 4.7.0 4.8.2
kubectl v1.20.1 v0.21.0-beta.1
odo 2.0.4 2.2.3
knative 0.19.1 0.21.0
tekton 0.15.0 0.17.2
kubectx v0.9.3 v0.9.4
kubens v0.9.3 v0.9.4
rhoas 0.24.1 0.25.0
submariner   0.9.1 (First release)

Try out these features

In Web Terminal 1.3 we have changed the default channel from alpha to fast. This means that you’ll have to go through some extra steps to try out these new features:

  • If your cluster already has the Web Terminal Operator installed, uninstall it by following the uninstall instructions and re-install the Web Terminal Operator using the fast channel.
  • If your cluster does not have the Web Terminal Operator installed, install it using the fast channel.

Additional resources

For a peek into how the Web Terminal Operator works under the hood, please see A deeper look at the Web Terminal Operator by Angel Misevski. You can also check out the initial release article by Joshua Wood: Command-line cluster management with Red Hat OpenShift’s new web terminal. For a look at our previous release blog, read What’s new in Red Hat OpenShift's Web Terminal Operator 1.2.

Comments