-
Notifications
You must be signed in to change notification settings - Fork 9
/
control-cloud_config.yaml
97 lines (95 loc) · 3.47 KB
/
control-cloud_config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
coreos:
update:
reboot-strategy: etcd-lock
fleet:
<<: *FLEET_METADATA
public-ip: $private_ipv4
etcd:
<<: *ETCD_DISCOVERY
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: format-ephemeral.service
command: start
content: |
[Unit]
Description=Formats the ephemeral drive
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/wipefs -f /dev/xvdb
ExecStart=/usr/sbin/mkfs.ext4 /dev/xvdb
- name: var-lib-docker.mount
command: start
content: |
[Unit]
Description=Mount ephemeral to /var/lib/docker
Requires=format-ephemeral.service
After=format-ephemeral.service
Before=docker.service
[Mount]
What=/dev/xvdb
Where=/var/lib/docker
Type=ext4
- name: etcd.service
command: start
enable: true
- name: fleet.service
command: start
enable: true
- name: docker.service
drop-ins:
- name: 50-dns-search.conf
content: |
[Service]
Environment='DOCKER_OPTS=--dns 172.17.42.1 --dns-search cluster.local'
- name: aws-runtime-environment.install.service
command: start
enable: true
content: |
[Unit]
Description=AWS runtime environment installer
After=fleet.service
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=/bin/bash -c 'echo "EC2_INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" | sudo tee -a /etc/aws_environment'
ExecStartPre=/bin/bash -c 'echo "AWS_AVAILABILITY_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)" | sudo tee -a /etc/aws_environment'
ExecStartPre=/bin/bash -c 'sed -i s/METADATA=/METADATA=aws_az=$(curl -s 169.254.169.254/latest/meta-data/placement/availability-zone),ec2_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id),/ /run/systemd/system/fleet.service.d/20-cloudinit.conf'
ExecStart=/usr/bin/echo "Finished installing AWS runtime environment"
ExecStartPost=/usr/bin/systemctl daemon-reload
ExecStartPost=/usr/bin/systemctl stop fleet
ExecStartPost=/usr/bin/systemctl start fleet
- name: preload-container-images.install.service
command: start
enable: true
content: |
[Unit]
Description=Pre-load container baseimages
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=true
TimeoutStartSec=10m
ExecStart=/usr/bin/docker pull nordstrom/util:2015-02-27
ExecStart=/usr/bin/docker tag nordstrom/util:2015-02-27 util
ExecStart=/usr/bin/docker pull nordstrom/awscli:1.7.12
ExecStart=/usr/bin/docker tag nordstrom/awscli:1.7.12 awscli
ExecStart=/usr/bin/docker pull nordstrom/baseimage-ubuntu:14.04.1
write_files:
- path: /etc/aws_environment
<<: *AWS_ENVIRONMENT_CONTENT
- path: /etc/stack_environment
<<: *STACK_ENVIRONMENT_CONTENT
- path: /etc/profile.d/alias.sh
content: |
alias ll='ls -l'
alias d='docker '
alias ds='docker ps'
alias di='docker images'
alias drm='docker rm -f $(docker ps -qa)'
alias sd='sudo systemctl'
alias cci='sudo coreos-cloudinit --from-file'
alias j='journalctl'
function nsa { sudo nsenter -p -u -m -i -n -t $(docker inspect -f '{{ .State.Pid }}' $1) ; }