cpln port-forward
Overview
The cpln port-forward command securely connects your local machine with workloads running inside a Global Virtual Cloud (GVC), enabling private and secure interaction without the need for public exposure. This allows users to access applications, such as databases or internal services, that are deployed as workloads.
This functionality is directly analogous to Kubernetes’ kubectl port-forward, providing users with a familiar way to debug, manage, and interact with workloads running inside a GVC environment from their local machine.
Addresses specified can include local or LAN-accessible IP addresses. You can also specify ports using either the format :<port>
or <port>
alone, allowing the system to assign a local ephemeral port automatically.
Prerequisites
- CLI installed.
- A running workload in at least one location. Refer to our create a workload guide for additional details.
- Permissions to connect to the workload.
Options
Optional
--address
- Local addresses to listen on, separated by commas if specifying multiple addresses. Defaults to
localhost
.
- Local addresses to listen on, separated by commas if specifying multiple addresses. Defaults to
--location
- The location associated with the workload deployment (e.g.,
aws-us-west-1
). Defaults to the first location fetched from the specified GVC. When specifying, make sure that the specified location is part of the specified GVC.
- The location associated with the workload deployment (e.g.,
--replica
- The specific replica within the workload. Defaults to the first available replica.
Usage
Basic Port Forward
To forward a single local port to a port on a workload, use the following format:
Example:
Forward local port 5432
to workload container port 5432
of a database workload named db-workload
:
Assigning Local Ephemeral Port
To allow the system to automatically assign a local ephemeral port, use either of these formats:
Forwarding to Multiple Addresses
You can forward to multiple addresses by specifying them as a comma-separated list in the --address
option:
Forwarding Multiple Ports
To forward multiple ports simultaneously, specify each pair separated by spaces:
Combining Multiple Ports and Addresses
You can combine multiple ports and multiple addresses:
This will forward ports 80
and 443
from the workload to local ports 8080
and 8443
on both specified local addresses.