Skip to content

Instantly share code, notes, and snippets.

View kelseyhightower's full-sized avatar

Kelsey Hightower kelseyhightower

View GitHub Profile
core@master ~ $ docker run -t -i brendanburns/php-redis /bin/bash
root@b20c192d83e1:/# ping 192.168.12.10
PING 192.168.12.10 (192.168.12.10) 56(84) bytes of data.
64 bytes from 192.168.12.10: icmp_req=1 ttl=64 time=0.235 ms
64 bytes from 192.168.12.10: icmp_req=2 ttl=64 time=0.058 ms
^C
--- 192.168.12.10 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.058/0.146/0.235/0.089 ms
root@b20c192d83e1:/# ping 192.168.12.11
core@master ~ $ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.12.2 0.0.0.0 UG 0 0 0 ens33
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 cbr0
10.244.0.0 0.0.0.0 255.255.255.0 U 0 0 0 cbr0
192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
core@master ~ $ sudo iptables -vL -t nat
Chain PREROUTING (policy ACCEPT 750 packets, 53970 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 76 packets, 7444 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 302 packets, 18648 bytes)
pkts bytes target prot opt in out source destination
core@master ~ $ sudo fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
discovery_token: 35888e98a8a633296d3b53b2bf9a87fc
dns: 192.168.12.1
gateway: 192.168.12.1
master_ipv4: 192.168.12.10
node1_ipv4: 192.168.12.11
node2_ipv4: 192.168.12.12
sshkey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHo+5nVpxDhnWBPhEuQ7D7ZYELvA5+fPEWfHmMUwBdW069FSfX1LtbVAUKW7NGMfCxTijQMfvmFt7i+o28uqrVGN+xlDdkKTarPYO/Ux6Rukw0D5RZLVDVdRIOV8Si26pkFp4ezs1NFnCFsPTXD8U4cQ1lok//x248oKGsB4ZWuRNf4PCaIdXDveXdQRbaV5SDo9JEt9VkmfSraH5JENguP51RhFJYzWQAB1QbRZrHYUfZbE+pb/XDTdSPidfRCvss9fDrrhviZjv1Gr8C9jbmSGRB8pKwGC/GWV/mj8nYEY1K3/0c/N9NNIPtmvNkQjq7eGsSUf0cM8ZbwWugr8cB kelseyhightower
set autoread
set backspace=eol,start,indent
set encoding=utf8
set hlsearch
set laststatus=2
set nocompatible
set nobackup
set noexpandtab
set noswapfile
set nowb
#cloud-config
ssh_authorized_keys:
- ssh-rsa ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHo+5nVpxDhnWBPhEuQ7D7ZYELvA5+fPEWfHmMUwBdW069FSfX1LtbVAUKW7NGMfCxTijQMfvmFt7i+o28uqrVGN+xlDdkKTarPYO/Ux6Rukw0D5RZLVDVdRIOV8Si26pkFp4ezs1NFnCFsPTXD8U4cQ1lok//x248oKGsB4ZWuRNf4PCaIdXDveXdQRbaV5SDo9JEt9VkmfSraH5JENguP51RhFJYzWQAB1QbRZrHYUfZbE+pb/XDTdSPidfRCvss9fDrrhviZjv1Gr8C9jbmSGRB8pKwGC/GWV/mj8nYEY1K3/0c/N9NNIPtmvNkQjq7eGsSUf0cM8ZbwWugr8cB kelseyhightowe
#cloud-config
hostname: core1.example.com
coreos:
etcd:
name: core1
addr: 192.168.12.11:4001
bind-addr: 0.0.0.0
peer-addr: 192.168.12.11:7001
peers: 192.168.12.10:7001,192.168.12.12:7001
[Unit]
Description=Application
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Environment="PORT=3000"
ExecStartPre=/usr/bin/wget -N -P /opt/bin http://192.168.12.1/app
ExecStartPre=/usr/bin/chmod +x /opt/bin/app
ip route
default via 192.168.12.2 dev ens33
10.0.0.0/8 dev cbr0
10.244.2.0/24 dev cbr0 proto kernel scope link src 10.244.2.1
192.168.12.0/24 dev ens33 proto kernel scope link src 192.168.12.12