Skip to content

Instantly share code, notes, and snippets.

@joatmon08
joatmon08 / reference-registrator.md
Last active March 11, 2017 18:55
Registrator Modes & Expected Service Addresses

For Registrator options, see Run Reference

Default Registrator Configuration

Versions: gliderlabs/registrator:master, consul:0.7.5

Configuration Description
Default IP Address of Registrator container (if in --net=host mode, 0.0.0.0)
-ip Explicit IP Address specified in this configuration option
-internal Internal IP Address of the container
@joatmon08
joatmon08 / simple
Last active July 22, 2017 00:12
reference-nginx-reverse-proxy
worker_processes 1;
events { worker_connections 1024; }
http {
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
@joatmon08
joatmon08 / awsquirks.md
Last active July 19, 2017 20:53
AWS Quirks To Remember

AWS Quirks

CloudFormation Stack Deletion

  1. If the CF template creates a security group that does not have the correct VPC listed, it will default to the user's VPC. This causes CF to seize up, remaining in "DELETE_INPROGRESS".
  2. Lambda ENI won't delete properly. This is a known problem with AWS, the solution is wait for the CF template to delete itself. Sometimes, deleting the ENI manually helps but you have to wait an hour
@joatmon08
joatmon08 / chef_kitchen_basics.md
Last active July 20, 2017 20:53
Chef Kitchen Basics

Chef Kitchen Basics

driver

drivers

provisioner

chef_zero

running with a different YAML file

You need to set the variable $KITCHEN_YAML.

@joatmon08
joatmon08 / Dockerfile.reverseproxy
Last active July 21, 2017 02:14
Simple Reverse Proxy
FROM nginx:latest
COPY nginx.conf /etc/nginx/nginx.conf
@joatmon08
joatmon08 / docker-compose-reverseproxy.yaml
Last active April 9, 2018 22:30
Reverse Proxy Docker Compose
version: '2'
services:
reverseproxy:
image: reverseproxy:latest
ports:
- 8080:8080
restart: always
test:
@joatmon08
joatmon08 / reference-nginx-reverse-proxy-no-upstream.conf
Last active July 22, 2017 00:26
nginx Reverse Proxy, No Upstream
worker_processes 1;
events { worker_connections 1024; }
http {
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
@joatmon08
joatmon08 / reference-nginx-reverse-proxy-explicit-servers.conf
Last active July 22, 2017 00:21
nginx Reverse Proxy with Explicit Upstream Servers
worker_processes 1;
events { worker_connections 1024; }
http {
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
@joatmon08
joatmon08 / behind-the-talk-part-2-smoke-test-snippet.py
Created October 27, 2017 02:33
Behind the Talk, Part 2: Smoke Test Snippet
def run(host1_client, host2_client, network_name, cidr_block):
ip_addresses = _get_ip_addresses(cidr_block, 5, 2)
container1 = TestContainer(host1_client, ip_addresses[0], network_name)
container2 = TestContainer(host2_client, ip_addresses[1], network_name)
time.sleep(5)
output1 = container1.ping(container2.ip_address)
output2 = container2.ping(container1.ip_address)
container1.destroy()
container2.destroy()
assert _lost_packets(output1) is False, 'Container on host1 cannot reach container on host2'
@joatmon08
joatmon08 / behind-the-talk-part-2-consul-watcher-prefix.json
Last active October 27, 2017 02:51
Behind the Talk, Part 2: Consul Watcher Docker Network Key Prefix
[{
"Key": "docker/network/v1.0/endpoint/<network ID here>/",
"CreateIndex": 12,
"ModifyIndex": 12,
"LockIndex": 0,
"Flags": 3304740253564472344,
"Value": null,
"Session": ""
}]