The cpln workload exec command lets you execute a specific command followed by custom arguments in a workload replica at a specific location.
--location
aws-us-west-1
).--
echo hello world
).--replica
--container
copycpln workload get-deployments WORKLOAD_NAME
This command lists available locations. Identify the location name from the output.
Example usage:
copycpln workload exec WORKLOAD_NAME --location LOCATION -- COMMAND ARG1 ARG2
In cases where you have more than one replica in a workload deployment and you would like to execute a command in one of them, 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 exec WORKLOAD_NAME --location LOCATION --replica REPLICA_NAME -- COMMAND ARG1 ARG2
Within a workload where numerous containers are configured, regardless if a container is handling traffic or functioning as a sidecar, it is feasible to execute a command to it by using the --container
option.
Example usage:
copycpln workload exec WORKLOAD_NAME --location LOCATION --container CONTAINER_NAME -- COMMAND ARG1 ARG2