Skip to content

Commit d17c23e

Browse files
committed
chore: rewrite interactive terminal in Operator
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent bec460b commit d17c23e

2 files changed

Lines changed: 74 additions & 4 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Interactive Terminal
3+
description: >
4+
Learn about Interactive Terminal in Operator mode
5+
categories: [Operator]
6+
---
7+
8+
When operating cloud native infrastructure, deep diagnostics often require direct access to the container shell. The **Interactive Terminal** in Kanvas enables you to execute commands and inspect the filesystem of your running containers directly from the visual topology. By integrating terminal sessions into the Kanvas interface, you can troubleshoot issues, verify configurations, and test network connectivity without switching context to external CLI tools like `kubectl`.
9+
10+
## Overview
11+
12+
The Kanvas Interactive Terminal allows operators to establish a secure, low-latency shell session with one or more pods simultaneously. This feature is essential for "last mile" debugging where metrics and logs alone are insufficient.
13+
14+
### Key Features
15+
16+
* **Direct Shell Access:** Instantly `exec` into any running container within your Kubernetes cluster to run standard shell commands (e.g., `ls`, `curl`, `top`).
17+
* **Multi-Session Support:** Open concurrent terminal sessions for different pods to compare environments or run simultaneous tests.
18+
* **Integrated Workflow:** Debug specific nodes while maintaining visibility of the surrounding infrastructure topology.
19+
* **Session Management:** Configure preferences such as "Auto-close Terminal Sessions" to manage resources efficiently.
20+
21+
## How to Access the Terminal
22+
23+
To use the Interactive Terminal, ensure you are in **Operator Mode** (Visualizer) and have a connected Kubernetes cluster.
24+
25+
1. **Navigate to Visualizer:** Open Kanvas and switch to **Operator** mode to view your active cluster resources.
26+
2. **Select a Workload:** Click on a **Pod** or **Deployment** node within your design.
27+
3. **Launch the Session:**
28+
* Expand the **Details** panel (bottom drawer).
29+
* Select the **Terminal** tab (located alongside *Performance* and *Log Stream*).
30+
* If the pod contains multiple containers, select the specific container you wish to access.
31+
* Click **Connect** to initialize the session.
32+
33+
## Use Cases and Examples
34+
35+
### 1. Verifying Network Connectivity
36+
37+
**Scenario:** A backend service is failing to connect to a database, but the service status appears green.
38+
**Action:** Open a terminal in the backend pod and use `curl` or `nc` (netcat) to attempt a connection to the database endpoint.
39+
**Benefit:** Confirms whether the issue is a network policy blocking traffic, a DNS resolution failure, or an application-layer configuration error, all while visualizing the connection in Kanvas.
40+
41+
### 2. Inspecting Configuration Files
42+
43+
**Scenario:** An application is behaving unexpectedly, and you suspect the mounted ConfigMap data is incorrect.
44+
**Action:** Use the terminal to `cat` the configuration files located in the file system (e.g., `/etc/config/app.conf`).
45+
**Benefit:** Verifies exactly what the application sees at runtime, ensuring that the latest ConfigMap updates have actually propagated to the pod.
46+
47+
### 3. Real-Time Resource Monitoring
48+
49+
**Scenario:** A specific pod is triggering high-memory alerts, but you need to know which process is the culprit.
50+
**Action:** Exec into the container and run `top` or `ps aux`.
51+
**Benefit:** Provides granular visibility into process-level resource consumption that aggregate metrics might miss.
52+
53+
### 4. Environment Variable Validation
54+
55+
**Scenario:** A deployment fails to authenticate with an external API.
56+
**Action:** Run the `env` command within the container's terminal.
57+
**Benefit:** Allows you to instantly verify if secret keys and API endpoints were injected correctly as environment variables during startup.
58+
59+
## Technical Architecture
60+
61+
The Interactive Terminal is built on an event-driven architecture designed for security and responsiveness:
62+
63+
1. **Session Initiation:** When a user initiates a session, the Meshery Server receives the request via the GraphQL API.
64+
2. **Orchestration:** The request is brokered to the **Meshery Operator**, which signals the **MeshSync** controller running inside the cluster to start the interactive session.
65+
3. **Data Transport:** Input and output data are streamed via **NATS** through the Meshery Broker. Shell output is preprocessed and transcribed before being delivered to the UI.
66+
4. **Session Isolation:** Each terminal session is mapped to a unique topic ID within the subscription, ensuring that data streams for multiple open terminals do not overlap.
67+
68+
***
69+
70+
### See Also
71+
72+
* **[Log Streaming](/kanvas/operator/log-streaming):** Learn how to live-tail logs for real-time application monitoring.
73+
<!-- * **[Performance Management](/kanvas/performance):** Run load tests and analyze performance profiles. -->

content/en/kanvas/operator/log-streaming.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
---
2-
title: Log Streaming in Kanvas
3-
weight: 5
2+
title: Log Streaming
43
description: >
54
Learn about Log Streaming in Operator mode
65
categories: [Operator]
76
---
87

9-
# Log Streaming in Kanvas
10-
118
Efficient troubleshooting requires immediate visibility into your application's behavior. The **Log Streamer** in Kanvas allows you to live-tail logs from your Kubernetes pods and containers directly within the visual topology. Unlike static log files, this feature provides a real-time, multiplexed view of your infrastructure's activities, enabling you to debug interactions between services without leaving the Kanvas interface.
129

1310
## Overview

0 commit comments

Comments
 (0)