-
Notifications
You must be signed in to change notification settings - Fork 1
/
worker-node-2.yaml
61 lines (61 loc) · 1.95 KB
/
worker-node-2.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
bootcmd:
- sed -i 's/#DNS=/DNS=1.1.1.1 8.8.8.8/' /etc/systemd/resolved.conf && sed -i 's/#Domains=/Domains=k8s.local/' /etc/systemd/resolved.conf && systemctl restart systemd-resolved.service
- curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
- echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
growpart:
mode: auto
devices: [ "/" ]
fqdn: "worker-node-2.k8s.local"
prefer_fqdn_over_hostname: true
timezone: "Etc/UTC"
locale: "en_US.UTF-8"
package_update: true
package_upgrade: true
preserve_sources_list: true
package_reboot_if_required: false
manage_etc_hosts: false
packages:
- containerd
- kubeadm=1.21.0-00
- kubelet=1.21.0-00
- kubectl=1.21.0-00
- apt-transport-https
- ca-certificates
- curl
- jq
write_files:
- path: /etc/modules-load.d/containerd.conf
content: |
overlay
br_netfilter
- path: /etc/sysctl.d/99-kubernetes-cri.conf
content: |
net.ipv4.ip_forward=1
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
- path: /etc/netplan/51-cloud-init.yaml
content: |
network:
ethernets:
eth0:
addresses: [ 10.10.10.20/24 ]
version: 2
- path: /etc/hosts
content: |
127.0.0.1 localhost
10.10.10.1 control-plane.k8s.local control-plane
10.10.10.10 worker-node-1.k8s.local worker-node-1
10.10.10.20 worker-node-2.k8s.local worker-node-2
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
runcmd:
- mkdir /etc/containerd
- containerd config default > /etc/containerd/config.toml
- systemctl enable containerd.service
- apt-mark hold kubelet kubeadm kubectl
- swapoff -a
- sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
power_state:
mode: reboot
delay: now