The cpln workload run command lets you run a specific command followed by custom arguments in a new workload instance. The CLI will wait for the new workload instance to be healthy and will then execute the specified command in the first workload replica and first container. The workload run command starts an interactive session with the first replica of the workload and execute the specified command.
--
echo hello world
).--clone
--tag
--tag drink=water
).--image
--interactive
, --i
false
.--remove
, --rm
--cpu
50m
).--memory
, --mem
128Mi
).--container
--clone
option. Defaults to first container.--command
, -c
--arg
, -a
--shell
, -s
bash
.--location
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.When specifying the command to execute, the workload run command will create a new standard workload based on the ubuntu:22.04 image, wait for it to be healthy, and will execute the specified command within the workload replica and then exit.
Example usage:
copycpln workload run -- COMMAND
Example usage:
copycpln workload run --image IMAGE_TAG -- COMMAND
By specifying the --clone
option, the specified workload will be cloned with the same
specs. The workload run command will wait
for the new cloned workload instance to be healthy, execute the specified command within the first workload replica, and then exit.
Example usage:
copycpln workload run --clone WORKLOAD_NAME -- COMMAND
If there is more than one running container in the new workload instance and you wish to run a specific command within it, you can provide the name of the container to the --container
option.
Example usage:
copycpln workload run --clone WORKLOAD_NAME --container CONTAINER_NAME -- COMMAND
By specifying the --interactive
option, the remote terminal session will stay open after the specified command is executed.
Example usage:
copycpln workload run --interactive -- COMMAND
By default, the workload run command attempts to initiate an interactive bash
session; if unavailable, it sequentially tries zsh
, then sh
. If all attempts fail, an interactive session cannot be established, and the specified command will not execute.
To override the default shell, specify one with the --shell
option.
Example usage:
copycpln workload run --interactive --shell SHELL_NAME -- COMMAND
If you wish for the newly created workload instance to be deleted after the command is executed, pass the --remove
or the --rm
option to the workload run command.
Example usage:
copycpln workload run --remove -- COMMAND
copycpln workload run --cpu 75m --memory 150Mi -- ls -al
copycpln workload run --command sleep --arg "999d" -- ls -al
copycpln workload run --location aws-eu-central-1 -- ls -al
copycpln workload run --tag drink=water -- ls -al