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.
--location
aws-us-west-1
).--replica
--container
shell
, -s
bash
.To initiate a basic connection, you need the workload's name and its deployment location.
copycpln workload get-deployments WORKLOAD_NAME
This command lists the available locations. Identify the location name from the output.
Example usage:
copycpln workload connect WORKLOAD_NAME --location LOCATION
This command connects to the first replica and container in the specified location.
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.
copycpln workload replica get WORKLOAD_NAME --location LOCATION
To override the output format, use the --output
option followed by the desired format (YAML, JSON, etc.).
Example usage:
copycpln workload connect WORKLOAD_NAME --location LOCATION --replica REPLICA_NAME
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:
copycpln workload connect WORKLOAD_NAME --location LOCATION --container CONTAINER_NAME
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:
copycpln workload connect WORKLOAD_NAME --location LOCATION --shell SHELL_NAME