Skip to main content
Version: 4.x

Config Reference

version

version: v1beta8                   # string   | Version of the config

images

images:                             # map[string]struct | Images to be built and pushed
image1: # string | Name of the image
image: dscr.io/username/image # string | Image repository and name
tags: # string[] | Image tags (may be a tagging schema with variables)
- latest
- 0.0.1
- dev-${DEVSPACE_GIT_COMMIT}
dockerfile: ./Dockerfile # string | Relative path to the Dockerfile used for building (Default: ./Dockerfile)
context: ./ # string | Relative path to the context used for building (Default: ./)
entrypoint: [] # string[] | Override ENTRYPOINT defined in Dockerfile
cmd: [] # string[] | Override CMD defined in Dockerfile
createPullSecret: true # bool | Create a pull secret containing your Docker credentials (Default: false)
build: ... # struct | Build options for this image
image2: ...

Learn more about how to configure image building.

images[*].build

build:                              # struct   | Build configuration for an image
docker: ... # struct | Build image with docker and set options for docker
kaniko: ... # struct | Build image with kaniko and set options for kaniko
custom: ... # struct | Build image using a custom build script
disabled: false # bool | Disable image building (Default: false)
info

Setting the key docker, kaniko, custom or disabled will define the build tool for this image.

  • If neither docker, kaniko, custom nor disabled is specified, docker will be used by default.
  • By default, docker will use kaniko as fallback when DevSpace is unable to reach the Docker host.
Build Tool Priority

If you specify multiple build tools, DevSpace will try to use them in the following order:

  1. disabled
  2. custom
  3. docker (uses kaniko as fallback if Docker host not reachable)
  4. kaniko

images[*].build.docker

docker:                             # struct   | Options for building images with Docker
preferMinikube: true # bool | If available, use minikube's in-built docker daemon instaed of local docker daemon (default: true)
skipPush: false # bool | Skip pushing image to registry, enabled automatically for minikube and docker-desktop (Default: false)
disableFallback: false # bool | Disable using kaniko as fallback when Docker is not installed (Default: false)
useBuildKit: true # bool | Enable BuildKit for Docker build process (default: false)
options: ... # struct | Set general build options

images[*].build.kaniko

kaniko:                             # struct   | Options for building images with kaniko
cache: true # bool | Use caching for kaniko build process
snapshotMode: "time" # string | Type of snapshotMode for kaniko build process (compresses layers)
insecure: false # bool | Allow working with an insecure registry by not validating the SSL certificate (Default: false)
args: [] # string[] | Array of args for kaniko build command
image: "" # string | Allows to change the kaniko image or kaniko version / image tag.
pullSecret: "" # string | Mount this Kubernetes secret instead of creating one to authenticate to the registry (default: "")
additionalMounts: [] # struct[] | Array of mount configurations for Kubernetes Secrets and ConfigMaps that should be mounted into the kaniko build container
namespace: "" # string | Kubernetes namespace to run kaniko build pod in (Default: "" = deployment namespace)
options: ... # struct | Set build general build options

images[*].build.custom

custom:                             # struct   | Options for building images with a custom build script
command: "./scripts/builder" # string | Command to be executed for building (e.g. path to build script or executable)
args: [] # string[] | Array of arguments for the custom build command
imageFlag: string # string | Name of the flag that DevSpace uses to pass the image name + tag to the build script
onChange: [] # string[] | Array of paths (glob format) to check for file changes to see if image needs to be rebuilt

images[*].build.disabled

build:                              # struct   | Build configuration for an image
disabled: true # bool | Disable image building (Default: false)

images[*].build.*.options

options:                            # struct   | Options for building images
target: "" # string | Target used for multi-stage builds
network: "" # string | Network mode used for building the image
buildArgs: {} # map[string]string | Key-value map specifying build arguments that will be passed to the build tool (e.g. docker)

deployments

deployments:                        # struct[] | Array of deployments
- name: my-deployment # string | Name of the deployment
namespace: "" # string | Namespace to deploy to (Default: "" = namespace of the active namespace/Space)
helm: ... # struct | Use Helm as deployment tool and set options for Helm
kubectl: ... # struct | Use "kubectl apply" as deployment tool and set options for kubectl
info

Using the helm or kubectl key will define the type of deployment and the deployment tool to be used.

danger

You cannot use helm and kubectl in combination.

deployments[*].helm

helm:                               # struct   | Options for deploying with Helm
chart: ... # struct | Relative path
componentChart: false # bool | Use the DevSpace component chart instead of a custom `chart` = deployment is a component (Default: false)
values: {} # struct | Any object with Helm values to override values.yaml during deployment
valuesFiles: # string[] | Array of paths to values files
- ./chart/my-values.yaml # string | Path to a file to override values.yaml with
replaceImageTags: true # bool | Enable automated tag replacement (Default: true)
wait: false # bool | Wait for pods to start after deployment (Default: false)
timeout: 180 # int | Timeout to wait for pods to start after deployment (Default: 180)
force: false # bool | Force deleting and re-creating Kubernetes resources during deployment (Default: false)
atomic: false # bool | Rollback deployment if it fails (Default: false)
cleanupOnFail: false # bool | Delete resources if rollback fails (Default: false)
recreate: false # bool | Recreate pods for applicable resources, e.g. deployments (Default: false)
disableHooks: false # bool | Disable hooks (Default: false)
driver: secrets|configmaps|memory # enum | Driver used by Helm v3 to store release configuration (Default: secrets)
v2: false # bool | Use legacy Helm v2 (Default: false)
tillerNamespace: "" # string | Kubernetes namespace to run Tiller in when using Helm v2 (Default: "" = same a deployment namespace)

Learn more about configuring deployments with Helm.

deployments[*].helm.componentChart

helm:
componentChart: true # bool | Use Component chart
values: # struct | Options for deploying a component = Deployment/StatefulSet
initContainers: ... # struct[] | Init Containers of this Deployment/StatefulSet
containers: ... # struct[] | Containers of this Deployment/StatefulSet
labels: {} # map[string]string | Map of Kubernetes labels for labeling the pods of this component
annotations: {} # map[string]string | Map of Kubernetes annotations for annotating the pods of this component
volumes: ... # struct | Component volumes
service: ... # struct | Component service
serviceName: my-service # string | Service name for headless service (for StatefulSets)
ingress: ... # struct | Component ingress
replicas: 1 # int | Number of replicas (Default: 1)
autoScaling: ... # struct | AutoScaling configuration
rollingUpdate: ... # struct | RollingUpdate configuration
pullSecrets: ... # string[] | Array of PullSecret names
podManagementPolicy: OrderedReady # enum | "OrderedReady" or "Parallel" (for StatefulSets)
options: ... # struct | Options for deploying this component with helm

Learn more about configuring the component chart.

deployments[*].helm.chart

chart:                              # struct   | Chart to deploy
name: my-chart # string | Path to local chart on filesystem OR chart name for remote chart in helm chart repository
version: v1.0.1 # string | Chart version
repo: "https://my-repo.tld/" # string | Helm chart repository
username: "my-username" # string | Username for Helm chart repository
password: "my-password" # string | Password for Helm chart repository

deployments[*].kubectl

kubectl:                            # struct   | Options for deploying with "kubectl apply"
manifests: [] # string[] | Array containing glob patterns for the Kubernetes manifests to deploy using "kubectl apply" (e.g. kube or manifests/service.yaml)
kustomize: false # bool | Use kustomize when deploying manifests via "kubectl apply" (Default: false)
replaceImageTags: true # bool | Enable automated tag replacement (Default: true)
applyArgs: [] # string[] | Array of args for the "kubectl apply" command during deployment
createArgs: [] # string[] | Array of args for the "kubectl create" command during deployment
kustomizeArgs: [] # string[] | Array of args for the "kustomize build" command during deployment
deleteArgs: [] # string[] | Array of args for the "kubectl delete" command when purging deployments
cmdPath: "" # string | Path to the kubectl binary (Default: "" = detect automatically)

Learn more about configuring deployments with kubectl.

dev

dev:                                # struct   | Options for "devspace dev"
ports: [] # struct[] | Array of port-forwarding settings for selected pods
open: [] # struct[] | Array of auto-open settings
sync: [] # struct[] | Array of file sync settings for selected pods
logs: ... # struct | Options for configuring multi-container log streaming
autoReload: ... # struct | Options for auto-reloading (i.e. re-deploying deployments and re-building images)
interactive: ... # struct | Options for configuring the interactive mode

Learn more about configuring development mode.

dev.ports

ports:                              # struct[] | Array of port forwarding settings for selected pods
- imageName: someImage # string | Name of an image defined in `images` to select pods with
labelSelector: ... # struct | Key Value map of labels and values to select pods with
namespace: "" # string | Kubernetes namespace to select pods in
forward: # struct[] | Array of ports to be forwarded
- port: 8080 # int | Forward this port on your local computer
remotePort: 3000 # int | Forward traffic to this port exposed by the pod/container selected
bindAddress: "" # string | Address used for binding / use 0.0.0.0 to bind on all interfaces (Default: "localhost" = 127.0.0.1)

Learn more about configuring port forwarding.

dev.open

open:                               # struct[] | Array of auto-open settings
- url: "https://localhost:3000/" # string | URL to open after application has started

Learn more about configuring auto-opening links.

dev.sync

sync:                               # struct[] | Array of file sync settings for selected pods
- imageName: someImage # string | Name of an image defined in `images` to select pods with
labelSelector: ... # struct | Key Value map of labels and values to select pods with
containerName: "" # string | Container name to use after selecting a pod
namespace: "" # string | Kubernetes namespace to select pods in
localSubPath: ./ # string | Relative path to a local folder that should be synchronized (Default: "./" = entire project)
containerPath: /app # string | Path in the container that should be synchronized with localSubPath (Default is working directory of container ("."))
excludePaths: [] # string[] | Paths to exclude files/folders from sync in .gitignore syntax
downloadExcludePaths: [] # string[] | Paths to exclude files/folders from download in .gitignore syntax
uploadExcludePaths: [] # string[] | Paths to exclude files/folders from upload in .gitignore syntax
initialSync: mirrorLocal # enum | Specifies the initialSync algorithm: mirrorLocal, mirrorRemote, preferLocal, preferRemote, preferNewest, keepAll (Default: mirrorLocal)
waitInitialSync: false # bool | Wait until initial sync is completed before continuing (Default: false)
bandwidthLimits: # struct | Bandwidth limits for the synchronization algorithm
download: 0 # int64 | Max file download speed in kilobytes / second (e.g. 100 means 100 KB/s)
upload: 0 # int64 | Max file upload speed in kilobytes / second (e.g. 100 means 100 KB/s)
onUpload: # struct | After a file/folder has been uploaded to the container...
restartContainer: true # bool | Restart container after uploading files (requires images.*.injectRestartHelper: true)
execRemote: # struct | ...execute the following command inside the container:
command: chmod # string | Command to execute for files and folders
args: # string[] | Argument list
- +x # string | Argument 1
- {} # string | Argument 2: {} will be replaced with path of the file/folder
onFileChange: # struct | Command to execute ONLY for files
command: chmod # string | Command
args: # string[] | Argument list
- +x # string | Argument 1
- {} # string | Argument 2: {} will be replaced with path of the file/folder
onDirCreate: # struct | Command to execute ONLY for newly created directories
command: chmod # string | Command
args: # string[] | Argument list
- +x # string | Argument 1
- {} # string | Argument 2: {} will be replaced with path of the file/folder
onBatch: # struct | Command to execute after sync has processed a full batch of files and folders
command: recompile # string | Command
args: # string[] | Argument list (NOTE: {} is NOT available for onBatch)
- assets # string | Arument 1
- --minify # string | Argument 2
onDownload: # struct | After a file/folder has been downloaded from the container to the local filesystem...
execLocal: # struct | ...execute the following command on the local machine:
command: chmod # string | Command to execute for files and folders
args: # string[] | Argument list
- +x # string | Argument 1
- {} # string | Argument 2: {} will be replaced with path of the file/folder
onFileChange: # struct | Command to execute ONLY for files
command: chmod # string | Command
args: # string[] | Argument list
- +x # string | Argument 1
- {} # string | Argument 2: {} will be replaced with path of the file/folder
onDirCreate: # struct | Command to execute ONLY for newly created directories
command: chmod # string | Command
args: # string[] | Argument list
- +x # string | Argument 1
- {} # string | Argument 2: {} will be replaced with path of the file/folder

Learn more about confguring the file synchronization.

dev.logs

logs:                               # struct   | Options for multi-container log streaming in development mode
disabled: false # bool | Disable log streaming in development mode (Default: false)
showLast: 200 # int | Number of last log lines to show before starting stream (Default: 50)
images: [] # string[] | Array of image names referencing images defined in `images` for selecting containers for log streaming

Learn more about configuring multi-container log streaming.

dev.autoReload

autoReload:                         # struct   | Options for auto-reloading (i.e. re-deploying deployments and re-building images)
paths: [] # string[] | Array containing glob patterns of files that are watched for auto-reloading (i.e. reload when a file matching any of the patterns changes)
deployments: [] # string[] | Array containing names of deployments to watch for auto-reloading (i.e. reload when kubectl manifests or files within the Helm chart change)
images: [] # string[] | Array containing names of images to watch for auto-reloading (i.e. reload when the Dockerfile changes)

dev.interactive

interactive:                        # struct   | Options for interactive mode
defaultEnabled: false # bool | Start interactive mode instead of log streaming by default, even without -i / --interactive flag (Default: false)
images: # struct[] | Array of image override configurations for interactive mode
- name: default # string | Name of the image to apply this override rule to (key in `images`)
entrypoint: [] # string[] | Array defining with the ENTRYPOINT that should be used instead of the ENTRYPOINT defined in the Dockerfile
cmd: [] # string[] | Array defining with the CMD that should be used instead of the CMD defined in the Dockerfile
terminal: # struct | Options for the terminal proxy
imageName: someImage # string | Name of an image defined in `images` to select pods with
labelSelector: ... # struct | Key Value map of labels and values to select pods with
containerName: "" # string | Container name to use after selecting a pod
namespace: "" # string | Kubernetes namespace to select pods in
command: [] # string[] | Array defining the shell command to start the terminal with (Default: ["sh", "-c", "command -v bash >/dev/null 2>&1 && exec bash || exec sh"])

Learn more about configuring interactive mode.

dependencies

dependencies:                       # struct[]  | Array of dependencies (other projects containing a devspace.yaml or devspace-configs.yaml) that need to be deployed before this project
- source: # struct | Defines where to find the dependency (exactly one source is allowed)
git: https://github.com/my-repo # string | HTTP(S) URL of the git repository (recommended method for referencing dependencies, must have the format of the git remote repo as usually checked out via git clone)
subPath: repo/sub/path # string | Path within the git repo where devspace.yaml can be found
branch: master # string | Git branch to checkout
tag: v1.2.3 # string | Git tag to checkout
revision: ac66e49 # string | Git revision (commit has) to checkout
disableShallow: false # bool | Allows to disable shallow git clones using "--depth 1"
cloneArgs: [] # string[] | Array of args for the "git clone" command for retrieving git based dependencies
path: ../../my-projects/repo # string | Path to a project on your local computer (not recommended, instead of using git-related options)
profile: default # string | Name of the profile used to deploy this dependency (when multiple profiles are defined in the devspace.yaml of the dependency)
skipBuild: false # bool | Do not build images of this dependency (= only start deployments)
ignoreDependencies: false # bool | Do not build and deploy dependencies of this dependency
namespace: "" # string | Kubernetes namespace to deploy dependency to (Default: default namespace of current kube-context)

Learn more about configuring dependencies.

danger

You cannot use source.git and source.path in combination. You must exactly use one of the two.

hooks

hooks:                              # struct[]  | Array of hooks to be executed
- command: "./scripts/my-hook" # string | Command to be executed when this hook is triggered
args: [] # string[] | Array of arguments for the command of this hook
when: # struct | Trigger for executing this hook
before: # struct | Run hook before a certain execution step
images: "all" # string | Name of the image you want to run this hook before building OR "all" for running hook before building the first image
deployments: "all" # string | Name of the deployment you want to run this hook before deploying OR "all" for running hook before deploying the first deployment
after: # struct | Run hook after a certain execution step
images: "all" # string | Name of the image you want to run this hook after building OR "all" for running hook after building the last image
deployments: "all" # string | Name of the deployment you want to run this hook after deploying OR "all" for running hook after deploying the last deployment

commands

commands:                             # struct[]  | Array of custom commands
- name: "debug-backend" # string | Name of the command to run via `devspace run debug-backend`
command: "devspace dev -i backend" # string | Command to be executed when running `devspace run [name]`

Learn more about configuring custom commands.

vars

vars:                               # struct[]  | Array of config variables
- name: CONFIG_VAR # string | Name of the config variable
question: "What is CONFIG_VAR?" # string | Question to ask the user if no value is found for variable
options: [] # string[] | Options for picker (selector) to show to user (to choose a value for variable)
password: false # bool | Hide user input when providing value via command-line, i.e. replaces input with `*****` (Default: false)
validationPattern: "" # string | Regexp to validate user input
validationMessage: "" # string | Message to show to user for input validation
default: "" # string | Default value for variable
source: "all" # enum | Source for variable (all = default, env, input)

Learn more about configuring config variables.

profiles

profiles:                           # struct[]  | Array of config profiles
- name: profile-name # string | Name of the profile
name: parent-profile # string | Name of the parent of this profile (profile inheritance)
patches: # struct[] | Array of config patches
- op: "replace" # enum | Patch operation (replace, add, remove)
path: "images.backend.cmd" # string | Jsonpath or xpath to config option that should be patched
value: "" # arbitrary | Value to use for patch operation
from: "" # string | Jsonpath or xpath to config option which should be used as value for operation
replace: # struct | Array of replacements for entire config sections
images: {} # struct | Replacement for entire `images` section
deployments: {} # struct | Replacement for entire `deployments` section
dev: {} # struct | Replacement for entire `dev` section
dependencies: {} # struct | Replacement for entire `dependencies` section
hooks: {} # struct | Replacement for entire `hooks` section

Learn more about configuring profiles and patches.