Deis (pronounced DAY-iss) is an open source PaaS that makes it easy to deploy and manage applications on your own servers. Deis builds upon Docker and CoreOS to provide a lightweight PaaS with a Heroku-inspired workflow.
Deis has undergone several improvements recently. If you are updating from Deis version 0.7.0 or earlier, there are several big changes you should know about. Read the MIGRATING.md document for details.
If you need to use Deis with Chef integration, on Ubuntu 12.04 LTS, or on DigitalOcean, you should use the v0.7.0 release of Deis.
Deis is a set of Docker containers that can be deployed anywhere including public cloud, private cloud, bare metal or your workstation. Decide where you'd like to deploy Deis, then follow the deployment-specific documentation for Rackspace or EC2. Documentation for OpenStack and bare-metal provisioning are forthcoming.
Trying out Deis? Continue following these instructions for a local cluster setup. This is also a great Deis testing/development environment.
On your workstation:
- Install Vagrant and VirtualBox
- Install the fleetctl client: Install v0.2.0 from the fleet GitHub page.
- Install the Docker client if you want to run Docker commands locally (optional)
If you're on Ubuntu, you need to install the nfs-kernel-server package as it's required for sharing folders between your host and your CoreOS VM:
sudo apt-get install nfs-kernel-server
If you'd like to spin up more than one VM to test an entire cluster, there are a few additional prerequisites:
- Edit contrib/coreos/user-data and add a unique discovery URL generated from
https://discovery.etcd.io/new
- Set
DEIS_NUM_INSTANCES
to the desired size of your cluster:$ export DEIS_NUM_INSTANCES=3
Note that for scheduling to work properly, clusters must consist of at least 3 nodes and always have an odd number of members. For more information, see optimal etcd cluster size.
Deis clusters of less than 3 nodes are unsupported for anything other than local development. A painless 3+ node development environment is a priority.
First, start the CoreOS cluster on VirtualBox. From a command prompt, cd
to the root of the Deis project code and type:
$ vagrant up
This instructs Vagrant to spin up each VM. To be able to connect to the VMs, you must add your Vagrant-generated SSH key to the ssh-agent (fleetctl tunnel requires the agent to have this key):
$ ssh-add ~/.vagrant.d/insecure_private_key
Export some environment variables so you can connect to the VM using the docker
and fleetctl
clients on your workstation.
$ export DOCKER_HOST=tcp://172.17.8.100:4243
$ export FLEETCTL_TUNNEL=172.17.8.100
Use make pull
to download cached layers from the public Docker Index. Then use make build
to assemble all of the Deis components from Dockerfiles. Grab some coffee while it builds the images on each VM (it can take a while).
$ make pull
$ make build
Use make run
to start all Deis containers and attach to their log output. This can take some time - the registry service will pull and prepare a Docker image. Grab some more coffee!
$ make run
Your Vagrant VM is accessible at local.deisapp.com
. For clusters with more than one node, see our guide to Configuring DNS.
Integration tests and corresponding documentation can be found under the test/
folder.
These systemd services run the various containers which compose Deis, and can be stopped on a machine with sudo systemctl stop servicename
.
- deis-builder.service
- deis-cache.service
- deis-controller.service
- deis-database.service
- deis-discovery.service
- deis-logger.service
- deis-registry.service
- deis-router.service
Logging into one of the CoreOS machines and stopping a container service should cause the same component on another CoreOS host to take over as master. Similarly, bringing down a VM should enable the services on another VM to take over as master.
If you're using the latest Deis release, use pip install deis
to install the latest Deis Client or download pre-compiled binaries.
If you're working off master, precompiled binaries are likely out of date. You should either symlink the python file directly or build a local copy of the client:
$ ln -fs $(pwd)/client/deis.py /usr/local/bin/deis
or
$ cd client && python setup.py install
Use the Deis Client to register a new user.
$ deis register http://local.deisapp.com:8000
$ deis keys:add
Use deis keys:add
to add your SSH public key for git push
access.
Initalize a dev
cluster with a list of CoreOS hosts and your CoreOS private key.
$ deis clusters:create dev local.deisapp.com --hosts=local.deisapp.com --auth=~/.vagrant.d/insecure_private_key
The dev
cluster will be used as the default cluster for future deis
commands.
Create an application on the default dev
cluster.
$ deis create
Use deis create --cluster=prod
to place the app on a different cluster. Don't like our name-generator? Use deis create myappname
.
Push builds of your application from your local git repository or from a Docker Registry. Each build creates a new release, which can be rolled back.
When you created the application, a git remote for Deis was added automatically.
$ git push deis master
This will use the Deis builder to package your application as a Docker Image and deploy it on your application's cluster.
Configure your application with environment variables. Each config change also creates a new release.
$ deis config:set DATABASE_URL=postgres://
Coming soon: Use the integrated ETCD namespace for service discovery between applications on the same cluster.
Test your application by running commands inside an ephemeral Docker container.
$ deis run make test
To integrate with your CI system, check the return code.
Scale containers horizontally with ease.
$ deis scale web=8
Access to aggregated logs makes it easy to troubleshoot problems with your application.
$ deis logs
Use deis run
to execute one-off commands and explore the deployed container. Coming soon: deis attach
to jump into a live container.
We have sometimes seen the VM reboot while doing make build
against a
Vagrant virtual machine. If you see this issue using a recent version of
Vagrant and the current master version of Deis, please add to the issue
report at https://github.com/coreos/coreos-vagrant/issues/68 to help us
pin it down.
Copyright 2014, OpDemand LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.