Search
⌃K

Dependencies

In Velocity, you can define dependencies between Velocity Services. Dependencies are used to build a dependency map that helps provision the environment correctly.
Dependencies are optional and only needed for the use cases mentioned below.

Common use cases for dependencies:

  1. 1.
    Defining the environment provisioning order.
  2. 2.
    When creating a new environment, dependent services are automatically added to guarantee environment completeness.
  3. 3.
    Using Velocity Templates to build connection strings and other environment variables dynamically.
The dependencies are defined by adding velocity.tech.v1/dependsOn with a comma-separated list of velocity identifiers (defined by the velocity.tech.v1/id annotation) of the dependent services.
For example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-deployment
annotations:
velocity.tech.v1/id: backend
velocity.tech.v1/dependsOn: mysql, postgres # Dependency
--
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
annotations:
velocity.tech.v1/id: mysql
--
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
annotations:
velocity.tech.v1/id: postgres