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

Options

Required

  • --location
    • The location associated with the workload deployment (e.g., aws-us-west-1).

Optional

  • --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.

Basic Connect

To initiate a basic connection, you need the workload's name and its deployment location.

Retrieve Workload Deployments

copy
cpln workload get-deployments WORKLOAD_NAME

This command lists the available locations. Identify the location name from the output.

Connect to Workload

Example usage:

copy
cpln workload connect WORKLOAD_NAME --location LOCATION

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

copy
cpln workload replica get WORKLOAD_NAME --location LOCATION

To override the output format, use the --output option followed by the desired format (YAML, JSON, etc.).

Connect to a Replica

Example usage:

copy
cpln workload connect WORKLOAD_NAME --location LOCATION --replica REPLICA_NAME

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:

copy
cpln workload connect WORKLOAD_NAME --location LOCATION --container CONTAINER_NAME

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:

copy
cpln workload connect WORKLOAD_NAME --location LOCATION --shell SHELL_NAME
Copyright © 2024 Control Plane Corporation. All rights reserved. Revision 49289c07
Contents