Add Velocity templates to your Helm values, K8s, or Kustomize overlay files
Velocity Templates are placeholders that you add anywhere in your K8s entity definitions, which will be interpreted dynamically by Velocity during provisioning. Templates are used to set dynamic values in environment variables or define unique identifiers to cloud resources and more.
  • Velocity Templates are located anywhere along your K8s resource definitions. It is recommended to keep them in a dedicated Helm values file for Velocity or in a Kustomize overlay,
  • Velocity Templates use the following syntax: {velocity.v1.<Property>}for global templates or {velocity.v1:<Velocity Service>.<Property>} for service-level templates.
Examples in GitHub: Helm on AWS, Helm on GCP

Global Properties

The name of the current environment. Example use case: Creating a unique database with the name of the environment.
Example value: crazy-imperial-guard (env specific)
The domain that is configured for the account. Example use case: Building a hostname in your ingress definitions to control environment access
Example Value: specific)
Sugar syntax for concatenating <envName>.<domainName>
Example use case: Building a hostname in your ingress definitions to control environment access. i.e. backend-{velocity.v1.domainSuffix}
Example value: (env + account specific)
The Secret name in the K8s cluster that contains the certificate detail for SSL (HTTPS).
Main use case: setting up HTTPS access to your Velocity environments.
Note that: Domains are signed with the following:*.<domainName>This way, every subdomain can be secured with TLS.
Example value: wildcard-cert(currently constant across all accounts)
The full path of an object in the relevant storage bucket. Main use case: Seeding your environment with data that was uploaded to a storage bucket.
Example value: gs://velocity-velo6abw-data-seeding/default-seeding1

GCP Specific

GCP project name that is configured for the account (The project name of the GKE cluster).
Example: viron
The GCP zone configured for the account. It can be used when defining cloud resources.
Note: It is the same zone where the GKE cluster is hosted at.
Example value: europe-west2-b

AWS Specific

AWS project id that is configured for the account. (The project id of the AWS cluster).
Example value: 123456789000
AWS region that is configured for the account.
Note: It is the same region where the EKS cluster is hosted at.
Example value: eu-central-1


Complex functions that are resolved during provisioning and allow you to generate random strings.
Note: You can wrap parameter values with backticks - `<complexValue>`
Generate a hash of 8 random alphanumeric characters.
Note: The seed is a combination of the environment name and environment creation date; therefore, the hash will only change between environments. Example use cases: Generating a unique ID when creating cloud resources or unique user names and passwords per environment.
Example value: ans2Zd4p
{velocity.v1.generate:random(seed=<seed>, pattern=<pattern>)}
Same explanation and use case as: {velocity.v1.generate:random}with the option to provide a seed and a regex pattern for the resulting string.
The option of providing a seed helps differentiate between randoms. This seed, together with the environment name and creation date, will be used to create a hash; therefore, different seeds will create different hashes.
Use the seed option to denote the random value relation (see example) Note: both parameters are optional. In case a seed won't be given, the random generator will create the same random value for every random call instance in the same environment.
Example values: {velocity.v1.generate:random(seed=`bucket1`, pattern=`[a-z]{1,5}`)} will generate f5v28. Another call with the same seed {velocity.v1.generate:random(seed=`bucket1`, pattern=`[a-z]{1,5}`)} will generate the same valuef5v28 A call with a different seed will result in a different value: {velocity.v1.generate:random(seed=`bucket2`, pattern=`[a-z]{1,5}`)} will result in g32vk
Generate the resource prefix required by velocity when creating cloud resources. The prefix is a combination of a static value, the velocity account ID, and a hash value composed of the environment name and the environment creation date, making it unique for every environment. Note: In this form, the prefix will be the same for every appearance in the same environment. In order to make the hash unique, provide a unique seed as explained below.
Example value: velocity-accountid-sd3t3f
Same explanation and use cases as {velocity.v1.generate:cloudResourcePrefix} Optionally provide a seed (an identifier) that will be chained into the hash seed. This way, for a seed 'x', the hash value will be different than for a seed 'y' or no seed. Examples: bucket1={velocity.v1.generate:cloudResourcePrefix(seed=`bucket1`)} bucket2={velocity.v1.generate:cloudResourcePrefix(seed=`bucket2`)} Example values:bucket1=velocity-accountid-jk36fr, bucket2=velocity-accountid-ar239f

Environment Parameters

Dynamically set custom parameters specified at environment creation.
{velocity.v1.param: <param_name>}
Allow users to enter custom params when creating a new environment using:
veloctl env create --param '<param_name>=<param_value>' The value of the parameter will be injected to your blueprint during provisioning. Example use cases: Change an environment variable dynamically to control the application's functionality.
Example use: veloctl env create --param 'Domain=5'

Service Properties

Dynamically extract parameters from a Velocity Service to enable the following use cases and more:
  • Connectivity: Building connection strings dynamically.
  • Parameter encapsulation so that multiple services will point to a single value.
port_id: Some templates include a reference to a port_id. This identifier is created automatically from the K8s Service associated with the relevant K8s workload that defines the Velocity Service.
To find the generated port_id, run env create with the --dry-run flag.
NOTE: port=<port>: Exposures Templates may reference a service port. This value is drawn from the port value of the K8s service associated with the Velocity Service.
For example:
- port: 6379
targetPort: 6379
name: redis
Example value: 6379
References the username defined by the<port_id>-userannotation.
Example value: username
References the password defined by the<port_id>-passwordannotation.
Example value: password
References the host defined by k8s Service name. Inferred by k8s service name that is related to the deployment
Example value: svcName
References the port of k8s Service.
Inferred by k8s service port that is related to the deployment
Example value: 8000
References the scheme defined by the<port_id>-schemeannotation.
Example value: mongodb
References the URI generated for the Velocity Service. Shorthand for concatenating the URI.
Example value: mongodb://username:[email protected]:8000
References the hostname defined on the related ingress.
Example value:
Allows exporting constant value / specific path in the manifest to other services.
Example use case: Database service exporting the name of a generated table.
Example value: test123
Last modified 3mo ago