Skip to content

Instantly share code, notes, and snippets.

View ianblenke's full-sized avatar
🎯
Focusing

Ian Blenke ianblenke

🎯
Focusing
View GitHub Profile
@ianblenke
ianblenke / _README.md
Last active August 29, 2015 14:16 — forked from arkadijs/_README.md

Registrator and SkyDNS

We use progrium/registrator and yaronr/skydns (SkyDNS2) to publish information about Docker containers to DNS via A and SRV records. All nodes runs skydns and registrator, and first three nodes are inserted as NS-s into Route53 DNS for services.cluster-name.domain.io. Note, v4 registrator must be used until registrator/124 is resolved.

$ host -t srv mysql-1.services.deis.r53.acp.io deis-6-1.eu.r53.acp.io
Using domain server:
Name: deis-6-1.eu.r53.acp.io
Address: 54.171.239.227#53
Aliases: 

What

Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet.

Service discovery & registration is done via etcd.

[email protected] provides a dumb discovery service by registering an elasticsearch host if it should be up. [email protected] registers the service only if it is running.

A service & timer unit for elasticsearch curator is provided which does some housekeeping.

@ianblenke
ianblenke / dies.cloud-init
Created March 3, 2015 21:08
Alias dies to deis
#cloud-config
write_files:
- path: /etc/profile.d/dies.sh
permissions: 0644
owner: root
content: |
alias dies=deis
@ianblenke
ianblenke / gist:323fbbf2607500736443
Created March 1, 2015 07:56
Update the discovery URL in a CoreUS user-data file
eval sed -i -e "'s%discovery: .*\$%discovery: $(echo -n $(curl -sL https://discovery.etcd.io/new))%'" user-data
@ianblenke
ianblenke / myapp.tf
Last active August 29, 2015 14:16
An older translation of the Deis CloudFormation template into TerraForm syntax
variable "aws_access_key" {
description = "The AWS_ACCESS_KEY_ID to use"
}
variable "aws_secret_key" {
description = "The AWS_SECRET_ACCESS_KEY to use"
}
provider "aws" {
access_key = "${var.aws_access_key}"
@ianblenke
ianblenke / Makefile
Created February 26, 2015 05:28
Download Bonjour.msi from iTunes 12 for Windows
Bonjour.msi: iTunesSetup.exe
which 7z || \
( which brew && brew install p7zip || \
which apt-get && sudo apt-get -y install p7zip || \
which choco && choco install 7zip )
7z x iTunesSetup.exe
touch $@
iTunesSetup.exe:
curl -o iTunesSetup.exe 'https://secure-appldnld.apple.com/itunes12/031-17457.20150218.FFCRg/iTunesSetup.exe'
@ianblenke
ianblenke / gist:039239d856554a213032
Last active August 29, 2015 14:16
Building a custom deis-router image and using it
git config --global push.default simple
git clone [email protected]:ianblenke/deis ianblenke-deis
cd ianblenke-deis/router
git checkout -b ianblenke/router
cd router
cp -pR ../Godeps .
docker build -t router-build .
docker cp `docker run -d router-build`:/nginx.tgz image/
docker cp `docker run -d router-build`:/go/bin/boot image/bin/
docker build -t deis/router:ianblenke image
@ianblenke
ianblenke / gist:7404ec5c4c39010dcfa9
Last active August 29, 2015 14:16
Installing deis 1.3.1 locally on a coreos node with deisctl
#!/bin/bash
# http://deis.io/get-deis/
set -eo pipefail
[[ -n "$SSH_AUTH_SOCK" ]] || ( echo Make sure you have your ssh agent forwarded; false )
if fleetctl list-units | grep deis ; then
echo "Deis units are already in fleet"
else
# This ssh chicanery is probably overkill, so long as we have SSH_AUTH_SOCK access to an ssh-agent with private key trust to the machines
# Trust all of the member coreos machine's hostkeys
(fleetctl list-machines -fields=ip -no-legend | xargs -l1 -i% ssh-keyscan -t ed25519 % 2>/dev/null; cat ~/.ssh/known_hosts ) | sort | uniq > ~/.ssh/known_hosts
@ianblenke
ianblenke / Makefile
Last active August 29, 2015 14:16
Download the latest list of AWS AMIs for CoreOS by channel and virtualization (pv or hvm)
curl http://alpha.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json
curl http://beta.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json
curl http://stable.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json
@ianblenke
ianblenke / gist:67e82cc95e924b961d32
Created February 23, 2015 16:37
loading virtio drivers in windows recovery
for %f in (d:\win7\x86\*.inf) do drvload %f
dism /image:c:\ /add-driver /Driver:D:\win7\x86\ /recurse
dism /image:E:\ /add-driver /Driver:D:\win7\x86\ /recurse