gabrielgio.me @ 39745b50dd55e03b5c9a9e9e6ea7e1a86c5317d1

 1---
 2title:  "Road to local k8s"
 3date:   2020-07-13
 4tags: ['kubernetes', 'linux', 'fedora']
 5---
 6
 7* Goal
 8The goal is to deploy kubernetes on my local networks, and keep everything as
 9reproducible as possible.
10
11* Stack
12
13I'll use Fedora Core OS, Matchbox and Terraform [fn:1], a match the requirements
14for Tectonic [fn:2]
15
16** Steps
17- Network Setup DHCP/TFTP/DNS [fn:3]
18- Matchbox [fn:4]
19- PXE network boot environment
20- Terraform Tectonic [fn:5]
21
22** Network Setup DHCP/TFTP/DNS
23First learning the basics again:
24
25- https://linuxhint.com/install_dhcp_server_ubuntu/
26- https://www.youtube.com/watch?v=XQ3T14SIlV4
27
28
29To check open ports
30#+BEGIN_SRC sh
31lsof -Pni | grep LISTEN
32#+END_SRC
33
34Run the provided [fn:dnsmasq] image with ~dnsmasq~ and PXE toolkit
35
36#+BEGIN_SRC sh
37docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \
38  -d -q \
39  --dhcp-range=192.168.1.3,192.168.1.254 \
40  --enable-tftp --tftp-root=/var/lib/tftpboot \
41  --dhcp-match=set:bios,option:client-arch,0 \
42  --dhcp-boot=tag:bios,undionly.kpxe \
43  --dhcp-match=set:efi32,option:client-arch,6 \
44  --dhcp-boot=tag:efi32,ipxe.efi \
45  --dhcp-match=set:efibc,option:client-arch,7 \
46  --dhcp-boot=tag:efibc,ipxe.efi \
47  --dhcp-match=set:efi64,option:client-arch,9 \
48  --dhcp-boot=tag:efi64,ipxe.efi \
49  --dhcp-userclass=set:ipxe,iPXE \
50  --dhcp-boot=tag:ipxe,http://matchbox.example.com:8080/boot.ipxe \
51  --address=/matchbox.example/192.168.1.2 \
52  --log-queries \
53  --log-dhcp
54#+END_SRC
55
56
57** Matchbox
58** PXE network boot environment
59** Terraform Tectonic
60
61------
62* Links
63[fn:1]https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html
64
65[fn:2]https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html
66
67[fn:3]https://coreos.com/matchbox/docs/latest/network-setup.html
68
69[fn:4]https://coreos.com/matchbox/docs/latest/deployment.html
70
71[fn:5]https://coreos.com/tectonic/releases/
72
73[fn:dnsmasq]https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq