Skip to main content
Version: 4.x

Initialize a Project

Choose a Project

You can either deploy one of your own projects or alternatively, checkout one of our demo applications using git:

git clone https://github.com/devspace-cloud/quickstart-nodejs
cd quickstart-nodejs
Tutorials

Initialize Your Project

Run this command in your project directory to create a devspace.yaml config file for your project:

devspace init
DevSpace CLI - Initialize Project

While initializing your project, DevSpace will ask you a couple of questions and then create the config file devspace.yaml which will look similar to this one:

# Config version
version: v1beta9

# Defines all Dockerfiles that DevSpace will build, tag and push
images:
app: # Key 'app' = Name of this image
image: reg.tld/username/devspace # Registry and image name for pushing the image
preferSyncOverRebuild: true
injectRestartHelper: true
build: ...

# Defines an array of everything (component, Helm chart, Kubernetes maninfests)
# that will be deployed with DevSpace in the specified order
deployments:
- name: quickstart # Name of this deployment
helm: # Deploy using Helm
componentChart: true # Use the Component Helm Chart
values: # Override Values for chart (can also be set using valuesFiles option)
containers: # Defines an array of containers that run in the same pods started by this component
- image: reg.tld/username/devspace # Image of this container
service: # Expose this component with a Kubernetes service
ports: # Array of container ports to expose through the service
- port: 3000 # Exposes container port 3000 on service port 3000

# Settings for development mode (will be explained later)
dev: ...

# Settings for development mode (will be explained later)
profiles: ...

Prepare Kube-Context

To develop and deploy your project with DevSpace, you need a valid kube-context because DevSpace uses the kube-config file just like kubectl or helm.

Free Demo Namespace

If you don't have a Kubernetes cluster or simply want to test DevSpace without using your own cluster, choose the free demo namespaces sponsored by DevSpace Cloud. Learn more about Demo Spaces.

Run the following command to create a free Kubernetes namespace:

devspace create space my-app    # requires login via GitHub or email
Kube-Context

DevSpace automatically sets up a kube-context for this Space, so you can also access your namespace using kubectl, helm or any other Kubernetes tool. Try it:

kubectl get pods