Skip to content

Instantly share code, notes, and snippets.

@arschles
Last active April 4, 2016 04:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arschles/5b7a75a50938913d3eb1 to your computer and use it in GitHub Desktop.
Save arschles/5b7a75a50938913d3eb1 to your computer and use it in GitHub Desktop.
Deis v2 Alpha Demo Notes - January 7, 2016

We're going to overview the entire process of installing a new Deis cluster on an existing Kubernetes cluster, creating and configuring your app, deploying code, and scaling up.

0: Prerequisites

  • A working Kubernetes cluster on Google Container Engine (Deis, of course, works anywhere Kubernetes can be installed, but the installation instructions in step 1 are tailored to GKE)
  • The Kubernetes client CLI (kubectl) installed on the PATH, and configured to talk to the aforementioned cluster
  • An alias called kd to kubectl --namespace=deis (alias kd="kubectl --namespace=deis" will create it in most shells). This alias will be useful since the Helm Deis chart installs all of the components into the deis namespace
  • The Helm CLI installed on the PATH. Helm is our open source Kubernetes package manager. Find it at https://github.com/helm/helm
  • Ensure you have no installed Helm repository called deis (helm repo remove deis if you do)
  • Ensure no deis Kubernetes namespace, or any existing app namespaces
  • Ensure no Deis cluster installed (helm uninstall deis if there is one)

1: Install Deis Cluster

  • helm repo add deis https://github.com/deis/charts.git - to tell Helm about the chart for Deis
  • helm fetch deis/deis - to copy the updated Deis chart into Helm's working directory
  • helm install deis - to install Deis onto your Kubernetes cluster
  • kd get pod - to ensure all Deis components are up (in the Running Status). Rerun this command until they all are. It's normal to see some components in CrashLoopBackOff at first
  • kd describe svc deis-router - to ensure that the cloud load balancer was created

2: Register & Create app

We're going to register, create an app and deploy example-go (a buildpack app) to it. Before doing these steps, make sure you have that repository checked out and are cd-ed into it.

  • kd describe svc deis-router - to get the ingress IP. Look for the LoadBalancer Ingress field, and set it to INGRESS_IP
  • deis register deis.$INGRESS_IP.xip.io - to register yourself as the first user. Sidenote: xip.io is a handy, free DNS service for this kind of testing
  • deis create mytest - to create my new app. Note that this command tries to create a new git remote called deis that points to INGRESS_IP. If you already had a remote called deis, that part will fail but the app will still be created. The error message will say what the remote should be, so simply run git remote set-url deis <ERR_MSG_URL> to correct the issue

3: git push Your Code

  • deis keys:add ~/.ssh/id_rsa.pub - to add my public key to the platform before the first push
  • git push deis master - to send code to Deis for build and release

4: Scale your app

  • curl mytest.$INGRESS_IP.xip.io - to ensure the app is up and running
  • deis scale web=3 -a mytest - to scale up the app
  • curl mytest.$INGRESS_IP.xip.io - to see that more than 1 server can server your request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment