Skip to content

Instantly share code, notes, and snippets.

@charlesmarshall
charlesmarshall / coreos-etcd-sync-check
Created June 9, 2014 09:49
CoreOS etcd sync check
etcd_sync_check(){
count=0;
while ( true ); do
check=$(etcdctl ls / | grep 'Cannot sync' | wc -l) ;
if [ $check -eq 0 ]; then
break ;
else
warning "Cannot connect to etcd"
if [ $count -gt 50 ]; then
fatal "Failed to connect to etcd"
@charlesmarshall
charlesmarshall / coreos-cloud-init-env
Created June 9, 2014 09:15
CoreOS Cloud-Init with amends to environment file
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB ...snip... QAyapHGwoBvkq7nNp
coreos:
etcd:
# via https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/7028e012ca66ef0121b64c19c40a425a
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
@charlesmarshall
charlesmarshall / coreos-cloud-init-host-announce
Created June 9, 2014 08:43
CoreOS Cloud-Init with host announcement service
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB ...snip... QAyapHGwoBvkq7nNp
coreos:
etcd:
# via https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/7028e012ca66ef0121b64c19c40a425a
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
@charlesmarshall
charlesmarshall / coreos-cloud-init-fleet-etcd-start
Created June 8, 2014 12:09
CoreOS Cloud-Init with fleet and etcd start up
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB ...snip... QAyapHGwoBvkq7nNp
coreos:
etcd:
# via https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/7028e012ca66ef0121b64c19c40a425a
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
@charlesmarshall
charlesmarshall / coreos-cloud-init-host-access-only
Created June 8, 2014 11:50
CoreOS Cloud-Init with host access and etcd tokens only
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB ...snip... QAyapHGwoBvkq7nNp
coreos:
etcd:
# via https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/7028e012ca66ef0121b64c19c40a425a
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
write_files: