Skip to main content
Version: 6.x (Latest)


DevSpace allows you to define dependencies between several software projects that have a devspace.yaml, e.g. across different git repositories or local folders. This makes DevSpace a great tool for building and deploying software that consists of several microservices. Primary use cases of dependencies are:

  • You want to reuse an already existing devspace.yaml of another project
  • You want to define a more complex pipeline with multiple build, hook and deploy steps
  • You want to define a common build / deploy step for other projects

Dependencies for DevSpace projects are defined within the dependencies section of devspace.yaml.

branch: stable
pipeline: dev
revision: c967392
- production
tag: v3.0.1
subPath: /configuration

Dependency Source

DevSpace is able to work with dependencies from the following sources:

Execution Order

Dependencies will be executed in parallel and always before image building and deployments defined in the top-level devspace.yaml. If you want to execute dependencies sequentially, you can define a pipeline to do so. dev configuration that should be reused from a dependency will be executed alongside regular dev configuration specified in the top-level devspace.yaml after the DevSpace deployment pipeline ran through. Example:

path: dep1
pipeline: dev
path: dep2
pipeline: dev
image: myimage/image
ports: ...
sync: ...


In the above devspace.yaml, execution order would be as followed:

  • Execute dependency dep1's pull secrets, image building & deployments (if dep1 has other dependencies as well, execute those first)
  • Execute dependency dep2's pull secrets, image building & deployments
  • Build image image1
  • Deploy deployment deployment1
  • Start merged portforwarding from dep2 and dev.ports
  • Start sync from dep1 and dev.sync

Referencing Dependencies

Reference Image Names

You can reference dependencies images via my-dependency.image in the ./devspace.yaml:

path: dep1

imageSelector: ${runtime.dependencies.dep1.images.image1}
# Will open a terminal to the pod with the
# image from dep1
terminal: {}

With dep1/devspace.yaml:

image: myusername/devspace
- image: myusername/devspace

Referencing Dependencies in Deployment Values / Manifests

It is also possible to reference a dependency's image with runtime variables in a deployment:

path: dep1
- image: ${runtime.dependencies.dep1.image1.image}:${runtime.dependencies.dep1.image1.tag} # -> replaced with 'myusername/devspace:xxxx'

With a dependency dep1/devspace.yaml that looks like:

image: myusername/devspace

Dependency Resolution

When a DevSpace project has dependencies, DevSpace will:

  1. Resolve all dependencies in a recursive manner and give the dependency an ID based on its path or git repository
  2. Build a non-cyclic dependency tree where each dependency only occurs once (but could have multiple edges)
  3. Choose a leave node from the dependency tree, build its images (unless skip is defined) and deploy its deployments as well as execute defined hooks or pull secrets
  4. Remove the leave node from the tree and repeat step 3 until everything has been deployed

The algorithm used by DevSpace for building and deploying dependencies ensures that all dependencies have been deployed in the correct order before the project you are calling DevSpace from will be built and deployed.

Redundant Dependencies

If DevSpace detects that two projects within the dependency tree define the same child-dependency (i.e. a redundant dependency), DevSpace will try to resolve this by removing the dependency that is "higher" (i.e. found first when resolving dependencies) within the tree.

Circular Dependencies

If DevSpace detects two projects which define each other as dependencies (either directly or via child-dependencies), DevSpace will print a warning showing the problematic dependency path within the dependency tree.

Useful Commands

devspace update dependencies

If you want to force DevSpace to update the dependencies (e.g. git fetch & pull), you can run the following command:

devspace update dependencies


dependencies required <dependency_name>:object

Dependencies are sub devspace projects that lie in a local folder or remote git repository that can be executed from within the pipeline. In contrast to imports, these projects pose as separate fully functional DevSpace projects that typically lie including source code in a different folder and can be used to compose a full microservice application that will be deployed by DevSpace. Each dependency name can only be used once and if you want to use the same project multiple times, make sure to use a different name for each of those instances.

<dependency_name> required string

Name is used internally

disabled required boolean false

Disabled excludes this dependency from variable resolution and pipeline runs

Source: Local Filesystem

path required string

Path is the local path where DevSpace can find the artifact. This option is mutually exclusive with the git option.

Source: Git Repository

git required string

Git is the remote repository to download the artifact from. You can either use https projects or ssh projects here, but need to make sure git can pull the project. This option is mutually exclusive with the path option.

subPath required string

SubPath is a path within the git repository where the artifact lies in

branch required string

Branch is the git branch to pull

tag required string

Tag is the tag to pull

revision required string

Revision is the git revision to pull

cloneArgs required string[]

CloneArgs are additional arguments that should be supplied to the git CLI

disableShallow required boolean false

DisableShallow can be used to turn off shallow clones as these are the default used by devspace

disablePull required boolean false

DisablePull will disable pulling every time DevSpace is reevaluating this source


pipeline required string deploy

Pipeline is the pipeline to deploy by default. Defaults to 'deploy'

vars required <var_name>:string

Vars are variables that should be passed to the dependency

overwriteVars required boolean false

OverwriteVars specifies if DevSpace should pass the parent variables to the dependency

ignoreDependencies required boolean false

IgnoreDependencies defines if dependencies of the dependency should be excluded

namespace required string

Namespace specifies the namespace this dependency should be deployed to