Tunnels allow you to establish secure TCP connections to Kubernetes Services running in your clusters — without requiring direct cluster access or a local kubeconfig. All connections are routed through the mogenius platform with full RBAC enforcement and audit logging.Documentation Index
Fetch the complete documentation index at: https://docs.mogenius.com/llms.txt
Use this file to discover all available pages before exploring further.
Use Cases
- Internal tools: Securely access admin panels, monitoring dashboards, or management interfaces without exposing them publicly
- Database access: Connect your local database client to a PostgreSQL, MySQL, or Redis service running in Kubernetes
- Internal APIs: Test internal microservices from your development machine
- Debugging: Access services that aren’t exposed via Ingress for troubleshooting
- Development: Connect local tools to staging or production services securely
How It Works
When you create a Tunnel, mogenius establishes a secure WebSocket connection between your browser (or CLI) and the target service in your cluster:Creating Tunnels via UI
From the Tunnel Overview
The Tunnel overview page provides a central place to create and manage all your tunnels:- Navigate to Tunnels in the sidebar (cluster or workspace level)
- Click Create Tunnel
- Select the target service from the dropdown
- Choose a session duration:
- 30 minutes (default)
- 4 hours
- 24 hours
- Unlimited
- Click Create to start the tunnel
[session-id].platform-api.mogenius.com and provides direct access to your service.
From the Resource Browser
You can also create tunnels directly from the Resource Browser:- Navigate to Resources in your workspace
- Filter by Kind: Service to see available services
- Click the Tunnel button on the service you want to access
- A new tunnel session opens with a unique URL
Managing Active Tunnels
The Tunnel overview displays all active tunnel sessions with:- Service name and namespace
- Tunnel URL for accessing the service
- Session duration and time remaining
- Status indicator
- Open in new tab — Launch the tunnel URL in a new browser tab
- Copy URL — Copy the tunnel URL to your clipboard
- Delete — Terminate the tunnel session
Tunnels are automatically closed after the configured session duration expires or after 30 minutes of inactivity.
Creating Tunnels via CLI
The mogenius CLI (mocli) provides a port-forward command for creating tunnels directly from your terminal. This is ideal for connecting local tools and scripts to Kubernetes services.
Prerequisites
- Install mocli and log in with
mocli login - Ensure you have at least Editor permissions for the target workspace
Terminal UI
The CLI includes an interactive terminal UI for creating tunnels. Launch it by running:- Navigate to the target Pod, Deployment, or Service
- Press p to open the port-forward configuration
- Configure the local and remote port mapping
- The tunnel starts and remains active while the TUI is running
Basic Usage
--namespace— Kubernetes namespace where the service runs--service— Name of the Kubernetes Service to tunnel to--port— Port mapping inlocal:remoteformat (e.g.,8080:80)
Examples
Connect to a PostgreSQL database:localhost:5432.
Access an internal API:
http://localhost:8080.
Tunnel to a specific Deployment:
Supported Target Types
The CLI supports tunneling to different Kubernetes resource types:| Flag | Target Type | Description |
|---|---|---|
--service | Service | Routes to any healthy pod backing the service |
--deployment | Deployment | Routes to a pod from the deployment’s replica set |
--pod | Pod | Routes directly to a specific pod |
Session Behavior
- The tunnel remains active as long as the CLI process is running
- Press
Ctrl+Cto terminate the tunnel - The CLI maintains a keepalive ping to prevent timeouts
- If the connection drops, the CLI will attempt to reconnect automatically
Permissions
Creating tunnels requires Editor or higher permissions in the workspace:| Role | Can Create Tunnels | Can View Active Tunnels |
|---|---|---|
| Viewer | No | No |
| Editor | Yes | Yes |
| Admin | Yes | Yes (all tunnels) |
Troubleshooting
Tunnel fails to connect
- Verify the target service exists and has healthy endpoints
- Check that you have sufficient permissions for the namespace
- Ensure the mogenius operator is running in the cluster
Connection drops frequently
- Check your network connection stability
- For CLI tunnels, ensure the terminal session remains active
- Consider using a longer session duration for UI tunnels
Port already in use (CLI)
If the local port is already in use, the CLI will display an error. Either:- Stop the process using the port, or
- Choose a different local port (e.g.,
--port 5433:5432)