2016-11-18 01:18:34 +03:00
|
|
|
# Prow: Streamlined Kubernetes Development
|
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
_NOTE: Prow is experimental and does not have a stable release yet._
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
Prow is a tool for developers to create cloud-native applications on [Kubernetes][].
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-01-19 21:13:24 +03:00
|
|
|
## Usage
|
|
|
|
|
2017-02-09 02:03:33 +03:00
|
|
|
_NOTE: These instructions are temporary until there is an official binary release._
|
2017-01-19 21:13:24 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
Here's an example of installing Prow and creating an application:
|
2017-01-19 21:13:24 +03:00
|
|
|
|
|
|
|
```
|
2017-02-06 22:36:59 +03:00
|
|
|
$ go version
|
|
|
|
go version go1.7 linux/amd64
|
2017-01-25 02:10:03 +03:00
|
|
|
$ # install prowd
|
|
|
|
$ helm init
|
|
|
|
$ export IMAGE_PREFIX=bacongobbler
|
|
|
|
$ make info
|
|
|
|
Build tag: git-abc1234
|
|
|
|
Registry: quay.io
|
2017-02-09 02:03:33 +03:00
|
|
|
Immutable tag: quay.io/bacongobbler/prowd:git-abc1234
|
|
|
|
Mutable tag: quay.io/bacongobbler/prowd:canary
|
|
|
|
$ make bootstrap docker-build docker-push
|
|
|
|
$ cat chart/values.yaml | grep 'registry\|name'
|
|
|
|
registry: quay.io
|
|
|
|
name: deis/prowd
|
|
|
|
$ helm install ./chart --namespace prow --set image.name=${IMAGE_PREFIX}/prowd
|
|
|
|
$ make build && export PATH=$PWD/bin:$PATH
|
2017-01-25 02:10:03 +03:00
|
|
|
$ cd tests/testdata/example-dockerfile-http
|
2017-02-07 00:09:30 +03:00
|
|
|
$ prow up
|
2017-01-25 02:10:03 +03:00
|
|
|
--> Building Dockerfile
|
2017-02-07 00:09:30 +03:00
|
|
|
--> Pushing 127.0.0.1:5000/example-dockerfile-http:fc8c34ba4349ce3771e728b15ead2bb4c81cb9fd
|
2017-01-25 02:10:03 +03:00
|
|
|
--> Deploying to Kubernetes
|
2017-02-07 00:09:30 +03:00
|
|
|
Release "example-dockerfile-http" does not exist. Installing it now.
|
2017-01-25 02:10:03 +03:00
|
|
|
--> code:DEPLOYED
|
|
|
|
$ helm list
|
2017-02-08 21:46:10 +03:00
|
|
|
NAME REVISION UPDATED STATUS CHART
|
|
|
|
example-dockerfile-http 1 Tue Jan 24 15:04:27 2017 DEPLOYED example-dockerfile-http-1.0.0
|
2017-01-25 02:10:03 +03:00
|
|
|
$ kubectl get po
|
2017-02-07 00:09:30 +03:00
|
|
|
NAME READY STATUS RESTARTS AGE
|
|
|
|
example-dockerfile-http-3666132817-m2pkr 1/1 Running 0 30s
|
2017-01-19 21:13:24 +03:00
|
|
|
```
|
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
_NOTE: CLI usage will look like this when it is completed._
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
Start from a source code repository and let Prow create the Kubernetes packaging:
|
2016-11-18 01:18:34 +03:00
|
|
|
|
|
|
|
```
|
|
|
|
$ cd my-app
|
|
|
|
$ ls
|
|
|
|
app.py
|
2017-01-27 22:01:11 +03:00
|
|
|
$ prow create --pack=python
|
2016-11-18 01:18:34 +03:00
|
|
|
--> Created ./charts/my-app
|
|
|
|
--> Created ./charts/my-app/Dockerfile
|
|
|
|
--> Ready to sail
|
|
|
|
```
|
|
|
|
|
|
|
|
Now start it up!
|
|
|
|
|
|
|
|
```
|
|
|
|
$ prow up
|
|
|
|
--> Building Dockerfile
|
|
|
|
--> Pushing my-app:latest
|
|
|
|
--> Deploying to Kubernetes
|
2017-01-27 22:01:11 +03:00
|
|
|
--> code:DEPLOYED
|
2016-11-18 01:18:34 +03:00
|
|
|
```
|
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
That's it! You're now running your Python app in a [Kubernetes][] cluster.
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
Behind the scenes, Prow handles the heavy lifting:
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
- Builds a container image from application source code
|
|
|
|
- Pushes the image to a registry
|
|
|
|
- Creates a [Helm][] chart for the image
|
|
|
|
- Installs the chart to Kubernetes, deploying the application
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
After deploying, you can run `prow up` again to create new releases when
|
|
|
|
application source code has changed. Or you can let Prow continuously rebuild
|
|
|
|
your application.
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 23:27:26 +03:00
|
|
|
|
|
|
|
## Hacking on Prow
|
|
|
|
|
|
|
|
The easiest way to hack on Prow is to deploy changes... Using Prow. Check it out!
|
|
|
|
|
|
|
|
```
|
|
|
|
$ helm list
|
|
|
|
NAME REVISION UPDATED STATUS CHART
|
|
|
|
warped-nightingale 1 Wed Feb 8 10:29:19 2017 DEPLOYED prowd-0.1.0
|
|
|
|
$ make build docker-binary
|
|
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ./rootfs/bin/prowd -a -installsuffix cgo -tags '' -ldflags ' -X github.com/deis/prow/pkg/version.Version= -X github.com/deis/prow/pkg/version.GitCommit=d46a18200576d6ba3007ed26efb647ffd86303ba -X github.com/deis/prow/pkg/version.GitTreeState=clean' github.com/deis/prow/cmd/prowd
|
|
|
|
$ ./bin/prow up --app warped-nightingale
|
|
|
|
--> Building Dockerfile
|
|
|
|
--> Pushing 127.0.0.1:5000/warped-nightingale:6f3b53003dcbf43821aea43208fc51455674d00e
|
|
|
|
--> Deploying to Kubernetes
|
|
|
|
--> code:DEPLOYED
|
|
|
|
```
|
|
|
|
|
2016-11-18 01:18:34 +03:00
|
|
|
## Features
|
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
- Prow is language-agnostic
|
|
|
|
- Prow works with any Kubernetes cluster that supports [Helm][]
|
|
|
|
- Charts that Prow creates can be edited to suit your needs
|
|
|
|
- Charts can be packaged for delivery to your ops team
|
2016-11-18 01:18:34 +03:00
|
|
|
|
2017-02-08 21:46:10 +03:00
|
|
|
[Kubernetes]: https://kubernetes.io/
|
|
|
|
[Helm]: https://github.com/kubernetes/helm
|