-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud-config_node1.yaml
193 lines (178 loc) · 6.08 KB
/
cloud-config_node1.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#cloud-config
hostname: s500lxhmlcoreos02
users:
- name: "fernando"
passwd: "$6$SALT$zFifZn/XRQWV6ZoDkd/d9/bqoR94O3n9K0eJfAmOJWAfoeC47o6NbKDUhkibHZb2Zj7vb6i1Om6hbjuN1eAza1"
groups:
- "sudo"
- "docker"
# include one or more SSH public keys
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCknBdTytV0mOAIZkhtANnx8BO6bT0Qxt7nQP9w68oBTbSrCOWug7jSN7yp2QQABZzFbn7nKHkOAKlDdBMu0Q8XoRhgYooolS+Qt+Tw0FyAn1biPscPUbvTgFC/AZ8/+VXPqGc977R+DDNzFweDaxkzLWWq8k4DZp92FDYSRJ+b7eJG4BFJ84QNMiusgD8P1aBYf/BJ3GrggIgkUpXYhbV4k+0HQH+AFPAvXWngHveoSVTA2LjWhufy2N8YiNG72fgAMLtrQNGinNUF19B/UD5+kuPckE7vTt47cYQDaNXoIMayF910lz3c4Zofdloyg9waHgq3ogBt8Ma59zPbUNLL fi_felicissimo@WN500RD025
write-files:
- path: /opt/bin/wupiao
permissions: '0755'
content: |
#!/bin/bash
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
[ -n "$1" ] && [ -n "$2" ] && while ! curl --output /dev/null \
--silent --head --fail \
http://${1}:${2}; do sleep 1 && echo -n .; done;
exit $?
coreos:
etcd2:
discovery: https://discovery.etcd.io/c036ab87c16c0bf4dd0cea4e89a8f957
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
advertise-client-urls: http://host.dominio.intranet:2379,http://host.dominio.intranet:4001
initial-cluster: master=http://master.dominio.intranet:2380
proxy: on
fleet:
metadata: "role=node"
public-ip: 10.31.0.246
units:
- name: etcd2.service
command: start
- name: fleet.service
command: start
- name: flanneld.service
command: start
- name: docker.service
command: start
- name: setup-network-environment.service
command: start
content: |
[Unit]
Description=Setup Network Environment
Documentation=https://github.com/kelseyhightower/setup-network-environment
Requires=network-online.target
After=network-online.target
[Service]
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
ExecStartPre=/usr/bin/curl -L -o /opt/bin/setup-network-environment -z /opt/bin/setup-network-environment https://github.com/kelseyhightower/setup-network-environment/releases/download/v1.0.0/setup-network-environment
ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
ExecStart=/opt/bin/setup-network-environment
RemainAfterExit=yes
Type=oneshot
- name: kube-proxy.service
command: start
content: |
[Unit]
Description=Kubernetes Proxy
Documentation=https://github.com/kubernetes/kubernetes
Requires=setup-network-environment.service
After=setup-network-environment.service
[Service]
ExecStartPre=/usr/bin/curl -L -o /opt/bin/kube-proxy -z /opt/bin/kube-proxy https://storage.googleapis.com/kubernetes-release/release/v1.1.2/bin/linux/amd64/kube-proxy
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy
# wait for kubernetes master to be up and ready
ExecStartPre=/opt/bin/wupiao master.dominio.intranet 8081
ExecStart=/opt/bin/kube-proxy \
--master=host.dominio.intranet:8081 \
--logtostderr=true
Restart=always
RestartSec=10
- name: kube-kubelet.service
command: start
content: |
[Unit]
Description=Kubernetes Kubelet
Documentation=https://github.com/kubernetes/kubernetes
Requires=setup-network-environment.service
After=setup-network-environment.service
[Service]
EnvironmentFile=/etc/network-environment
ExecStartPre=/usr/bin/curl -L -o /opt/bin/kubelet -z /opt/bin/kubelet https://storage.googleapis.com/kubernetes-release/release/v1.1.2/bin/linux/amd64/kubelet
ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet
# wait for kubernetes master to be up and ready
ExecStartPre=/opt/bin/wupiao host.dominio.intranet 8081
ExecStart=/opt/bin/kubelet \
--address=0.0.0.0 \
--port=10250 \
--hostname-override=${DEFAULT_IPV4} \
--api-servers=host.dominio.intranet:8081 \
--allow-privileged=true \
--logtostderr=true \
--cadvisor-port=4194 \
--healthz-bind-address=0.0.0.0 \
--healthz-port=10248
Restart=always
RestartSec=10
update:
group: alpha
reboot-strategy: off
write_files:
- path: "/etc/resolv.conf"
permissions: "0644"
owner: "root"
content: |
nameserver 10.0.0.150
nameserver 10.0.0.151
search dominio.intranet
coreos:
units:
- name: "etcd2.service"
drop-ins:
- name: "timeout.conf"
content: |
[Service]
TimeoutStartSec=0
coreos:
units:
- name: settimezone.service
command: start
content: |
[Unit]
Description=Set the time zone
[Service]
ExecStart=/usr/bin/timedatectl set-timezone America/Sao_Paulo
RemainAfterExit=yes
Type=oneshot
coreos:
units:
- name: "etcd2.service"
drop-ins:
- name: "timeout.conf"
content: |
[Service]
TimeoutStartSec=0
write_files:
- path: /etc/systemd/network/ens32.network
permissions: 0644
owner: root
content: |
[Match]
Name=ens32
[Network]
Address=10.31.0.246/24
Gateway=10.31.0.1
DNS=10.0.0.150
DNS=10.0.0.151
- path: /etc/systemd/network/ens33.network
permissions: 0644
owner: root
content: |
[Match]
Name=ens34
[Network]
Address=172.16.20.2/24
manage_etc_hosts: "localhost"
write_files:
- path: /etc/nsswitch.conf
permissions: 0644
owner: root
content: |
# /etc/nsswitch.conf:
passwd: files usrfiles
shadow: files usrfiles
group: files usrfiles
hosts: files usrfiles resolv dns
networks: files usrfiles dns
services: files usrfiles
protocols: files usrfiles
rpc: files usrfiles
ethers: files
netmasks: files
netgroup: files
bootparams: files
automount: files
aliases: files