Skip to content

Instantly share code, notes, and snippets.

@raiscui
Last active August 29, 2015 14:07
Show Gist options
  • Save raiscui/d8aa8ba1433f3fa2855a to your computer and use it in GitHub Desktop.
Save raiscui/d8aa8ba1433f3fa2855a to your computer and use it in GitHub Desktop.
#cloud-config
---
users:
- name: core
passwd: $1$8Kxo5IMS$dGqEN0MlLgLELsQ/NpBHp/
coreos-ssh-import-github: raiscui
groups:
- sudo
- docker
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
# uncomment the following line and replace it with your discovery URL
discovery: https://discovery.etcd.io/e3d7f8ce50841d78c9c7a5bfa2cabda2
addr: 192.168.179.129:4001
peer-addr: 192.168.179.129:7001
# give etcd more time if it's under heavy load - prevent leader election thrashing
peer-election-timeout: 2000
# heartbeat interval should ideally be 1/4 or 1/5 of peer election timeout
peer-heartbeat-interval: 500
fleet:
# We have to set the public_ip here so this works on Vagrant -- otherwise, Vagrant VMs
# will all publish the same private IP. This is harmless for cloud providers.
public-ip: 192.168.179.129
# allow etcd to slow down at times
etcd_request_timeout: 3
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: fleet.socket
command: start
content: |
[Socket]
# Talk to the API over a Unix domain socket (default)
ListenStream=/var/run/fleet.sock
Service=fleet.service
[Install]
WantedBy=sockets.target
- name: stop-update-engine.service
command: start
content: |
[Unit]
Description=stop update-engine
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl stop update-engine.service
ExecStartPost=/usr/bin/systemctl mask update-engine.service
- name: install-deisctl.service
command: start
content: |
[Unit]
Description=Install deisctl utility
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c 'curl -sSL http://deis.io/deisctl/install.sh | sh -s 0.13.1'
write_files:
- path: /etc/deis-release
content: |
DEIS_RELEASE=v0.13.1
- path: /etc/motd
content: " \e[31m* * \e[34m* \e[32m***** \e[39mddddd eeeeeee iiiiiii ssss\n\e[31m* * \e[34m* * \e[32m* * \e[39md d e e i s s\n \e[31m* * \e[34m***** \e[32m***** \e[39md d e i s\n\e[32m***** \e[31m* * \e[34m* \e[39md d e i s\n\e[32m* * \e[31m* * \e[34m* * \e[39md d eee i sss\n\e[32m***** \e[31m* * \e[34m***** \e[39md d e i s\n \e[34m* \e[32m***** \e[31m* * \e[39md d e i s\n \e[34m* * \e[32m* * \e[31m* * \e[39md d e e i s s\n\e[34m***** \e[32m***** \e[31m* * \e[39mddddd eeeeeee iiiiiii ssss\n\n\e[39mWelcome to Deis\t\t\tPowered by Core\e[38;5;45mO\e[38;5;206mS\e[39m\n"
- path: /etc/profile.d/nse-function.sh
permissions: '0755'
content: |
function nse() {
sudo nsenter --pid --uts --mount --ipc --net --target $(docker inspect --format="{{ .State.Pid }}" $1)
}
- path: /run/deis/bin/get_image
permissions: '0755'
content: |
#!/bin/bash
# usage: get_image <component_path>
IMAGE=`etcdctl get $1/image 2>/dev/null`
# if no image was set in etcd, we use the default plus the release string
if [ $? -ne 0 ]; then
RELEASE=`etcdctl get /deis/platform/version 2>/dev/null`
# if no release was set in etcd, use the default provisioned with the server
if [ $? -ne 0 ]; then
source /etc/deis-release
RELEASE=$DEIS_RELEASE
fi
IMAGE=$1:$RELEASE
fi
# remove leading slash
echo ${IMAGE#/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment