forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_data.yml
116 lines (103 loc) · 2.7 KB
/
user_data.yml
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
116
#cloud-config
hostname: ${name}
ssh_authorized_keys:
${ssh_keys}
write_files:
- path: /etc/systemd/journald.conf
permissions: 0644
content: |
[Journal]
SystemMaxUse=50M
RuntimeMaxUse=50M
coreos:
etcd2:
advertise-client-urls: http://${public_ip}:2379
initial-advertise-peer-urls: http://${public_ip}:2380
listen-client-urls: http://0.0.0.0:2379
listen-peer-urls: http://${public_ip}:2380
initial-cluster-state: new
initial-cluster: ${etcd2_initial_cluster}
units:
- name: static.network
command: start
content: |
[Match]
# Name=eth0
MACAddress=52:54:00:00:00:${i}
[Network]
Address=${public_ip}/24
DNS=192.168.10.254
Gateway=192.168.10.254
- name: cbr0.netdev
command: start
content: |
[NetDev]
Kind=bridge
Name=cbr0
- name: cbr0.network
command: start
content: |
[Match]
Name=cbr0
[Network]
Address=${NODE_CONTAINER_SUBNETS[$i]}
[Route]
Destination=${CONTAINER_SUBNET}
- name: cbr0-interface.network
command: start
content: |
[Match]
# Name=eth1
MACAddress=52:54:00:00:01:${i}
[Network]
Bridge=cbr0
- name: nat.service
command: start
content: |
[Unit]
Description=NAT non container traffic
[Service]
ExecStart=/usr/sbin/iptables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE ! -d ${CONTAINER_SUBNET}
RemainAfterExit=yes
Type=oneshot
- name: etcd2.service
command: start
drop-ins:
- name: 10-override-name.conf
content: |
[Service]
Environment=ETCD_NAME=%H
- name: docker.service
command: start
drop-ins:
- name: 50-opts.conf
content: |
[Service]
Environment='DOCKER_OPTS=--bridge=cbr0 --iptables=false'
- name: docker-tcp.socket
command: start
enable: yes
content: |
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service
[Install]
WantedBy=sockets.target
- name: opt-kubernetes.mount
command: start
content: |
[Unit]
ConditionVirtualization=|vm
[Mount]
What=kubernetes
Where=/opt/kubernetes
Options=ro,trans=virtio,version=9p2000.L
Type=9p
update:
group: ${COREOS_CHANNEL:-alpha}
reboot-strategy: off
$( [[ ${type} =~ "master" ]] && render-template "$ROOT/user_data_master.yml" )
$( [[ ${type} =~ "node" ]] && render-template "$ROOT/user_data_minion.yml" )