devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.

APACHE-2.0 License

Downloads
5.8K
Stars
4.1K
Committers
101

Bot releases are hidden (Show)

devspace - v4.13.0

Published by FabianKramm over 4 years ago

New Features

  • devspace is now able to reverse port-forward specific local ports to a remote pod. This means you can access certain ports on the local machine within the pod. This feature can be configured via the new config option dev.ports.reverseForward (#1030)
  • New config option images.*.appendDockerfileInstructions that specifies additional instructions that will be appended to the dockerfile during the build process. This makes it possible to execute certain Dockerfile instructions only during development without changing the Dockerfile itself.
  • You can now pass flags to the devspace run command: devspace --run-flag run command --command-flag
  • New --dependency flag for devspace run that will execute a command from a specific dependency. devspace will also switch the current working directory to the dependency path. Only works for dependencies that have a dependencies.*.name configured.
  • New --dependency flag for devspace build that will build only images from a specific dependency. Only works for dependencies that have a dependencies.*.name configured. (#1113)
  • New config option commands.description to describe devspace commands, that is shown via devspace list commands (#1115)

Other Changes

  • Fixes an issue where a container restart after a sync operation was not possible for non root users (#1086)
  • Added auto completion scripts for various shells (#1114)
  • devspace now automatically installs kubectl if it cannot be found in the PATH and is defined as a deployment method
  • Updated internal kubernetes & helm versions
devspace - v4.13.0-beta.1

Published by LukasGentele over 4 years ago

devspace - v4.12.5

Published by LukasGentele over 4 years ago

Fixes

  • Fixes issues when installing devspace via npm
devspace - v4.12.5-beta.3

Published by LukasGentele over 4 years ago

devspace - v4.12.5-beta.2

Published by LukasGentele over 4 years ago

devspace - v4.12.5-beta.1

Published by LukasGentele over 4 years ago

devspace - v4.12.4

Published by FabianKramm over 4 years ago

Changes

  • Update internal helm version to v3.2.1
  • Update internal kubernetes version to v1.18.0
  • Fixes an issue with the dependency purge waiting message if specific dependencies are targeted
  • Fixes a potential endless loop while searching for an open ui port (#1101)
devspace - v4.12.4-beta.1

Published by FabianKramm over 4 years ago

Changes

  • Update internal helm version to v3.2.1
  • Update internal kubernetes version to v1.18.0
  • Fixes an issue with the dependency purge waiting message if specific dependencies are targeted
  • Fixes a potential endless loop while searching for an open ui port (#1101)
devspace - v4.12.3

Published by FabianKramm over 4 years ago

Changes

  • Improved the npm installer
  • Fixed an issue where the terminal in the frontend UI wouldn't open for some pods
  • Fixed a potential nil pointer during kaniko build (#1097)
devspace - v4.12.2

Published by FabianKramm over 4 years ago

Changes

  • Improved environment flag parsing and commands like DEVSPACE_ENTER_FLAGS=--namespace=test devspace --pod test enter should work now correctly
  • Environment default flags can now be set for every command including subcommands (e.g. devspace create space -> DEVSPACE_CREATE_SPACE_FLAGS)
  • Fixes an issue where devspace was not correctly parsing command arguments (#977)
  • Fixes a nil pointer in the docker authentification if no docker config exists (#1076)
  • Fixes an issue where devspace was parsing kustomize version incorrectly for newer kustomize versions (#859)
devspace - v4.12.1

Published by FabianKramm over 4 years ago

Changes

  • If the .env file cannot be loaded, devspace will only print a warning instead of a fatal
  • The flags --switch-context, --namespace and --kube-context can now be used together. --kube-context and --namespace take precedence over --switch-context
  • Fixes an issue where the .env file could cause issues in combination with devspace-cloud spaces (#1068)
devspace - v4.12.0

Published by FabianKramm over 4 years ago

Changes

  • Devspace is now able to load environment variables from an .env file (like docker-compose) in the project folder (#1068)
  • You can now set default flags for devspace via the environment variable DEVSPACE_FLAGS, futhermore it is possible to set default flags for certain commands only with the environment variables in the form of DEVSPACE_[COMMAND]_FLAGS, e.g. DEVSPACE_BUILD_FLAGS for devspace build, DEVSPACE_DEV_FLAGS for devspace dev etc. (#1068)
  • Adds an option to force variables as string values with $!{myvariable} (by default, variables will now have the same type as their default value if it is defined in devspace.yaml)
  • devspace use context/namespace/space and devspace create space now resets the context & namespace for the project as well
  • Improved sync error messages if compressing or decompressing fails

Fixes

  • Fixes an issue where devspace enter has no output in non shell environments
  • Fixes an issue where the wrong sync error message was displayed (#892)
  • Fixes an issue where the default value of a variable was converted to an integer or boolean (#1069)
  • Fixes an issue where defining variables in the command section was not possible and resulted in an error silenced logger cannot ask questions
devspace - v4.12.0-beta.1

Published by FabianKramm over 4 years ago

Changes

  • Devspace is now able to load environment variables from an .env file (like docker-compose) in the project folder (#1068)
  • You can now set default flags for devspace via the environment variable DEVSPACE_FLAGS, futhermore it is possible to set default flags for certain commands only with the environment variables in the form of DEVSPACE_[COMMAND]_FLAGS, e.g. DEVSPACE_BUILD_FLAGS for devspace build, DEVSPACE_DEV_FLAGS for devspace dev etc. (#1068)
  • Adds an option to force variables as string values with $!{myvariable} (by default, variables will now have the same type as their default value if it is defined in devspace.yaml)
  • devspace use context/namespace/space and devspace create space now resets the context & namespace for the project as well
  • Improved sync error messages if compressing or decompressing fails

Fixes

  • Fixes an issue where devspace enter has no output in non shell environments
  • Fixes an issue where the wrong sync error message was displayed (#892)
  • Fixes an issue where the default value of a variable was converted to an integer or boolean (#1069)
  • Fixes an issue where defining variables in the command section was not possible and resulted in an error silenced logger cannot ask questions
devspace - v4.11.1

Published by LukasGentele over 4 years ago

Fixes

  • fix issue where initial-sync did not respect exclude paths
  • fix issue with npm installer on linux and mac
devspace - v4.11.0

Published by LukasGentele over 4 years ago

Automatic Container Restart

In compiled programming languages such as golang it is cumbersome to build a container that is able to automatically reload on a file change. With v4.11.0 and config version v1beta9, DevSpace is able to do the heavy lifting for you and simplifies the process drastically in a non invasive way. You only have to set 2 config options in the devspace.yaml and it should work for most Dockerfiles and applications out of the box. This example configuration will tell DevSpace to start an application in restart mode and the sync to restart the container after a change:

version: v1beta9
images:
  default:
    image: myusername/devspace
    # this new option tells devspace to automatically wrap the Dockerfile entrypoint in memory
    # with a small restart helper script so that the process can be easily restarted from within the 
    # container. This should work with most Dockerfiles that have an ENTRYPOINT statement. 
    # This will also work for build targets.
    # Note: If you override the entrypoint in the kubernetes yaml via the Pod.spec.containers.command,
    # please make sure you wrap the command with the devspace script '/devspace-restart-helper'
    injectRestartHelper: true
    # If you don't have an entrypoint defined in your Dockerfile, you can also define an entrypoint here
    # entrypoint: ["go"] 
    # cmd: ["run", "main.go"]
dev:
  sync:
  - imageName: default
    onUpload:
      # this new option tells DevSpace to restart the container process if something changes within
      # the container. This obviously only works if the restart helper script is present in the container.
      # You can either manually add the restart script or add the injectRestartHelper option to the image
      restartContainer: true
deployments:
 ...

So you just have to add these two new options and your containers can be restarted without changing the Dockerfile or any other files. This makes developing golang and other compiled languages way more fun! For a complete example you can take a look at hot-reload-container-restart.

How does it work?

The new option injectRestartHelper tells DevSpace to rewrite the Dockerfile in memory and add the inject script. It will also inject the actual script contents into the context sent to the docker daemon or to the kaniko pod. The resulting Dockerfile will look like this:

## Original Dockerfile
FROM myimage
RUN mycommand
ENTRYPOINT ["go","run","main.go"]
...

## Injected by DevSpace
COPY /.devspace/devspace-restart-helper /
ENTRYPOINT ["/devspace-restart-helper","go","run","main.go"]

DevSpace makes sure that the script at the context path /.devspace/devspace-restart-helper does exist. The script itself is just a simple shell script that starts and restarts a given command:

#
# A process wrapper script to simulate a container restart. This file was injected with devspace during the build process
#

set -e

pid=""

trap quit TERM INT

quit() {
  if [ -n "$pid" ]; then
    kill $pid
  fi
}

while true; do
    setsid "$@" &
    pid=$!
    echo "$pid" > /devspace-pid
    set +e
    wait $pid
    exit_code=$?
    if [ -f /devspace-pid ]; then
		# if the sync is currently active we try to restart instead of exiting
		if [ -f /tmp/sync ]; then
			rm -f /devspace-pid 	
			printf "\nContainer exited with $exit_code. Will restart in 7 seconds...\n"
			sleep 7
		else
			exit $exit_code
		fi
    fi
    set -e
    printf "\nRestart container\n"
done

This by itself is not doing much, however if you configure the dev.sync.onUpload.restartContainer option, DevSpace will automatically kill the container entrypoint on file change and the script will restart the container entrypoint. The container is only restarted after a batch of changes and not on every file change to reduce the amounts of restarts if a lot of changes are uploaded.

Other Changes

  • New config version v1beta9 (old config versions will get converted in memory automatically as always):
    • new images.*.injectRestartHelper: if this option is true DevSpace injects a small restart script into the container and wraps the entrypoint of that container with this script, so DevSpace is able to restart the main container process during the sync process. Only works if there is either an Entrypoint defined in the DevSpace config or in the dockerfile for this image, otherwise DevSpace will fail. See Container Restart above for more information.
    • new dev.sync.*.onUpload.restartContainer: if this option is true DevSpace will try to restart the container main process after a change has been made. Only works if images.*.injectRestartHelper is enabled for the container that should be restarted or the devspace-restart-helper script is present in the container root folder. See Container Restart above for more information.
    • new dev.sync.*.onUpload.execRemote.onBatch: executes the given command after a batch of changes has been processed. DevSpace will wait for the command to finish and then will continue execution. This is useful for commands that shouldn't be executed after every single change that may take a little bit longer like recompiling etc.
    • new images.*.preferSyncOverRebuild: if enabled, DevSpace will not rebuild the image even though files have changed within the building context if a syncpath for this image is defined. Since this was the default behavior for all images before this change, older config versions will convert this to be enabled so that this is a non breaking change.
  • DevSpace now prefers docker over kaniko if both are set in the config
devspace - v4.11.0-beta.2

Published by FabianKramm over 4 years ago

devspace - v4.10.0

Published by FabianKramm over 4 years ago

Changes

  • New --image flag for devspace enter, devspace logs & devspace attach that selects a pod by the provided devspace config image name
  • New option images.*.build.kaniko.image that makes it possible to specify a custom kaniko build image
  • New option images.*.build.kaniko.additionalMounts that allows to specify additional custom mounts for the kaniko pods

Fixes

  • Fixed an issue that could lead to devspace uploading a corrupt sync helper binary into a container which resulted in the sync error command terminated with exit code 139
devspace - v4.9.4

Published by FabianKramm over 4 years ago

Changes

  • Fixes an issue where the option images.*.build.kaniko.cache had no effect
devspace - v4.9.3

Published by FabianKramm over 4 years ago

Changes

  • Fixes an issue where kubectl deployments with older versions of kubectl would only deploy a single yaml
  • devspace now caches kube clients to avoid the constructing many client instances from the same exec auth config warning
  • devspace now shows the docker image building output if all images are disabled except one
devspace - v4.9.1

Published by LukasGentele over 4 years ago

Potentially Breaking

With devspace version v4.9.0 and onwards, git dependencies (dependencies.*.source.git) are ONLY deployed via the locally installed git cli and NOT via the integrated git client in devspace anymore. Please make sure you have a git binary locally installed on your computer or in your pipeline environment where you use devspace with git dependencies and that git binary is accessible via the path (if you don't, devspace will fail with an error message saying that you need to install git). This was done because there were certain discrepancies between the go-git client and the git cli which could lead to different behavior during dependency deployment and dependency updates, hence we opted to always use the git binary locally.

Changes

  • devspace now requires(!) git cli to clone git dependencies (see above)
  • devspace now by default clones dependencies with the --depth 1 option, you can disable this via the new dependencies.*.source.disableShallow option
  • New config option dependencies.*.source.cloneArgs to specify custom arguments for cloning a dependency (#1033)
  • devspace sync now creates the local sync path if it does not exist (#1031)
  • Predefined components were removed

Fixes

  • Fixes an issue where devspace deploy with kubectl 1.18 is not working anymore (#1034)
  • Fixes an issue where devspace was not waiting long enough for tiller to get ready
Package Rankings
Top 4.02% on Npmjs.org
Top 4.52% on Proxy.golang.org
Badges
Extracted from project README
Join us on Slack! Join us on Slack!
Related Projects