Development Mode
A lot of teams configure DevSpace so that the development experience is very similar to using docker-compose
but with the additional benefits of running inside Kubernetes, having a reproducible dev environment that is as close to production as it gets. If an engineer is already familiar with how to develop with docker-compose
, DevSpace will be easy to get started with.
Dev Containers
Dev containers are central to the DevSpace-based development experience. A dev container serves as a remote work environment for the engineer that is connected to the local machine of the engineer via port forwarding, file sync, etc. These connections allow engineers to work with their local IDE or with any cloud IDE without having to change their habits and familiar workflows.
DevSpace can turn any container into a dev container, no matter if this container has been deployed by DevSpace or by another tool. That means you could use a GitOps tool like ArgoCD for deployment of your dev environments and then use DevSpace to connect to the deployed applications to debug and develop them inside your dev cluster.
To define a dev container, you need to configure the dev
section of devspace.yaml
and first:
- Define a selector that matches a pod/container running inside your Kubernetes cluster
- Modify selected container to prepare it for the use as remote development environment
- Optionally modify the dev container to optimize it for the use as remote development environment
1. Select Container
DevSpace provides several ways to select a pod/container. The most common option to select a container is by defining an imageSelector
which selects the container that runs the specified image. Alternatively, you could also use the labelSelector
that is a common pattern in Kubernetes to select objects in a cluster.
imageSelector
required string
ImageSelector to select a pod
imageSelector
required string labelSelector
required <labelSelector_name>:string
LabelSelector to select a pod
labelSelector
required <labelSelector_name>:string namespace
required string
Namespace where to select the pod
namespace
required string container
required string
Container is the container name these services should get started.
container
required string arch
required string
Target Container architecture to use for the devspacehelper (currently amd64 or arm64). Defaults to amd64, but
devspace tries to find out the architecture by itself by looking at the node this container runs on.
arch
required string containers
required <container_name>:object
containers
required <container_name>:object container
required string
Container is the container name these services should get started.
container
required string arch
required string
Target Container architecture to use for the devspacehelper (currently amd64 or arm64). Defaults to amd64, but
devspace tries to find out the architecture by itself by looking at the node this container runs on.
arch
required string devImage
required string
DevImage is the image to use for this container and will replace the existing image
if necessary.
devImage
required string command
required string[]
Command can be used to override the entrypoint of the container
command
required string[] args
required string[]
Args can be used to override the args of the container
args
required string[] workingDir
required string
WorkingDir can be used to override the working dir of the container
workingDir
required string env
required object[]
Env can be used to add environment variables to the container. DevSpace will
not replace existing environment variables if an environment variable is defined here.
env
required object[] reversePorts
required object[]
ReversePorts are port mappings to make local ports available inside the container
reversePorts
required object[] port
required string
Port is a port mapping that maps the localPort:remotePort. So if
you port forward the remote port will be available at the local port.
If you do reverse port forwarding, the local port will be available
at the remote port in the container. If only port is specified, local and
remote port are the same.
port
required string bindAddress
required string
BindAddress is the address DevSpace should listen on. Optional and defaults
to localhost.
bindAddress
required string sync
required object[]
Sync allows you to sync certain local paths with paths inside the container
sync
required object[] path
required string
Path is the path to sync. This can be defined in the form localPath:remotePath. You can also use '.'
to specify either the local or remote working directory. This is valid for example: .:.
path
required string excludePaths
required string[]
ExcludePaths is an array of file patterns in gitignore format to exclude.
excludePaths
required string[] excludeFile
required string
ExcludeFile loads the file patterns to exclude from a file.
excludeFile
required string downloadExcludePaths
required string[]
DownloadExcludePaths is an array of file patterns in gitignore format to exclude from downloading
downloadExcludePaths
required string[] downloadExcludeFile
required string
DownloadExcludeFile loads the file patterns to exclude from downloading from a file.
downloadExcludeFile
required string uploadExcludePaths
required string[]
UploadExcludePaths is an array of file patterns in gitignore format to exclude from uploading
uploadExcludePaths
required string[] uploadExcludeFile
required string
UploadExcludeFile loads the file patterns to exclude from uploading from a file.
uploadExcludeFile
required string startContainer
required boolean false
StartContainer will start the container after initial sync is done. This will
inject a devspacehelper into the pod and you need to define dev.*.command for
this to work.
startContainer
required boolean false onUpload
required
OnUpload can be used to execute certain commands on uploading either in the container or locally as
well as restart the container after a file changed has happened.
onUpload
required restartContainer
required boolean false
If true restart container will try to restart the container after a change has been made. Make sure that
images.*.injectRestartHelper is enabled for the container that should be restarted or the devspace-restart-helper
script is present in the container root folder.
restartContainer
required boolean false exec
required object[]
Exec will execute the given commands in order after a sync operation
exec
required object[] ####### name
required string {#dev-containers-sync-onUpload-exec-name}
Name is the name to show for this exec in the logs
name
required string {#dev-containers-sync-onUpload-exec-name}####### command
required string {#dev-containers-sync-onUpload-exec-command}
Command is the command to execute. If no args are specified this is executed
within a shell.
command
required string {#dev-containers-sync-onUpload-exec-command}####### args
required string[] {#dev-containers-sync-onUpload-exec-args}
Args are arguments to pass to the command
args
required string[] {#dev-containers-sync-onUpload-exec-args}####### failOnError
required boolean false {#dev-containers-sync-onUpload-exec-failOnError}
FailOnError specifies if the sync should fail if the command fails
failOnError
required boolean false {#dev-containers-sync-onUpload-exec-failOnError}####### local
required boolean false {#dev-containers-sync-onUpload-exec-local}
Local specifies if the command should be executed locally instead of within the
container
local
required boolean false {#dev-containers-sync-onUpload-exec-local}####### once
required boolean false {#dev-containers-sync-onUpload-exec-once}
Once executes this command only once in the container's life. Can be used to initialize
a container before starting it, but after everything was synced.
once
required boolean false {#dev-containers-sync-onUpload-exec-once}####### onChange
required string[] {#dev-containers-sync-onUpload-exec-onChange}
OnChange is an array of file patterns that trigger this command execution
onChange
required string[] {#dev-containers-sync-onUpload-exec-onChange}initialSync
required string
InitialSync defines the initial sync strategy to use when this sync starts. Defaults to mirrorLocal
You can completely disable this using the initialSync: disabled
option.
initialSync
required string initialSync: disabled
option.waitInitialSync
required boolean false
WaitInitialSync can be used to tell DevSpace to not wait until the initial sync is done
waitInitialSync
required boolean false initialSyncCompareBy
required string
InitialSyncCompareBy defines if the sync should only compare by the given type. Either mtime or size are possible
initialSyncCompareBy
required string disableDownload
required boolean false
DisableDownload will disable downloading completely
disableDownload
required boolean false disableUpload
required boolean false
DisableUpload will disable uploading completely
disableUpload
required boolean false bandwidthLimits
required
BandwidthLimits can be used to limit the amount of bytes that are transferred by DevSpace with this
sync configuration
bandwidthLimits
required polling
required boolean false
Polling will tell the remote container to use polling instead of inotify
polling
required boolean false noWatch
required boolean false
NoWatch will terminate the sync after the initial sync is done
noWatch
required boolean false file
required boolean false
File signals DevSpace that this is a single file that should get synced instead of a whole directory
file
required boolean false persistPaths
required object[]
PersistPaths allows you to persist certain paths within this container with a persistent volume claim
persistPaths
required object[] path
required string
Path is the container path that should get persisted. By default, DevSpace will create an init container
that will copy over the contents of this folder from the existing image.
path
required string volumePath
required string
VolumePath is the sub path on the volume that is mounted as persistent volume for this path
volumePath
required string readOnly
required boolean false
ReadOnly will make the persistent path read only to the user
readOnly
required boolean false skipPopulate
required boolean false
SkipPopulate will not create an init container to copy over the existing contents if true
skipPopulate
required boolean false initContainer
required
InitContainer holds additional options for the persistent path init container
initContainer
required resources
required
Resources are the resources used by the persistent path init container
resources
required ####### requests
required <request_name>:string {#dev-containers-persistPaths-initContainer-resources-requests}
Requests are the requests part of the resources
requests
required <request_name>:string {#dev-containers-persistPaths-initContainer-resources-requests}####### limits
required <limit_name>:string {#dev-containers-persistPaths-initContainer-resources-limits}
Limits are the limits part of the resources
limits
required <limit_name>:string {#dev-containers-persistPaths-initContainer-resources-limits}terminal
required
Terminal allows you to tell DevSpace to open a terminal with screen support to this container
terminal
required command
required string
Command is the command that should be executed on terminal start.
This command is executed within a shell.
command
required string workDir
required string
WorkDir is the working directory that is used to execute the command in.
workDir
required string enabled
required boolean false
If enabled is true, DevSpace will use the terminal. Can be also
used to disable the terminal if set to false. DevSpace makes sure
that within a pipeline only one dev configuration can open a terminal
at a time and subsequent dev terminals will fail.
enabled
required boolean false disableReplace
required boolean false
DisableReplace tells DevSpace to not replace the pod or adjust its settings
to make sure the pod is sleeping when opening a terminal
disableReplace
required boolean false disableScreen
required boolean false
DisableScreen will disable screen which is used by DevSpace by default to preserve
sessions if connections interrupt or the session is lost.
disableScreen
required boolean false disableTTY
required boolean false
DisableTTY will disable a tty shell for terminal command execution
disableTTY
required boolean false logs
required
Logs allows you to tell DevSpace to stream logs from this container to the console
logs
required attach
required
Attach allows you to tell DevSpace to attach to this container
attach
required enabled
required boolean false
Enabled can be used to enable attaching to a container
enabled
required boolean false disableReplace
required boolean false
DisableReplace prevents DevSpace from actually replacing the pod with modifications so that
the pod starts up correctly.
disableReplace
required boolean false disableTTY
required boolean false
DisableTTY is used to tell DevSpace to not use a TTY connection for attaching
disableTTY
required boolean false ssh
required
SSH allows you to create an SSH tunnel to this container
ssh
required enabled
required boolean false
Enabled can be used to enable the ssh server within the container. By default,
DevSpace will generate the required keys and create an entry in your ~/.ssh/config
for this container that can be used via ssh dev-config-name.dev-project-name.devspace
enabled
required boolean false ssh dev-config-name.dev-project-name.devspace
localHostname
required string
LocalHostname is the local ssh host to write to the ~/.ssh/config
localHostname
required string localPort
required integer
LocalPort is the local port to forward from, if empty will be random
localPort
required integer remoteAddress
required string
RemoteAddress is the address to listen to inside the container
remoteAddress
required string useInclude
required boolean false
UseInclude tells DevSpace to use a the file ~/.ssh/devspace_config for its ssh entries. DevSpace
will also create an import for its own entries inside ~/.ssh/config, this is a cleaner way,
but unfortunately not all SSH clients support this.
useInclude
required boolean false proxyCommands
required object[]
ProxyCommands allow you to proxy certain local commands to the container
proxyCommands
required object[] gitCredentials
required boolean false
GitCredentials configures a git credentials helper inside the container that proxies local git credentials
gitCredentials
required boolean false command
required string
Command is the name of the command that should be available in the remote container. DevSpace
will create a small script for that inside the container that redirect command execution to
the local computer.
command
required string localCommand
required string
LocalCommand can be used to run a different command than specified via the command option. By
default, this will be assumed to be the same as command.
localCommand
required string skipContainerEnv
required boolean false
SkipContainerEnv will not forward the container environment variables to the local command
skipContainerEnv
required boolean false env
required <env_name>:string
Env are extra environment variables to set for the command
env
required <env_name>:string restartHelper
required
RestartHelper holds restart helper specific configuration. The restart helper is used to delay starting of
the container and restarting it and is injected via an annotation in the replaced pod.
restartHelper
required &&
For SelectorsIf multiple selectors (e.g. imageSelector
and labelSelector
) are specified, DevSpace will combine them with a logical AND (&&
) when looking for a pod/container to match the specified conditions.
2. Add Dev Connections
Dev connections defines how your local machine and IDE is connected to the dev container that runs in Kubernetes.
Common dev connections include:
- Bi-directional file sync to make sure files on localhost and inside the containers main working dir are kept in sync
- Port forwarding (and reverse port forwarding) to allow engineers to access services inside the dev container via localhost on their local machine (and vice versa)
- Connecting the local terminal to the dev container either by starting a new terminal session, by attaching the container's entrypoint process, or by simply streaming the container logs
- Injecting an SSH server into the dev container to SSH into the container, e.g. to use the remote environment capabilities in IDEs such as VS Code
- Auto-restart the container to create a hot reloading experience without the need for image building
- Proxy certain commands to make commands on the local machine accessible inside the container (e.g. be able to run
kubectl
commands inside the dev container without having to copy credentials inside the dev container) - Auto-open URLs to provide a starting point for the engineer when the dev container is ready to go
3. Modify Container For Development
Because the idea behind dev containers is that you just deploy your prod/stable containers and then turn one or even multiple containers into dev containers later on when you actually want to work on them, DevSpace allows you to make modifications for these containers on-the-fly.
A common example for modifying a container to optimize it for development would be to use the devImage
feature which tells DevSpace to swap out the container's prod/stable image with a prebuilt dev-optimized image (e.g. that contains a remote debugger and other dev tooling).
devImage
required string
DevImage is the image to use for this container and will replace the existing image
if necessary.
devImage
required string command
required string[]
Command can be used to override the entrypoint of the container
command
required string[] args
required string[]
Args can be used to override the args of the container
args
required string[] workingDir
required string
WorkingDir can be used to override the working dir of the container
workingDir
required string env
required object[]
Env can be used to add environment variables to the container. DevSpace will
not replace existing environment variables if an environment variable is defined here.
env
required object[] resources
required
Resources can be used to override the resource definitions of the container
resources
required persistenceOptions
required
PersistenceOptions are additional options for persisting paths within this pod
persistenceOptions
required size
required string
Size is the size of the created persistent volume in Kubernetes size notation like 5Gi
size
required string storageClassName
required string
StorageClassName is the storage type DevSpace should use for this persistent volume
storageClassName
required string accessModes
required string[]
AccessModes are the access modes DevSpace should use for the persistent volume
accessModes
required string[] readOnly
required boolean false
ReadOnly specifies if the volume should be read only
readOnly
required boolean false name
required string
Name is the name of the PVC that should be created. If a PVC with that name
already exists, DevSpace will use that PVC instead of creating one.
name
required string patches
required object[]
Patches are additional changes to the pod spec that should be applied
patches
required object[] Start Development Mode
Start the development mode using this command:
devspace dev
Running devspace dev
multiple times in parallel for the same project does not work and returns a fatal error because multiple instances of port forwarding and file sync will disturb each other. However, running devspace dev
for several different projects (i.e. 2 different devspace.yaml
files with different name
) works seamlessly.
Config Reference
dev
required <dev_name>:object
Dev holds development configuration. Each dev configuration targets a single pod and enables certain dev services on that pod
or even rewrites it if certain changes are requested, such as adding an environment variable or changing the entrypoint.
Dev allows you to:
- sync local folders to the Kubernetes pod
- port forward remote ports to your local computer
- forward local ports into the Kubernetes pod
- configure an ssh tunnel to the Kubernetes pod
- proxy local commands to the container
- restart the container on file changes
dev
required <dev_name>:object <dev_name>
required string
Name of the dev configuration
<dev_name>
required string imageSelector
required string
ImageSelector to select a pod
imageSelector
required string labelSelector
required <labelSelector_name>:string
LabelSelector to select a pod
labelSelector
required <labelSelector_name>:string namespace
required string
Namespace where to select the pod
namespace
required string container
required string
Container is the container name these services should get started.
container
required string arch
required string
Target Container architecture to use for the devspacehelper (currently amd64 or arm64). Defaults to amd64, but
devspace tries to find out the architecture by itself by looking at the node this container runs on.
arch
required string containers
required <container_name>:object
containers
required <container_name>:object container
required string
Container is the container name these services should get started.
container
required string arch
required string
Target Container architecture to use for the devspacehelper (currently amd64 or arm64). Defaults to amd64, but
devspace tries to find out the architecture by itself by looking at the node this container runs on.
arch
required string devImage
required string
DevImage is the image to use for this container and will replace the existing image
if necessary.
devImage
required string command
required string[]
Command can be used to override the entrypoint of the container
command
required string[] args
required string[]
Args can be used to override the args of the container
args
required string[] workingDir
required string
WorkingDir can be used to override the working dir of the container
workingDir
required string env
required object[]
Env can be used to add environment variables to the container. DevSpace will
not replace existing environment variables if an environment variable is defined here.
env
required object[] reversePorts
required object[]
ReversePorts are port mappings to make local ports available inside the container
reversePorts
required object[] port
required string
Port is a port mapping that maps the localPort:remotePort. So if
you port forward the remote port will be available at the local port.
If you do reverse port forwarding, the local port will be available
at the remote port in the container. If only port is specified, local and
remote port are the same.
port
required string bindAddress
required string
BindAddress is the address DevSpace should listen on. Optional and defaults
to localhost.
bindAddress
required string sync
required object[]
Sync allows you to sync certain local paths with paths inside the container
sync
required object[] path
required string
Path is the path to sync. This can be defined in the form localPath:remotePath. You can also use '.'
to specify either the local or remote working directory. This is valid for example: .:.
path
required string excludePaths
required string[]
ExcludePaths is an array of file patterns in gitignore format to exclude.
excludePaths
required string[] excludeFile
required string
ExcludeFile loads the file patterns to exclude from a file.
excludeFile
required string downloadExcludePaths
required string[]
DownloadExcludePaths is an array of file patterns in gitignore format to exclude from downloading
downloadExcludePaths
required string[] downloadExcludeFile
required string
DownloadExcludeFile loads the file patterns to exclude from downloading from a file.
downloadExcludeFile
required string uploadExcludePaths
required string[]
UploadExcludePaths is an array of file patterns in gitignore format to exclude from uploading
uploadExcludePaths
required string[] uploadExcludeFile
required string
UploadExcludeFile loads the file patterns to exclude from uploading from a file.
uploadExcludeFile
required string startContainer
required boolean false
StartContainer will start the container after initial sync is done. This will
inject a devspacehelper into the pod and you need to define dev.*.command for
this to work.
startContainer
required boolean false onUpload
required
OnUpload can be used to execute certain commands on uploading either in the container or locally as
well as restart the container after a file changed has happened.
onUpload
required restartContainer
required boolean false
If true restart container will try to restart the container after a change has been made. Make sure that
images.*.injectRestartHelper is enabled for the container that should be restarted or the devspace-restart-helper
script is present in the container root folder.
restartContainer
required boolean false exec
required object[]
Exec will execute the given commands in order after a sync operation
exec
required object[] ####### name
required string {#dev-containers-sync-onUpload-exec-name}
Name is the name to show for this exec in the logs
name
required string {#dev-containers-sync-onUpload-exec-name}####### command
required string {#dev-containers-sync-onUpload-exec-command}
Command is the command to execute. If no args are specified this is executed
within a shell.
command
required string {#dev-containers-sync-onUpload-exec-command}####### args
required string[] {#dev-containers-sync-onUpload-exec-args}
Args are arguments to pass to the command
args
required string[] {#dev-containers-sync-onUpload-exec-args}####### failOnError
required boolean false {#dev-containers-sync-onUpload-exec-failOnError}
FailOnError specifies if the sync should fail if the command fails
failOnError
required boolean false {#dev-containers-sync-onUpload-exec-failOnError}####### local
required boolean false {#dev-containers-sync-onUpload-exec-local}
Local specifies if the command should be executed locally instead of within the
container
local
required boolean false {#dev-containers-sync-onUpload-exec-local}####### once
required boolean false {#dev-containers-sync-onUpload-exec-once}
Once executes this command only once in the container's life. Can be used to initialize
a container before starting it, but after everything was synced.
once
required boolean false {#dev-containers-sync-onUpload-exec-once}####### onChange
required string[] {#dev-containers-sync-onUpload-exec-onChange}
OnChange is an array of file patterns that trigger this command execution
onChange
required string[] {#dev-containers-sync-onUpload-exec-onChange}initialSync
required string
InitialSync defines the initial sync strategy to use when this sync starts. Defaults to mirrorLocal
You can completely disable this using the initialSync: disabled
option.
initialSync
required string initialSync: disabled
option.waitInitialSync
required boolean false
WaitInitialSync can be used to tell DevSpace to not wait until the initial sync is done
waitInitialSync
required boolean false initialSyncCompareBy
required string
InitialSyncCompareBy defines if the sync should only compare by the given type. Either mtime or size are possible
initialSyncCompareBy
required string disableDownload
required boolean false
DisableDownload will disable downloading completely
disableDownload
required boolean false disableUpload
required boolean false
DisableUpload will disable uploading completely
disableUpload
required boolean false bandwidthLimits
required
BandwidthLimits can be used to limit the amount of bytes that are transferred by DevSpace with this
sync configuration
bandwidthLimits
required polling
required boolean false
Polling will tell the remote container to use polling instead of inotify
polling
required boolean false noWatch
required boolean false
NoWatch will terminate the sync after the initial sync is done
noWatch
required boolean false file
required boolean false
File signals DevSpace that this is a single file that should get synced instead of a whole directory
file
required boolean false persistPaths
required object[]
PersistPaths allows you to persist certain paths within this container with a persistent volume claim
persistPaths
required object[] path
required string
Path is the container path that should get persisted. By default, DevSpace will create an init container
that will copy over the contents of this folder from the existing image.
path
required string volumePath
required string
VolumePath is the sub path on the volume that is mounted as persistent volume for this path
volumePath
required string readOnly
required boolean false
ReadOnly will make the persistent path read only to the user
readOnly
required boolean false skipPopulate
required boolean false
SkipPopulate will not create an init container to copy over the existing contents if true
skipPopulate
required boolean false initContainer
required
InitContainer holds additional options for the persistent path init container
initContainer
required resources
required
Resources are the resources used by the persistent path init container
resources
required ####### requests
required <request_name>:string {#dev-containers-persistPaths-initContainer-resources-requests}
Requests are the requests part of the resources
requests
required <request_name>:string {#dev-containers-persistPaths-initContainer-resources-requests}####### limits
required <limit_name>:string {#dev-containers-persistPaths-initContainer-resources-limits}
Limits are the limits part of the resources
limits
required <limit_name>:string {#dev-containers-persistPaths-initContainer-resources-limits}terminal
required
Terminal allows you to tell DevSpace to open a terminal with screen support to this container
terminal
required command
required string
Command is the command that should be executed on terminal start.
This command is executed within a shell.
command
required string workDir
required string
WorkDir is the working directory that is used to execute the command in.
workDir
required string enabled
required boolean false
If enabled is true, DevSpace will use the terminal. Can be also
used to disable the terminal if set to false. DevSpace makes sure
that within a pipeline only one dev configuration can open a terminal
at a time and subsequent dev terminals will fail.
enabled
required boolean false disableReplace
required boolean false
DisableReplace tells DevSpace to not replace the pod or adjust its settings
to make sure the pod is sleeping when opening a terminal
disableReplace
required boolean false disableScreen
required boolean false
DisableScreen will disable screen which is used by DevSpace by default to preserve
sessions if connections interrupt or the session is lost.
disableScreen
required boolean false disableTTY
required boolean false
DisableTTY will disable a tty shell for terminal command execution
disableTTY
required boolean false logs
required
Logs allows you to tell DevSpace to stream logs from this container to the console
logs
required attach
required
Attach allows you to tell DevSpace to attach to this container
attach
required enabled
required boolean false
Enabled can be used to enable attaching to a container
enabled
required boolean false disableReplace
required boolean false
DisableReplace prevents DevSpace from actually replacing the pod with modifications so that
the pod starts up correctly.
disableReplace
required boolean false disableTTY
required boolean false
DisableTTY is used to tell DevSpace to not use a TTY connection for attaching
disableTTY
required boolean false ssh
required
SSH allows you to create an SSH tunnel to this container
ssh
required enabled
required boolean false
Enabled can be used to enable the ssh server within the container. By default,
DevSpace will generate the required keys and create an entry in your ~/.ssh/config
for this container that can be used via ssh dev-config-name.dev-project-name.devspace
enabled
required boolean false ssh dev-config-name.dev-project-name.devspace
localHostname
required string
LocalHostname is the local ssh host to write to the ~/.ssh/config
localHostname
required string localPort
required integer
LocalPort is the local port to forward from, if empty will be random
localPort
required integer remoteAddress
required string
RemoteAddress is the address to listen to inside the container
remoteAddress
required string useInclude
required boolean false
UseInclude tells DevSpace to use a the file ~/.ssh/devspace_config for its ssh entries. DevSpace
will also create an import for its own entries inside ~/.ssh/config, this is a cleaner way,
but unfortunately not all SSH clients support this.
useInclude
required boolean false proxyCommands
required object[]
ProxyCommands allow you to proxy certain local commands to the container
proxyCommands
required object[] gitCredentials
required boolean false
GitCredentials configures a git credentials helper inside the container that proxies local git credentials
gitCredentials
required boolean false command
required string
Command is the name of the command that should be available in the remote container. DevSpace
will create a small script for that inside the container that redirect command execution to
the local computer.
command
required string localCommand
required string
LocalCommand can be used to run a different command than specified via the command option. By
default, this will be assumed to be the same as command.
localCommand
required string skipContainerEnv
required boolean false
SkipContainerEnv will not forward the container environment variables to the local command
skipContainerEnv
required boolean false env
required <env_name>:string
Env are extra environment variables to set for the command
env
required <env_name>:string restartHelper
required
RestartHelper holds restart helper specific configuration. The restart helper is used to delay starting of
the container and restarting it and is injected via an annotation in the replaced pod.
restartHelper
required devImage
required string
DevImage is the image to use for this container and will replace the existing image
if necessary.
devImage
required string command
required string[]
Command can be used to override the entrypoint of the container
command
required string[] args
required string[]
Args can be used to override the args of the container
args
required string[] workingDir
required string
WorkingDir can be used to override the working dir of the container
workingDir
required string env
required object[]
Env can be used to add environment variables to the container. DevSpace will
not replace existing environment variables if an environment variable is defined here.
env
required object[] resources
required
Resources can be used to override the resource definitions of the container
resources
required persistenceOptions
required
PersistenceOptions are additional options for persisting paths within this pod
persistenceOptions
required size
required string
Size is the size of the created persistent volume in Kubernetes size notation like 5Gi
size
required string storageClassName
required string
StorageClassName is the storage type DevSpace should use for this persistent volume
storageClassName
required string accessModes
required string[]
AccessModes are the access modes DevSpace should use for the persistent volume
accessModes
required string[] readOnly
required boolean false
ReadOnly specifies if the volume should be read only
readOnly
required boolean false name
required string
Name is the name of the PVC that should be created. If a PVC with that name
already exists, DevSpace will use that PVC instead of creating one.
name
required string patches
required object[]
Patches are additional changes to the pod spec that should be applied
patches
required object[] reversePorts
required object[]
ReversePorts are port mappings to make local ports available inside the container
reversePorts
required object[] port
required string
Port is a port mapping that maps the localPort:remotePort. So if
you port forward the remote port will be available at the local port.
If you do reverse port forwarding, the local port will be available
at the remote port in the container. If only port is specified, local and
remote port are the same.
port
required string bindAddress
required string
BindAddress is the address DevSpace should listen on. Optional and defaults
to localhost.
bindAddress
required string ports
required object[]
Ports defines port mappings from the remote pod that should be forwarded to your local
computer
ports
required object[] port
required string
Port is a port mapping that maps the localPort:remotePort. So if
you port forward the remote port will be available at the local port.
If you do reverse port forwarding, the local port will be available
at the remote port in the container. If only port is specified, local and
remote port are the same.
port
required string bindAddress
required string
BindAddress is the address DevSpace should listen on. Optional and defaults
to localhost.
bindAddress
required string sync
required object[]
Sync allows you to sync certain local paths with paths inside the container
sync
required object[] path
required string
Path is the path to sync. This can be defined in the form localPath:remotePath. You can also use '.'
to specify either the local or remote working directory. This is valid for example: .:.
path
required string excludePaths
required string[]
ExcludePaths is an array of file patterns in gitignore format to exclude.
excludePaths
required string[] excludeFile
required string
ExcludeFile loads the file patterns to exclude from a file.
excludeFile
required string downloadExcludePaths
required string[]
DownloadExcludePaths is an array of file patterns in gitignore format to exclude from downloading
downloadExcludePaths
required string[] downloadExcludeFile
required string
DownloadExcludeFile loads the file patterns to exclude from downloading from a file.
downloadExcludeFile
required string uploadExcludePaths
required string[]
UploadExcludePaths is an array of file patterns in gitignore format to exclude from uploading
uploadExcludePaths
required string[] uploadExcludeFile
required string
UploadExcludeFile loads the file patterns to exclude from uploading from a file.
uploadExcludeFile
required string startContainer
required boolean false
StartContainer will start the container after initial sync is done. This will
inject a devspacehelper into the pod and you need to define dev.*.command for
this to work.
startContainer
required boolean false onUpload
required
OnUpload can be used to execute certain commands on uploading either in the container or locally as
well as restart the container after a file changed has happened.
onUpload
required restartContainer
required boolean false
If true restart container will try to restart the container after a change has been made. Make sure that
images.*.injectRestartHelper is enabled for the container that should be restarted or the devspace-restart-helper
script is present in the container root folder.
restartContainer
required boolean false exec
required object[]
Exec will execute the given commands in order after a sync operation
exec
required object[] name
required string
Name is the name to show for this exec in the logs
name
required string command
required string
Command is the command to execute. If no args are specified this is executed
within a shell.
command
required string args
required string[]
Args are arguments to pass to the command
args
required string[] failOnError
required boolean false
FailOnError specifies if the sync should fail if the command fails
failOnError
required boolean false local
required boolean false
Local specifies if the command should be executed locally instead of within the
container
local
required boolean false once
required boolean false
Once executes this command only once in the container's life. Can be used to initialize
a container before starting it, but after everything was synced.
once
required boolean false onChange
required string[]
OnChange is an array of file patterns that trigger this command execution
onChange
required string[] initialSync
required string
InitialSync defines the initial sync strategy to use when this sync starts. Defaults to mirrorLocal
initialSync
required string waitInitialSync
required boolean false
WaitInitialSync can be used to tell DevSpace to not wait until the initial sync is done
waitInitialSync
required boolean false initialSyncCompareBy
required string
InitialSyncCompareBy defines if the sync should only compare by the given type. Either mtime or size are possible
initialSyncCompareBy
required string disableDownload
required boolean false
DisableDownload will disable downloading completely
disableDownload
required boolean false disableUpload
required boolean false
DisableUpload will disable uploading completely
disableUpload
required boolean false bandwidthLimits
required
BandwidthLimits can be used to limit the amount of bytes that are transferred by DevSpace with this
sync configuration
bandwidthLimits
required polling
required boolean false
Polling will tell the remote container to use polling instead of inotify
polling
required boolean false noWatch
required boolean false
NoWatch will terminate the sync after the initial sync is done
noWatch
required boolean false file
required boolean false
File signals DevSpace that this is a single file that should get synced instead of a whole directory
file
required boolean false persistPaths
required object[]
PersistPaths allows you to persist certain paths within this container with a persistent volume claim
persistPaths
required object[] path
required string
Path is the container path that should get persisted. By default, DevSpace will create an init container
that will copy over the contents of this folder from the existing image.
path
required string volumePath
required string
VolumePath is the sub path on the volume that is mounted as persistent volume for this path
volumePath
required string readOnly
required boolean false
ReadOnly will make the persistent path read only to the user
readOnly
required boolean false skipPopulate
required boolean false
SkipPopulate will not create an init container to copy over the existing contents if true
skipPopulate
required boolean false initContainer
required
InitContainer holds additional options for the persistent path init container
initContainer
required terminal
required
Terminal allows you to tell DevSpace to open a terminal with screen support to this container
terminal
required command
required string
Command is the command that should be executed on terminal start.
This command is executed within a shell.
command
required string workDir
required string
WorkDir is the working directory that is used to execute the command in.
workDir
required string enabled
required boolean false
If enabled is true, DevSpace will use the terminal. Can be also
used to disable the terminal if set to false. DevSpace makes sure
that within a pipeline only one dev configuration can open a terminal
at a time and subsequent dev terminals will fail.
enabled
required boolean false disableReplace
required boolean false
DisableReplace tells DevSpace to not replace the pod or adjust its settings
to make sure the pod is sleeping when opening a terminal
disableReplace
required boolean false disableScreen
required boolean false
DisableScreen will disable screen which is used by DevSpace by default to preserve
sessions if connections interrupt or the session is lost.
disableScreen
required boolean false disableTTY
required boolean false
DisableTTY will disable a tty shell for terminal command execution
disableTTY
required boolean false logs
required
Logs allows you to tell DevSpace to stream logs from this container to the console
logs
required attach
required
Attach allows you to tell DevSpace to attach to this container
attach
required enabled
required boolean false
Enabled can be used to enable attaching to a container
enabled
required boolean false disableReplace
required boolean false
DisableReplace prevents DevSpace from actually replacing the pod with modifications so that
the pod starts up correctly.
disableReplace
required boolean false disableTTY
required boolean false
DisableTTY is used to tell DevSpace to not use a TTY connection for attaching
disableTTY
required boolean false ssh
required
SSH allows you to create an SSH tunnel to this container
ssh
required enabled
required boolean false
Enabled can be used to enable the ssh server within the container. By default,
DevSpace will generate the required keys and create an entry in your ~/.ssh/config
for this container that can be used via ssh dev-config-name.dev-project-name.devspace
enabled
required boolean false ssh dev-config-name.dev-project-name.devspace
localHostname
required string
LocalHostname is the local ssh host to write to the ~/.ssh/config
localHostname
required string localPort
required integer
LocalPort is the local port to forward from, if empty will be random
localPort
required integer remoteAddress
required string
RemoteAddress is the address to listen to inside the container
remoteAddress
required string useInclude
required boolean false
UseInclude tells DevSpace to use a the file ~/.ssh/devspace_config for its ssh entries. DevSpace
will also create an import for its own entries inside ~/.ssh/config, this is a cleaner way,
but unfortunately not all SSH clients support this.
useInclude
required boolean false proxyCommands
required object[]
ProxyCommands allow you to proxy certain local commands to the container
proxyCommands
required object[] gitCredentials
required boolean false
GitCredentials configures a git credentials helper inside the container that proxies local git credentials
gitCredentials
required boolean false command
required string
Command is the name of the command that should be available in the remote container. DevSpace
will create a small script for that inside the container that redirect command execution to
the local computer.
command
required string localCommand
required string
LocalCommand can be used to run a different command than specified via the command option. By
default, this will be assumed to be the same as command.
localCommand
required string skipContainerEnv
required boolean false
SkipContainerEnv will not forward the container environment variables to the local command
skipContainerEnv
required boolean false env
required <env_name>:string
Env are extra environment variables to set for the command
env
required <env_name>:string restartHelper
required
RestartHelper holds restart helper specific configuration. The restart helper is used to delay starting of
the container and restarting it and is injected via an annotation in the replaced pod.
restartHelper
required