Web Terminal Operator¶
The Web Terminal Operator provides an embedded command-line terminal in the OpenShift web console. It gives developers and administrators quick access to oc, kubectl, and other CLI tools directly from the browser without needing a local terminal or SSH session.
Info
The Web Terminal Operator requires cluster administrator privileges to install, but once installed, any authenticated user can open a terminal session from the web console.
Install the Operator via WebUI¶
- Go to Ecosystem -> Software Catalog -> filter for "Web Terminal" -> click the "Web Terminal" tile (provided by Red Hat)
- Click Install
- Leave all the defaults and click Install
- Wait for the Operator to install
Install the Operator via YAML (click to expand)
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: web-terminal
namespace: openshift-operators
spec:
channel: fast # Web Terminal only publishes on 'fast' — there is no 'stable' channel for this operator
name: web-terminal
source: redhat-operators
sourceNamespace: openshift-marketplace
installPlanApproval: Automatic
Wait for the operator:
The PHASE should show Succeeded.
Using the Web Terminal¶
- Log in to the OpenShift web console
- Click the command-line terminal icon ( >_ ) in the upper-right corner of the console
- Select the project where the terminal workspace will run (a
DevWorkspaceis created in that project) - The terminal session opens in a panel at the bottom of the console
The terminal comes pre-loaded with common CLI tools including oc, kubectl, kn, tkn, helm, subctl, and odo.
Tip
The terminal session runs as a DevWorkspace pod in the selected project. Sessions have configurable idle timeouts — by default, inactive terminals are shut down after 15 minutes.
Configure Idle Timeout¶
In OCP 4.22 and later, the supported cluster-wide method to configure the web terminal idle timeout is through the Console UI:
- Navigate to Administration → Cluster Settings → Configuration → Console
- Click Customize → Web Terminal
- Set the desired idle timeout value
Configure Network Policies¶
If your cluster uses network policies that restrict pod communication, web terminal workspace pods need egress to the OpenShift API server. Example allow-all egress for a project where terminals run (tighten for production):
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-openshift-console
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-console
policyTypes:
- Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-openshift-operators
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-operators
policyTypes:
- Ingress
If terminals fail to connect, also confirm DNS and that the project can reach the Kubernetes API service.
Uninstall¶
To remove the Web Terminal Operator:
- Go to Ecosystem -> Installed Operators -> Web Terminal
- Click the Actions menu -> Uninstall Operator
- Clean up any remaining
DevWorkspaceresources:
Verify¶
oc get csv -n openshift-operators | grep web-terminal
oc get pods -n openshift-operators -l app.kubernetes.io/part-of=web-terminal-operator
The operator pod should be in Running state, and the web terminal icon should be visible in the console toolbar.