Velocity's Env Exec feature allows you to run a standalone shell command, or to open a terminal, inside of a running container for troubleshooting and debugging Velocity Services during runtime.
For example, the following command will list files and directories in the root of the running container.
veloctl env exec -s <service> — ls
To open a terminal inside of a Velocity Service's running container, you can run the following:
veloctl env exec -s <service> -t -- /bin/sh
Additionally, with Velocity's Env Exec-Script feature, you can run a predefined script in a running container by adding the script
commandto your .velocity.yaml config.
description: prints mongodb url
- env | grep MONGODB_URL
description: run sanity test
With the above
execconfiguration added to your .velocity.yaml file, you can run either of the following commands in the
analyticsVelocity Service during runtime:
veloctl env exec-script -s analytics get-mongodb-url
veloctl env exec-script -s analytics my-test
Note: in order to run the
my-testscript as shown above, the script
test.shmust be included in the container image.