Website | Docs | Slack | Email | Twitter | Facebook
#Spread: Docker to Kubernetes in one command
spread
is a command line tool that makes it easy to version Kubernetes objects (see: Kit), set up a local Kubernetes cluster (see: localkube), and deploy to Kubernetes clusters in one command. The project's goals are to:
- Enable rapid iteration with Kubernetes
- Be the fastest, simplest way to deploy Docker to production
- Work well for a single developer or an entire team (no more broken bash scripts!)
See how we deployed Mattermost (and you can too!):
Spread is under open, active development. New features will be added regularly over the next few months - explore our roadmap to see what will be built next and send us pull requests for any features you’d like to see added.
See our philosophy for more on our mission and values.
##Requirements
##Installation
Install with go get
:
go get rsprd.com/spread/cmd/spread
Or, if you prefer using Homebrew (OS X only):
$ brew tap redspread/spread
$ brew install spread
##Quickstart
Check out our Getting Started Guide.
##Localkube
Spread makes it easy to set up and iterate with localkube, a local Kubernetes cluster streamlined for rapid development.
Requirements:
(Note: For Mac and Windows users, the fastest way to install everything above is Docker Toolbox.)
Get started:
- Create a machine called dev:
docker-machine create --driver virtualbox dev
- Start your docker-machine:
docker-machine start dev
- Connect to the docker daemon:
eval "$(docker-machine env dev)"
- Spin up a local cluster using localkube:
spread cluster start
- To stop the cluster:
spread cluster stop
Suggested workflow:
docker build
the image that you want to work with [1]- Create Kubernetes objects that use the image build above
- Run
spread deploy .
to deploy to cluster [2] - Iterate on your application, updating image and objects running
spread deploy .
each time you want to deploy changes - To preview changes, grab the IP of your docker daemon with
docker-machine env <NAME>
and the returnedNodePort
, then putIP:NodePort
in your browser - When finished, run
spread cluster stop
to stop localkube
[1] spread
will soon integrate building (#59)
[2] Since localkube
shares a Docker daemon with your host, there is no need to push images :)
See more for our suggestions when developing code with localkube
.
##What's been done so far
spread deploy [-s] PATH [kubectl context]
: Deploys a Docker project to a Kubernetes cluster. It completes the following order of operations:- Reads context of directory and builds Kubernetes deployment hierarchy.
- Updates all Kubernetes objects on a Kubernetes cluster.
- Returns a public IP address, if type Load Balancer is specified.
- Established an implicit hierarchy of Kubernetes objects
- Multi-container deployment
- Support for Linux and Windows
- localkube: easy-to-setup local Kubernetes cluster for rapid development
##What's being worked on now
- Version control for Kubernetes objects
- Inner-app linking
See more of our roadmap here!
##Future Goals
- Peer-to-peer syncing between local and remote Kubernetes clusters
- Develop workflow for application and deployment versioning
- Introduce paramaterization for container configuration
##FAQ
How are clusters selected? Remote clusters are selected from the current kubectl context. Later, we will add functionality to explicitly state kubectl arguments.
How should I set up my directory? In order to take advantage of Spread's one-command deploy feature, spread deploy
, you'll need to set up your directory with a few specific naming conventions:
- All
ReplicationController
andPod
files should go in the root directory - Any
ReplicationController
files should end in.rc.yaml
or.rc.json
, depending on the respective file extension - Any
Pod
files should end in.pod.yaml
or.pod.json
, depending on the respective file extension - All other Kubernetes object files should go in a directory named
rs
There is no limit to the number of ReplicationController
s or Pod
s in the root directory.
Here is an example directory with Spread's naming conventions:
app.rc.yaml
database.rc.yaml
rs
|_
service.yaml
secret.yaml
##Contributing
We'd love to see your contributions - please see the CONTRIBUTING file for guidelines on how to contribute.
##Reporting bugs If you haven't already, it's worth going through Elika Etemad's guide for good bug reporting. In one sentence, good bug reports should be both reproducible and specific.
##Contact
Team: [email protected]
Slack: slackin.redspread.com
Planning: Roadmap
Bugs: Issues
##License Spread is under the Apache 2.0 license. See the LICENSE file for details.