Website | Docs | Slack | Email | Twitter | Facebook
spread
is a command line tool that makes it easy to version Kubernetes clusters, deploy to Kubernetes clusters in one command, and set up a local Kubernetes cluster (see: localkube). The project's goals are to:
See how we versioned the cluster running our (website) (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.
Install with go get
(-d is for download only):
go get -d rsprd.com/spread/cmd/spread
Go into the correct directory:
cd $GOPATH/src/rsprd.com/spread
If libgit2 is not installed:
make install-libgit2
Then:
make build/spread
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
Spread versions your software environment (i.e. a Kubernetes cluster) like Git versions source code. Because Spread is built on top of libgit2, it takes advantage of Git's interface and functionality. This means after you deploy a Kubernetes object to a cluster, you can version the object by staging, commiting, and pushing it to a Spread repository.
To get started, initialize Spread and set up a local Spread repository:
spread init
Here is our suggested workflow for versioning with Spread:
spread deploy .
spread add <objectType>/<objectName>
spread commit -m "commit message"
spread remote (add <name> <url> | remove <name> | set-url <name> <url>)
spread push <remote> <refSpec>
spread git ...
If you find any bugs or have any feature requests for Spread versioning, please file an issue!
For more details on Spread commands, see our docs.
Check out our Getting Started Guide.
Spread made it easy to set up and iterate with Localkube, a local Kubernetes cluster streamlined for rapid development. We have donated Localkube code to Minikube, the official Kubernetes local development solution. It's easy to set up a local cluster with Minikube: https://github.com/kubernetes/minikube.
spread deploy [-s] PATH [kubectl context]
: Deploys a Docker project to a Kubernetes cluster. It completes the following order of operations:
See more of our roadmap here!
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:
ReplicationController
and Pod
files should go in the root directoryReplicationController
files should end in .rc.yaml
or .rc.json
, depending on the respective file extensionPod
files should end in .pod.yaml
or .pod.json
, depending on the respective file extensionrs
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
Why version objects instead of just files? The object is the deterministic representation of state in Kubernetes. A useful analogy is "Kubernetes objects" are to "Docker images" like "Kubernetes object files" are to "Dockerfiles". By versioning the object itself, we can guarantee a 1:1 mapping with the Kubernetes cluster. This allows us to do things like diff two clusters and introduces future potential for linking between objects and repositories.
We'd love to see your contributions - please see the CONTRIBUTING file for guidelines on how to contribute.
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.
Team: hello@redspread.com
Slack: slackin.redspread.com
Planning: Roadmap
Bugs: Issues
Spread is under the Apache 2.0 license. See the LICENSE file for details.