Search
⌃K

Validating with --dry-run

The veloctl env create command accepts a --dry-run flag that will allow you to validate your Velocity Blueprints without actually creating a Velocity Environment.

Example usage:

veloctl env create -f <resource.yml> --dry-run
In the above, we are passing a single k8s YAML file to the veloctl env create command with the -f argument, which will create a Velocity Environment that contains any Velocity Services defined within the k8s YAML definition.
This command can be used in conjunction with tools like Helm or Kustomize by piping the output of calls to these tools into a construction like you see above, so that you only need to execute a single command to validate all of the Velocity Blueprints included in your project, like so:
helm template <path/to/chart/dir> --values <path/to/velocity-values.yml> | veloctl env create -f - --dry-run
In addition to validating your Velocity Blueprints, the --dry-run flag will also provide you with a wealth of information about your specific Velocity Environment, including example autogenerated properties and properties associated with specific Velocity Services being validated.

Example output:

Unassociated Resources
Kind Name Validation Depends On
ConfigMap configmap Valid
Velocity Resources
Kind Name Validation Depends On
Velocity Service mongo Valid
├─ Service mongodb Valid
└─ Deployment.apps mongodb Valid
Auto-generated properties
Use properties by placing them in templates and embedding them in your deployment files
Syntax: {velocity.v1.<Property>}
Example: {velocity.v1.envName}
Property Resulted Value
aws.accountID **************
aws.region eu-central-1
domainName viron.dev
domainSuffix fearful-hex.viron.dev
envName fearful-hex
gcp.projectName viron-dev
gcp.zone europe-west2-b
tlsSecretName wildcard-cert
test Test
Velocity Service properties
Use properties by placing them in templates and embedding them in your deployment files
Syntax: `{velocity.v1:<Velocity Service>.<Property>}`
Example: `{velocity.v1:server.exposures(port=tcp).host}`
Velocity Service Property Resulted Value
mongo exposures(port=tcp).user root
exposures(port=tcp).password password1234
exposures(port=tcp).host mongodb
exposures(port=tcp).port 27017
exposures(port=tcp).scheme mongodb
exposures(port=tcp).uri mongodb://root:[email protected]:27017
Debug Information
- Overriding deployment `mongodb`'s replica count to `1`
- Overriding deployment `mongodb`'s strategy type to `Recreate`
Success

Understanding --dry-run output:

Unassociated Resources: here, you will find any k8s resources included in your Helm chart that do not include a Velocity ID, and are thus not counted as Velocity Services. Items listed here are not necessarily indicative of an error, although it is important to note that Velocity will not be able to access any parameters defined within these specific resource definitions.
Velocity Resources: a list of Velocity Services, and their underlying Kubernetes resources.
Auto-generated Properties: a list of accessible properties derived from your Velocity Environment that can be accessed dynamically via Velocity Templates.
Velocity Service Properties: a list of accessible properties exposed via Velocity Annotations within specific Velocity Services.
Debug information: Velocity enforces certain rules at Environment creation, such as reducing the number of replicas of a given k8s resource to 1 so as to minimize cloud resource consumption during development. When rules such as these are applied, they will be listed here.

Troubleshooting invalid configuration using --dry-run output:

As shown in the following example, --dry-run output will include references to specific files that contain configuration errors, such as missing dependencies, along with suggested corrections.