-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloud-config
More file actions
106 lines (100 loc) · 3.64 KB
/
cloud-config
File metadata and controls
106 lines (100 loc) · 3.64 KB
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
98
99
100
101
102
103
104
105
106
#cloud-config
hostname: "host.example.com" #<- change here !
ssh_authorized_keys:
- #your ssh key here #<- change here !
coreos:
update:
reboot-strategy: best-effort
etcd2:
name: host
discovery-srv: example.com #<- change here !
initial-cluster-state: existing
initial-advertise-peer-urls: http://host.example.com:2380 #<- change here !
advertise-client-urls: http://host.example.com:2379 #<- change here !
listen-client-urls: "http://0.0.0.0:2379,http://0.0.0.0:4001"
listen-peer-urls: http://0.0.0.0:2380
heartbeat-interval: 500
election-timeout: 5000
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
- name: data.mount
command: start
content: |
[Mount]
What=data.example.com:/data #<- change here !
Where=/data
Type=nfs
- name: settimezone.service
command: start
content: |
[Unit]
Description=Set the time zone
[Service]
ExecStart=/usr/bin/timedatectl set-timezone Europe/Paris
RemainAfterExit=yes
Type=oneshot
- name: consul.service
command: start
content: |
[Unit]
Description=Consul
Requires=docker.service
After=docker.service
[Service]
EnvironmentFile=/etc/environment
Environment=CONTAINER=consul
Environment=IMAGE=progrium/consul
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker stop ${CONTAINER}
ExecStartPre=-/usr/bin/docker rm ${CONTAINER}
ExecStartPre=-/usr/bin/docker pull ${IMAGE}
ExecStart=/usr/bin/docker run --name ${CONTAINER} --net host ${IMAGE} -retry-join example.com -advertise ${COREOS_PRIVATE_IPV4} -server #<- change here !
ExecStartPost=/bin/sleep 15
ExecStop=/usr/bin/docker stop ${CONTAINER}
ExecStop=/usr/bin/docker rm ${CONTAINER}
Restart=always
RestartSec=10
- name: registrator.service
command: start
content: |
[Unit]
Description=Consul registrator service
Requires=docker.service consul.service
After=consul.service
PartOf=consul.service
[Service]
Environment=CONTAINER=registrator
Environment=IMAGE=gliderlabs/registrator
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker stop ${CONTAINER}
ExecStartPre=-/usr/bin/docker rm ${CONTAINER}
ExecStartPre=-/usr/bin/docker pull ${IMAGE}
ExecStart=/usr/bin/docker run --net host --name ${CONTAINER} -v /var/run/docker.sock:/tmp/docker.sock ${IMAGE} consul://127.0.0.1:8500
ExecStop=/usr/bin/docker stop ${CONTAINER}
ExecStop=/usr/bin/docker rm ${CONTAINER}
Restart=always
RestartSec=10
- name: haproxy.service
command: start
content: |
[Unit]
Description=Haproxy service using consul
Requires=docker.service consul.service
After=consul.service
PartOf=consul.service
RequiresMountsFor=/data
[Service]
Environment=CONTAINER=haproxy
Environment=IMAGE=asteris/haproxy-consul
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker stop ${CONTAINER}
ExecStartPre=-/usr/bin/docker rm ${CONTAINER}
ExecStartPre=-/usr/bin/docker pull ${IMAGE}
ExecStart=/usr/bin/docker run --name ${CONTAINER} --net host -v /data/certs/mixed/:/certs:ro -v /data/data/haproxy/consul.tmpl:/consul-template/template.d/consul.tmpl -e CONSUL_CONNECT=127.0.0.1:8500 ${IMAGE}
ExecStop=/usr/bin/docker stop ${CONTAINER}
ExecStop=/usr/bin/docker rm ${CONTAINER}
Restart=always
RestartSec=10