#Spread: Git for Kubernetes
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.
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
##Git for Kubernetes
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:
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.
##Spread Deploy Quickstart
Check out our Getting Started Guide.
##Localkube --> Minikube
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://awesomeopensource.com/project/kubernetes/minikube.
##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:
##What's being worked on now
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:
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
There is no limit to the number of
Pods 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.
##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.
##License Spread is under the Apache 2.0 license. See the LICENSE file for details.