cpln workload connect
Overview
The cpln workload connect command is designed to establish a direct remote terminal connection to your workload replica at a specific location, allowing you to interact with the terminal session of the workload replica. This guide outlines how to effectively use the workload connect command, enabling you to perform tasks such as troubleshooting.
Prerequisites
- CLI installed and authenticated with a default profile, org and gvc.
- A running workload in at least one location. Refer to our create a workload guide.
- Permissions to interact with the workload.
Options
Optional
--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 replica name associated with the workload deployment. Defaults to the first replica.
--container
- The container name associated with the workload deployment. Defaults to the first container.
shell
,-s
- The shell to use upon connecting to the workload replica. Defaults to
bash
.
- The shell to use upon connecting to the workload replica. Defaults to
Basic Connect
To initiate a basic connection, you need the workload’s name and its deployment location.
Retrieve Workload Deployments
This command lists the available locations. Identify the location name from the output.
Connect to Workload
Example usage:
This command connects to the first replica and container in the specified location.
Advanced Connect
Specific Replica
In cases where there are more than one replica in a workload deployment and you would like to connect to a specific one, you can provide the --replica
option followed by the replicas name.
List Replicas
To override the output format, use the --output
option followed by the desired format (YAML, JSON, etc.).
Connect to a Replica
Example usage:
Specific Container
Within a workload where numerous containers are configured, regardless if a container is handling traffic or functioning as a sidecar, it is feasible to establish a connection to it by using the --container
option.
Example usage:
Specific Shell
Different container environments may require or support different shells environments in order to connect, such as bash
or sh
.
To specify the shell, use the --shell
option.
Example usage: