New wave of container development

Paweł Prażak
Feb 28, 2018 · 5 min read
The power trio

Installation

curl -#L \
--url https://kubernetes-helm.storage.googleapis.com/helm-v2.8.1-linux-amd64.tar.gz \
| tar zx -C ~/bin linux-amd64/helm
mv ~/bin/linux-amd64/helm ~/bin/helm
rmdir ~/bin/linux-amd64/
curl -L# \
--url "https://azuredraft.blob.core.windows.net/draft/draft-v0.10.1-linux-amd64.tar.gz" \
| tar xzv -C ~/bin linux-amd64/draft
mv ~/bin/linux-amd64/draft ~/bin/draft
rmdir ~/bin/linux-amd64/
kubectl config use-context mycluster
kubectl create namespace draft
kubectl --namespace draft \
create serviceaccount tiller
cat << EOF | kubectl create -f -
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tiller-binding
namespace: draft
subjects:
- kind: ServiceAccount
name: tiller
namespace: draft
roleRef:
kind: ClusterRole
name: admin
apiGroup: rbac.authorization.k8s.io
EOF
kubectl --namespace draft \
run registry --image registry --port 5000
kubectl --namespace draft \
expose deployment registry --port 80 --target-port 5000
helm --tiller-namespace draft init \
--service-account=tiller
draft --draft-namespace draft init
# 1. (...) registry URL: registry.draft.svc.cluster.local
kubectl --context mycluster --namespace draft get all,secret,sa,cm
helm repo add brigade https://azure.github.io/brigade
helm --tiller-namespace draft install brigade/brigade \
--name brigade --namespace draft \
--set rbac.enabled=true \
--set gw.enabled=false \
--set cr.enabled=false
git clone https://github.com/Azure/kashti.git
cd kashti
helm --tiller-namespace draft install charts/kashti \
--name kashti \
--namespace draft \
--set service.type=ClusterIP \
--set brigade.apiServer=http://localhost:7745
kubectl --namespace draft port-forward $(kubectl get pods --namespace draft -l "app=brigade-brigade-api" -o jsonpath="{.items[0].metadata.name}") 7745
kubectl --namespace draft port-forward $(kubectl get pods --namespace draft -l "app=kashti,release=kashti" -o jsonpath="{.items[0].metadata.name}") 8080:80
Empty UI
go get github.com/Azure/brigade
cd $GOPATH/src/github.com/Azure/brigade
dep ensure -v
make brig

Usage

cd $GOPATH/src/github.com/Azure/brigade
helm inspect values brigade/brigade-project > myvalues.yaml
helm --tiller-namespace draft install brigade/brigade-project \
--namespace draft \
--name deis-empty-testbed \
-f myvalues.yaml
brig --namespace draft run -f brigade.js deis/empty-testbed
brig --namespace draft build list
ID TYPE PROVIDER PROJECT
01c79a27q054bsgaax211z6r7j exec brigade-cli brigade-830c16d4aaf6f5490937ad719afd8490a5bcbef064d397411043ac
brig --namespace draft project list
NAME ID REPO
deis/empty-testbed brigade-830c16d4aaf6f5490937ad719afd8490a5bcbef064d397411043ac github.com/deis/empty-testbed
Homepage with the new project
Project screen
yarn run v1.3.2
$ node prestart.js
prestart: src/brigade.js written
$ yarn build && node --no-deprecation ./dist/index.js
$ tsc
[brigade] brigade-worker version: 0.9.0
[brigade:app] Error: Project not found: Error: unable to get issuer certificate

- k8s.js:96 defaultClient.readNamespacedSecret.catch.reason
./dist/k8s.js:96:31

Build finished with unhandledRejection state
[brigade:app] error handler is cleaning up
error Command failed with exit code 1.

Cleanup

helm --tiller-namespace draft list
NAME REV UPDATED STATUS CHART NAMESPACE
brigade 2 Mon ... DEPLOYED brigade-0.9.0 draft
deis-empty-testbed 1 Mon ... DEPLOYED brigade-project-0.9.0 draft
draft 1 Sun ... DEPLOYED draftd-v0.10.1 draft
kashti 1 Mon ... DEPLOYED kashti-0.1.0 draft
helm --tiller-namespace draft del --purge deis-empty-testbed kashti brigade draft
kubectl delete ns draft

Summary

VirtusLab

Virtus Lab company blog

Thanks to Pawel Dolega.

Paweł Prażak

Written by

Software Engineer, DevOpsSec

VirtusLab

VirtusLab

Virtus Lab company blog