Skip to content

Instantly share code, notes, and snippets.


Aaron Schlesinger arschles

View GitHub Profile
arschles / sample_claim.yaml
Last active Sep 1, 2016
Sample Steward manifest
View sample_claim.yaml
kind: ConfigMap
apiVersion: v1
name: claim-1
namespace: default
type: service-plan-claim
service-id: "helm-alpine"
plan-id: "standard"
arschles / ctx.go
Created Aug 26, 2016
Golang 1.7 Contexts
View ctx.go
package main
import (
View logs.txt
ENG000656:workflow-manager-api aaronschlesinger$ kd logs -f deis-database-sr5al
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
arschles / auth_middleware.go
Last active Apr 21, 2016
rudimentary auth middleware
View auth_middleware.go
func WithAuth(tokenToCheck, tokenHeaderName string, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get(tokenHeaderName) != tokenToCheck {
http.Error(w, "not authorized", http.StatusUnauthorized)
next.ServeHTTP(w, r)
arschles / controller_logs.txt
Last active Apr 11, 2016
deis-controller flapping
View controller_logs.txt
ENG000656:workflow-e2e aaronschlesinger$ kd logs -f deis-controller-rbexd
system information:
Django Version: 1.9.3
Python 3.5.1
Django checks:
System check identified no issues (2 silenced).
Health Checks:
Checking if database is alive
Database is alive!
Database Migrations:
arschles /
Last active Mar 29, 2016
router consensus protocol

Internal update protocol

  1. When the leader gets a new configuration, it assigns a monotonically increasing version number to it and stores it in a k8s annotation (similar to how the leader election algorithm uses annotations). The version # will be for router-internal use only.
  2. When the leader gets a new configuration, it increments the version, stores it in the annotation, then sends the version along with the new configuration to all other router replicas. Each replica only responds when it has finished updating both its config and version number. If any replica doesn't respond within a reasonable timeout, the leader terminates it.
  3. When a non-leader comes online with a version #, it compares its local known value with that in the annotation. If they don't match, it requests the most up to date version number and config from the leader
  4. When a non-leader comes online with no version, it requests the most up to date version and config from the leader.
  5. If a non-leader gets one or more configurat
arschles /
Last active Apr 4, 2016
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
  • Ensure you have no installed Helm repository called deis (helm repo remove deis if you do)
  • Ensure no `d
arschles /
Created Dec 29, 2015
k8s setup guide for Deis v2
Name Cloud? Local? Level of Configurability Ease of setup on 1.1 Yes Yes High Medium
micro-kube No (technically, I think you can with some extra work, since Vagrant supports spinning up cloud VMs. Instructions not in the micro-kube README though) Yes Low High
GKE Yes No Low High
Digital Ocean using Terraform Yes No Medium  Easy
arschles /
Created Dec 15, 2015
remove all exited docker containers
sudo docker ps -a | grep Exited | cut -d ' ' -f 1 | xargs docker rm
arschles /
Last active Dec 16, 2020
Why We Should Use Monolithic Repositories

I think we should have all our code in a monolithic repository.

I've detailed the big benefits to having one, addressed possible issues to having one, and mentioned a few risks to not moving to a monorepo below.

Benefits To Adopting a Monolithic Repo

Golang package dependencies

  1. Single vendor/ dir at the top level of deis/deis
  2. All internal packages use the same external dependencies