In this guide, you'll learn how to install Spread, set up your project directory, and deploy an example application.
You'll also find detailed documentation on Spread commands.
Let's get started! This guide assumes you've installed the following:
Install with go get (-d is for download only):
$ go get -d rsprd.com/spread/cmd/spread
Go into the correct directory:
If libgit2 is not installed:
If an error about libraries missing comes up, set up your library path like:
export LD_LIBRARY_PATH=/usr/local/lib:$ LD_LIBRARY_PATH
Or, if you prefer using Homebrew (OS X only):
$ brew tap redspread/spread $ brew install spread-versioning
Note: If you'd like to use our example repo, skip this step! If you'd like to set up your own repo, carry on.
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:
Podfiles should go in the root directory
ReplicationControllerfiles should end in
.rc.json, depending on the respective file extension
Podfiles should end in
.pod.json, depending on the respective file extension
- All other Kubernetes object files should go in a directory named
There is no limit to the number of
Pods in the root directory.
Here is an example directory with Spread's naming conventions:
Dockerfile app.rc.yaml database.rc.yaml rs |_ service.yaml secret.yaml
In order to deploy your application, you'll need to have a running Kubernetes cluster (local or remote).
To spin up a local cluster:
This assumes you have the following installed:
(Note: For Mac and Windows users, the fastest way to install everything is Docker Toolbox.)
- 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
To spin up a remote cluster:
- Follow all the steps in this quickstart guide for spinning up a cluster on Google Cloud Platform.
*For local development, it's useful to also install
kubectl, the command line tool for interacting with the Kubernetes API. You can download
kubectl from the Kubernetes release artifact site with the
$ curl -O https://storage.googleapis.com/kubernetes-release/release/v1.2.3/bin/linux/amd64/kubectl
$ curl -O https://storage.googleapis.com/kubernetes-release/release/v1.2.3/bin/darwin/amd64/kubectl
After downloading the binary, ensure it is executable and move it into your PATH:
$ chmod +x kubectl $ mv kubectl /usr/local/bin/kubectl
You're ready to deploy your first application! We've got one set up for you already to deploy:
- Clone Mattermost, the open source Slack:
$ git clone http://github.com/redspread/kube-mattermost
- Deploy Mattermost to your cluster:
$ spread deploy .
- For remote clusters, the IP address is returned to you to put into your browser. For local clusters, the
NodePortis returned to you, and you can find the IP address with
docker-machine env <MACHINE_NAME>, then put the
IP:NodePortinto your browser to see your self-hosted app!
For a more detailed walkthrough of setting up this Mattermost application, see the full guide.
Explore Spread's commands in more detail.
Updated less than a minute ago