Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Explore the full capabilities of the Web Terminal Operator

Web Terminal Operator basics and customizations.

September 2, 2024
David Kwon
Related topics:
Developer ProductivityDeveloper Tools
Related products:
Red Hat OpenShift

Share:

    The Web Terminal Operator is a useful tool that provides users with a shell environment from the Red Hat OpenShift web console. Within the shell environment, preinstalled tools such as oc and kubectl help you manage your OpenShift resources without leaving the web console. Figure 1 shows an instance of the web terminal.

    Screenshot of the OpenShift web console with a web terminal instance open.
    Figure 1. A web terminal instance open in the OpenShift web console
    Figure 1: A web terminal instance open in the OpenShift web console.

    In this introductory article, we will go through noteworthy nuances within the web terminal lifecycle, as well as how to further customize your web terminal to your liking using the built-in wtoctl tool.

    This article is an overview of the web terminal from a user’s perspective. For an article introducing the Web Terminal Operator from a more technical and design standpoint, check out this article here.

    The web terminal lifecycle

    When you open a web terminal for the first time, a DevWorkspace custom resource (CR) is created. Every web terminal has its own DevWorkspace custom resource. It’s where details such as the web terminal tooling image, persistent storage details, and environment variables for your web terminal live.

    From the OpenShift cluster’s perspective, this is what happens when a web terminal is running in your namespace (Figure 2).

    Diagram that displays the web terminal pod and DevWorkspace CR status when the web terminal is running.
    Figure 2. The web terminal pod and DevWorkspace CR status when the web terminal is running.
    Figure 2: The web terminal pod and DevWorkspace CR status when the web terminal is running.

    When the web terminal is closed, the DevWorkspace CR and web terminal pod still exist (Figure 3).

    Diagram that displays the web terminal pod and DevWorkspace CR status right after the web terminal is closed.
    Figure 3. When the user closes the web terminal.
    Figure 3: When the user closes the web terminal.

    The web terminal continues to run until the idle timeout, which is 15 minutes by default. After the idle timeout, the pod terminates (Figure 4).

    Diagram that displays the web terminal pod and DevWorkspace CR status when the web terminal is closed and the web terminal pod has terminated.
    Figure 4. When the web terminal pod has idled and terminated.
    Figure 4: WHen the web terminal pod has idled and terminated.

    Note:

    If opening your web terminal is quite slow, this could be because the web terminal pod isn’t running yet, therefore you’re likely waiting for the pod to be up and running.

    To summarize, here are a couple of key takeaways:

    1. Your web terminal is tied to a single DevWorkspace CR in your namespace. This ensures that your web terminal is separate from another user’s web terminal.
    2. Just because your web terminal isn’t open in the console, doesn’t mean that the web terminal isn’t running. The pod itself could still be running in your namespace if it hasn’t idled like in Figure 3.

    Customizing the web terminal with wtoctl

    What if you don't want the web terminal pod to timeout after 15 minutes? wtoctl is a tool installed in the default web terminal tooling image that allows for customizing the web terminal.

    You can run wtoctl --help in your web terminal for more details.

    If you want to revert the customizations performed in this article to the defaults, you can run wtoctl reset <timeout|shell|storage>. Alternatively, if you want to start a new web terminal from scratch, you can simply delete your terminal-* DevWorkspace CR within your namespace. In this case, a new DevWorkspace CR will be created the next time you open the web terminal. 

    Setting a new timeout

    The first change we will make is the idle timeout of our web terminal, which is 15 minutes by default.

    Here are some examples of how to run the command, which accepts the time formatting used by Go’s time package:

    $ wtoctl set timeout 30m
    $ wtoctl set timeout 1h30m
    $ wtoctl set timeout 1.5h

    Changing the shell

    The default configuration for the web terminal provides a bash shell environment. The web terminal also provides the ability to change the shell to zsh:

    $ wtoctl set shell zsh

    After this command is run, the web terminal will restart and will be using the zsh shell for your web terminal from now on. See Figure 5.

    Screenshot of the web console with a zsh shell.
    Figure 5. A web terminal with the zsh shell.
    Figure 5: A web terminal with the zsh shell.

    Enabling persistent storage

    Creating a persistent volume for your web terminal is a great way to store user data such as git repositories, commonly used OpenShift templates or scripts. Do note that if you delete your web terminal's terminal-* DevWorkspace CR, the PVC used for persistent storage will also be deleted automatically.

    To enable persistent storage in your web terminal, run the following command:

    $ wtoctl set storage
    Enter desired storage size (default: '100Mi'): 
    Enter desired mount path (default: '/home/user/storage'): 
    Adding persistent volume with size 100Mi to /home/user/storage. Is this okay? (y/N): y
    devworkspace.workspace.devfile.io/terminal-vvauwn configured
    Updated Web Terminal storage. Terminal may restart

    The sequence above creates a PVC in your namespace, mounts it to /home/user/storage in your web terminal tooling container, and restarts the web terminal pod to apply the new change.

    Additionally, wtoctl get storage specifies the configured storage for the web terminal if present, and wtoctl reset storage removes the volume from the web terminal and optionally deletes the PVC too:

    $ wtoctl get storage 
    Persistent storage (100Mi) is mounted to /home/user/storage
    $ wtoctl reset storage
    Would you like to also delete the persistent volume claim used for storage (name: storage-workspace939f8f4fc6aa4130)? (y/N): y
    devworkspace.workspace.devfile.io/terminal-vvauwn configured
    persistentvolumeclaim "storage-workspace939f8f4fc6aa4130" deleted
    Deleted persistent volume claim storage-workspace939f8f4fc6aa4130
    Reset Web Terminal storage. Terminal may restart

    Conclusion

    Knowledge of the web terminal lifecycle is useful when working with and debugging web terminals. Within the default web terminal tooling image, the ever-evolving wtoctl tool can be used to further customize your web terminal environment. 

    In the next article, we plan to dive into the wtoctl set image command which replaces your web terminal’s tooling image with a custom image allowing for further shell customizations to tailor your web terminal experience.

    Last updated: September 13, 2024

    Related Posts

    • Install OpenShift's Web Terminal Operator in any namespace

    • Cluster tooling updates and more in Red Hat OpenShift's Web Terminal Operator 1.3

    • Introducing the new Traces UI in the Red Hat OpenShift Web Console

    • How to get Red Hat OpenShift operators' information without oc-mirror plug-in

    Recent Posts

    • How to build a Model-as-a-Service platform

    • How Quarkus works with OpenTelemetry on OpenShift

    • Our top 10 articles of 2025 (so far)

    • The benefits of auto-merging GitHub and GitLab repositories

    • Supercharging AI isolation: microVMs with RamaLama & libkrun

    What’s up next?

    Learn how to set up and use the Developer Sandbox for Red Hat OpenShift. With the Developer Sandbox, you experience hands-on learning resources without setup or configuration, and learn to develop quicker than ever before.

    Start the activity
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue