Local Kubernetes / Deis environment setup (Mac edition)
-
Install Kubernetes (minikube)
-
Install VirtualBox or VMWare Fusion
-
Install
minikube
:$ brew install minikube
or download the latest release manually
-
Create and start the Kubernetes VM:
$ minikube start --vm-driver=$VM_DRIVER --disk-size=60g --memory=4096
Where
$VM_DRIVER
is one ofvirtualbox
orvmwarefusion
. Disk size and RAM allocations should be enough to deploy a couple of typical apps, but may be overboard for a quick test.
-
-
Install
kubectl
to interact with the cluster:$ curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/darwin/amd64/kubectl $ chmod +x kubectl $ mv kubectl /usr/local/bin/
-
Check Kubernetes cluster is running:
$ kubectl cluster-info Kubernetes master is running at https://172.16.60.128:8443 ...
-
Install
helmc
, a Kubernetes package manager-
Pipe the internet straight into your shell:
$ curl -sSL https://get.helm.sh | bash
-
Move the downloaded binary somewhere sensible:
$ mv helmc /usr/local/bin/
-
-
Install Deis command line tools
-
$ brew install deis
-
...or pipe the internet into bash again:
$ curl -sSL http://deis.io/deis-cli/install-v2.sh | bash $ mv deis /usr/local/bin/
-
-
Deploy Deis Workflow on Kubernetes via Helm 5. Check helm can connect to your Kubernetes cluster:
$ helmc target Kubernetes master is running at https://172.16.60.128:8443 ...
-
Add the Deis 'chart' repo
$ helmc repo add deis https://github.com/deis/charts
-
Fetch the chart
$ helmc fetch deis/workflow-v2.8.0
-
Generate secrets
$ helmc generate -x manifests workflow-v2.8.0
-
Create Deis resources in Kubernetes cluster
$ helmc install workflow-v2.8.0
-
Monitor Deis pods until everything has started:
$ kubectl --namespace=deis get pods -w
This watches
get pods
output. Once all pods are inREADY
state, ctrl+c to cancel and you're good to go -
Register a Deis admin user
$ deis register http://deis.$(minikube ip).nip.io
This uses
minikube ip
to get your VMs IP, andnip.io
to provide wildcard DNS, so thathttp://appname.$IP_ADDRESS.nip.io
will work
-
-
Deploy a sample application 6. Create a Deis app, with no git remote
$ deis create --no-remote Creating Application... done, created proper-barbecue If you want to add a git remote for this app later, use `deis git:remote -a proper-barbecue` Make a note of the app name.
-
Deploy a sample Go app
$ deis pull deis/example-go -a proper-barbecue Creating build... done
-
View your sample app
$ curl http://proper-barbecue.$(minikube ip).nip.io Powered by Deis
-
Try Heroku-like things:
$ deis config:set POWERED_BY="Docker Images + Kubernetes" -a proper-barbecue Creating config... done $ curl http://proper-barbecue.$(minikube ip).nip.io Powered by Docker Images + Kubernetes $ deis scale cmd=2 -a proper-barbecue Scaling processes... but first, coffee! done in 36s === proper-barbecue Processes --- cmd: proper-barbecue-v18-cmd-rk644 up (v18) proper-barbecue-v18-cmd-0ag04 up (v18)
-
¯\_(ツ)_/¯
-