forked from coreos/coreos-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-data.sample
115 lines (105 loc) · 3.42 KB
/
user-data.sample
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
107
108
109
110
111
112
113
114
115
# -config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
- path: /etc/exports
permissions: '0644'
content: /exports/ *(rw,async,no_subtree_check,no_root_squash,fsid=0)
- path: /exports/hello
content: world
coreos:
etcd2:
#generate a new token for each unique cluster from https://discovery.etcd.io/new
#discovery: https://discovery.etcd.io/<token>
# multi-region and multi- deployments need to use $public_ipv4
advertise-client-urls: http://$public_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
# listen on both the official ports and the legacy ports
# legacy ports can be omitted if your application doesn't depend on them
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
fleet:
public-ip: $public_ipv4
flannel:
interface: $public_ipv4
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
- name: rpc-statd.service
command: start
enable: true
- name: nfsd.service
command: start
enable: truestrong text
- name: flanneld.service
drop-ins:
- name: 50-network-config.conf
content: |
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }'
command: start
- name: docker-tcp.socket
command: start
enable: true
content: |
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
Service=docker.service
BindIPv6Only=both
[Install]
WantedBy=sockets.target
- name: enable-docker-tcp.service
command: start
enable: true
content: |
[Unit]
Description=Enable Docker Socket for the API
[Service]
ExecStartPre=/usr/bin/systemctl stop docker.socket
ExecStartPre=/usr/bin/systemctl stop docker-tcp.socket
ExecStartPre=/usr/bin/systemctl stop docker
ExecStart=/usr/bin/systemctl enable docker-tcp.socket
ExecStartPost=/usr/bin/systemctl start docker.socket
ExecStartPost=/usr/bin/systemctl start docker-tcp.socket
Type=oneshot
RemainAfterExit=true
[Install]
WantedBy=network.target
- name: start-docker-swarm.service
command: start
enable: true
content: |
[Unit]
Description=Start Containers for docker-swarm
After=docker.service
[Service]
Restart=always
ExecStartPost=/usr/bin/docker start swarm-manager;true
ExecStart=-/usr/bin/docker start swarm-agent
ExecStop=/usr/bin/docker stop -t 2 swarm-agent
ExecStopPost=/usr/bin/docker stop -t 2 swarm-manager;true
[Install]
WantedBy=default.target
- name: docker.service
drop-ins:
- name: 10-docker-swarm.conf
content: |
[Service]
Environment="DOCKER_OPTS=--cluster-advertise eth1:2375 --cluster-store etcd://127.0.0.1:2379"
- name: docker-volume-netshare.service
command: start
enable: true
content: |
[Unit]
Description=Enable Docker Volume Netshare Plugin for NFS
Requires=docker.service
[Service]
ExecStart=/home/core/bin/docker-volume-netshare nfs
[Install]
WantedBy=default.target