Skip to content

Instantly share code, notes, and snippets.

@xsenechal
Last active September 6, 2016 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xsenechal/262b99d536e7a7a36f86004985b40a75 to your computer and use it in GitHub Desktop.
Save xsenechal/262b99d536e7a7a36f86004985b40a75 to your computer and use it in GitHub Desktop.
mkdir deisv2 && cd deisv2
# install deis cli
curl -sSL http://deis.io/deis-cli/install-v2.sh | bash
cp deis ~/bin/deisv2
ln -fs ~/bin/deisv2 /usr/local/bin/deis
# install helmc (kubernetes package manager)
curl -s https://get.helm.sh | bash
cp helmc ~/bin/helmc
ln -fs ~/bin/helmc /usr/local/bin/helmc
# Download kubernetes
curl -sSL https://storage.googleapis.com/kubernetes-release/release/v1.2.4/kubernetes.tar.gz -O
tar -xvzf kubernetes.tar.gz
cd kubernetes
# Install kubectl
sudo cp platforms/darwin/amd64/kubectl /usr/local/bin/kubectl
sudo chmod +x /usr/local/bin/kubectl
# bootstrap kubernetes in 2 VMs (master & node1)
export KUBE_ENABLE_INSECURE_REGISTRY=true
export KUBERNETES_PROVIDER=vagrant
export KUBERNETES_MASTER_MEMORY=1536
export KUBERNETES_NODE_MEMORY=4096
env | grep KUBE # just a check-up
./cluster/kube-up.sh
# get user and pwd for online tools
cat /Users/xs/.kube/config
# user/pwd: vagrant/vagrant
curl --user vagrant:vagrant --insecure https://10.245.1.2/
# test the Kubernetes ui at https://10.245.1.2/ui
# test the Grafana at https://10.245.1.2/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana
kubectl cluster-info
helmc --version # > 0.8
helmc target # should give the same output as kubectl cluster-info
# Add the Deis Chart Repository
helmc repo add deis https://github.com/deis/charts
helmc fetch deis/workflow-v2.1.0 # fetches the chart into a local workspace
helmc generate -x manifests workflow-v2.1.0 # generates various secrets
helmc install workflow-v2.1.0 # injects resour
# wait for pods to boot-up (can take a while)
kubectl --namespace=deis get pods
kubectl --namespace=deis get pods -w # ctrl-C wait no longer activity
# configure DNS for local set-up
kubectl describe node kubernetes-node-1 | grep Address # 10.245.1.3
kubectl --namespace=deis describe service deis-router | egrep IP # 10.247.13.128
# !!!!!!!!!!!! remove route after testing !!!!!!!!!!!!!!!!!!!!!!! sudo route delete 10.247.13.128 10.245.1.3
sudo route add 10.247.13.128 10.245.1.3
netstat -nr # check existing routes
# verify that anything.10.247.13.128.nip.io redirect to thre router 10.247.13.128
host xavier.10.247.13.128.nip.io
curl http://deis.10.247.13.128.nip.io/v2/ && echo # gives {"detail":"Authentication credentials were not provided."}
deis register http://deis.10.247.13.128.nip.io # create user on deis
deis whoami
deis keys:add
# deploy sample app
cd ..
git clone https://github.com/deis/example-java-jetty.git # or git clone https://github.com/deis/example-ruby-sinatra.git
cd example-java-jetty/
deis create xavier-test
git remote -v | grep deis # deis added its remote to git's repo
git push deis master
deis open
# scale process to 3 instances
deis scale web=3
deis info
deis config:set POWERED_BY="Docker Images + Kubernetes"
# watch the rolling update ... (zero-downtime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment