Search
⌃K

Using Parameters

Control environment orchestration using dynamically set parameters
Environment parameters are placeholders defined in your Velocity account, allowing users to control their Velocity Environment provisioning. When creating or updating a Velocity Environment, you can set custom values to the predefined parameters and control the environment provisioning.
Common use cases for environment parameters:
  • Changing environment variables that affect your application's behavior. For example: selecting a tenant or enabling certain features.
  • Changing environment size. For example, changing the number of instances of a certain service.

Defining parameters

Environment parameters and their associated default values are created via the Velocity UI.
To do so, click on your user icon in the top right corner of the UI. Then select Account Settings. You can then select the Account parameters option and click Add new parameter to create a new environment parameter and its associated default value.
Example:

Referencing parameters in Blueprints

With our default parameter value defined, we can inject that value into a Velocity Blueprint by using the velocity.v1.param template, like so:
spec:
containers:
- name: web-api
image: example/example_image:latest
env:
- name: TENANT_ID
value: "{velocity.v1.param: tenant_id}"

Creating an environment with parameters

At the time of environment creation, a user may overwrite the default value associated with a given environment parameter, like so:
veloctl env create --param 'tenant_id=3'
NOTE: in the above veloctl example, the environment parametertenant-id must have first been created with a default value via the Velocity UI, as shown above.
NOTE: If no --param value is passed, the default value will be used.
Changing the available parameters does not impact running environments.
To update running environments, use veloctl env update as defined below.

Listing the environment parameters

Once Velocity defines parameters in your account, you can list them by running:
veloctl env list-parameters
The list-parameters command prints the names of the parameters and their default values.

Updating an existing environment with parameters

When you have an existing Velocity Environment, you can update some of the services or all of them using the veloctl env update command. Updating the environment allows you to change the predefined parameters using the --param flag.
For example:
  • Full update - updating all the services in the environment: veloctl env update --param 'tenant_id=3'
  • Partial update - updating selected services in the environment: veloctl env update -s website --param 'tenant_id=3'
Please note that when running a partial update, the new values set in the update command will only affect updated services.