summaryrefslogtreecommitdiff
path: root/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html
blob: 5578fbf16c291225a51443493b81d2112d58c795 (plain)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</title>
<link rel="shortcut icon" type="image/gif" href="/favicon.ico" />
<link rel="stylesheet" href="../style.css" />
<link rel="stylesheet" href="style-override.css" />
</head>
<body>
<p class="header">
<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi">Gemini</a>
</p>
<h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-2-hardware-and-base-installation'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</h1><br />
<br />
<span class='quote'>Published at 2024-12-02T23:48:21+02:00, last updated Sun 11 Jan 10:30:00 EET 2026</span><br />
<br />
<span>This is the second blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</span><br />
<br />
<span>We set the stage last time; this time, we will set up the hardware for this project. </span><br />
<br />
<span>These are all the posts so far:</span><br />
<br />
<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-07-14-f3s-kubernetes-with-freebsd-part-6.html'>2025-07-14 f3s: Kubernetes with FreeBSD - Part 6: Storage</a><br />
<a class='textlink' href='./2025-10-02-f3s-kubernetes-with-freebsd-part-7.html'>2025-10-02 f3s: Kubernetes with FreeBSD - Part 7: k3s and first pod deployments</a><br />
<a class='textlink' href='./2025-12-07-f3s-kubernetes-with-freebsd-part-8.html'>2025-12-07 f3s: Kubernetes with FreeBSD - Part 8: Observability</a><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br />
<br />
<span class='quote'>ChatGPT generated logo..</span><br />
<br />
<span>Let&#39;s continue...</span><br />
<br />
<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br />
<br />
<ul>
<li><a href='#f3s-kubernetes-with-freebsd---part-2-hardware-and-base-installation'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a></li>
<li><a href='#deciding-on-the-hardware'>Deciding on the hardware</a></li>
<li>⇢ <a href='#not-arm-but-intel-n100-'>Not ARM but Intel N100 </a></li>
<li>⇢ <a href='#beelink-unboxing'>Beelink unboxing</a></li>
<li>⇢ <a href='#network-switch'>Network switch</a></li>
<li><a href='#installing-freebsd'>Installing FreeBSD</a></li>
<li>⇢ <a href='#base-install'>Base install</a></li>
<li>⇢ <a href='#latest-patch-level-and-customizing-etchosts'>Latest patch level and customizing <span class='inlinecode'>/etc/hosts</span></a></li>
<li>⇢ <a href='#after-install'>After install</a></li>
<li>⇢ ⇢ <a href='#helix-editor'>Helix editor</a></li>
<li>⇢ ⇢ <a href='#doas'><span class='inlinecode'>doas</span></a></li>
<li>⇢ ⇢ <a href='#periodic-zfs-snapshotting'>Periodic ZFS snapshotting</a></li>
<li>⇢ ⇢ <a href='#uptime-tracking'>Uptime tracking</a></li>
<li><a href='#hardware-check'>Hardware check</a></li>
<li>⇢ <a href='#ethernet'>Ethernet</a></li>
<li>⇢ <a href='#ram'>RAM</a></li>
<li>⇢ <a href='#cpus'>CPUs</a></li>
<li>⇢ <a href='#cpu-throttling'>CPU throttling</a></li>
<li><a href='#wake-on-lan-setup'>Wake-on-LAN Setup</a></li>
<li>⇢ <a href='#setting-up-wol-on-the-laptop'>Setting up WoL on the laptop</a></li>
<li>⇢ <a href='#testing-wol-and-shutdown'>Testing WoL and Shutdown</a></li>
<li>⇢ <a href='#wol-from-wifi'>WoL from WiFi</a></li>
<li>⇢ <a href='#remote-shutdown-via-ssh'>Remote Shutdown via SSH</a></li>
<li>⇢ <a href='#bios-configuration'>BIOS Configuration</a></li>
<li><a href='#conclusion'>Conclusion</a></li>
</ul><br />
<h1 style='display: inline' id='deciding-on-the-hardware'>Deciding on the hardware</h1><br />
<br />
<span>Note that the OpenBSD VMs included in the f3s setup (which will be used later in this blog series for internet ingress - as you know from the first part of this blog series) are already there. These are virtual machines that I rent at OpenBSD Amsterdam and Hetzner.</span><br />
<br />
<a class='textlink' href='https://openbsd.amsterdam'>https://openbsd.amsterdam</a><br />
<a class='textlink' href='https://hetzner.cloud'>https://hetzner.cloud</a><br />
<br />
<span>This means that the FreeBSD boxes need to be covered, which will later be running k3s in Linux VMs via bhyve hypervisor.</span><br />
<br />
<span>I&#39;ve been considering whether to use Raspberry Pis or look for alternatives. It turns out that complete N100-based mini-computers aren&#39;t much more expensive than Raspberry Pi 5s, and they don&#39;t require assembly. Furthermore, I like that they are AMD64 and not ARM-based, which increases compatibility with some applications (e.g., I might want to virtualize Windows (via bhyve) on one of those, though that&#39;s out of scope for this blog series).</span><br />
<br />
<h2 style='display: inline' id='not-arm-but-intel-n100-'>Not ARM but Intel N100 </h2><br />
<br />
<span>I needed something compact, efficient, and capable enough to handle the demands of a small-scale Kubernetes cluster and preferably something I don&#39;t have to assemble a lot. After researching, I decided on the Beelink S12 Pro with Intel N100 CPUs.</span><br />
<br />
<a class='textlink' href='https://www.bee-link.com/products/beelink-mini-s12-pro-n100'>Beelink Mini S12 Pro N100 official page</a><br />
<br />
<span>The Intel N100 CPUs are built on the "Alder Lake-N" architecture. These chips are designed to balance performance and energy efficiency well. With four cores, they&#39;re more than capable of running multiple containers, even with moderate workloads. Plus, they consume only around 8W of power (ok, that&#39;s more than the Pis...), keeping the electricity bill low enough and the setup quiet - perfect for 24/7 operation.</span><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg'><img alt='Beelink preparation' title='Beelink preparation' src='./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg' /></a><br />
<br />
<span>The Beelink comes with the following specs:</span><br />
<br />
<ul>
<li>12th Gen Intel N100 processor, with four cores and four threads, and a maximum frequency of up to 3.4 GHz.</li>
<li>16 GB of DDR4 RAM, with a maximum (official) size of 16 GB (but people could install 32 GB on it).</li>
<li>500 GB M.2 SSD, with the option to install a 2nd 2.5 SSD drive (which I want to make use of later in this blog series).</li>
<li>GBit ethernet</li>
<li>Four USB 3.2 Gen2 ports (maybe I want to mount something externally at some point)</li>
<li>Dimensions and weight: 115*102*39mm, 280g</li>
<li>Silent cooling system.</li>
<li>HDMI output (needed only for the initial installation and maybe for troubleshooting later)</li>
<li>Auto power on via WoL (may make use of it)</li>
<li>Wi-Fi (not going to use it)</li>
</ul><br />
<span>I bought three (3) of them for the cluster I intend to build.</span><br />
<br />
<h2 style='display: inline' id='beelink-unboxing'>Beelink unboxing</h2><br />
<br />
<span>Unboxing was uneventful. Every Beelink PC came with: </span><br />
<br />
<ul>
<li>An AC power adapter</li>
<li>An HDMI cable</li>
<li>A VESA mount with screws (not using it as of now)</li>
<li>Some manuals</li>
<li>The pre-assembled Beelink PC itself.</li>
<li>A "Hello" post card (??)</li>
</ul><br />
<span>Overall, I love the small form factor.</span><br />
<br />
<h2 style='display: inline' id='network-switch'>Network switch</h2><br />
<br />
<span>I went with the tp-link mini 5-port switch, as I had a spare one available. That switch will be plugged into my wall ethernet port, which connects directly to my fiber internet router with 100 Mbit/s down and 50 Mbit/s upload speed.</span><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-2/switch.jpg'><img alt='Switch' title='Switch' src='./f3s-kubernetes-with-freebsd-part-2/switch.jpg' /></a><br />
<br />
<h1 style='display: inline' id='installing-freebsd'>Installing FreeBSD</h1><br />
<br />
<h2 style='display: inline' id='base-install'>Base install</h2><br />
<br />
<span>First, I downloaded the boot-only ISO of the latest FreeBSD release and dumped it on a USB stick via my Fedora laptop:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>[paul@earth]~/Downloads% sudo dd \
  <b><u><font color="#000000">if</font></u></b>=FreeBSD-<font color="#000000">14.1</font>-RELEASE-amd<font color="#000000">64</font>-bootonly.iso \
  of=/dev/sda conv=sync
</pre>
<br />
<span>Next, I plugged the Beelinks (one after another) into my monitor via HDMI (the resolution of the FreeBSD text console seems strangely stretched, as I am using the LG Dual Up monitor), connected Ethernet, an external USB keyboard, and the FreeBSD USB stick, and booted the devices up. With F7, I entered the boot menu and selected the USB stick for the FreeBSD installation.</span><br />
<br />
<span>The installation was uneventful. I selected:</span><br />
<br />
<ul>
<li>Guided ZFS on root (pool <span class='inlinecode'>zroot</span>)</li>
<li>Unencrypted ZFS (I will encrypt separate datasets later; I want it to be able to boot without manual interaction)</li>
<li>Static IP configuration (to ensure that the boxes always have the same IPs, even after switching the router/DHCP server)</li>
<li>I decided to enable the SSH daemon, NTP server, and NTP time synchronization at boot, and I also enabled <span class='inlinecode'>powerd</span> for automatic CPU frequency scaling.</li>
<li>In addition to <span class='inlinecode'>root,</span> I added a personal user, <span class='inlinecode'>paul,</span> whom I placed in the <span class='inlinecode'>wheel</span> group.</li>
</ul><br />
<span>After doing all that three times (once for each Beelink PC), I had three ready-to-use FreeBSD boxes! Their hostnames are <span class='inlinecode'>f0</span>, <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>!</span><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg'><img alt='Beelink installation' title='Beelink installation' src='./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg' /></a><br />
<br />
<h2 style='display: inline' id='latest-patch-level-and-customizing-etchosts'>Latest patch level and customizing <span class='inlinecode'>/etc/hosts</span></h2><br />
<br />
<span>After the first boot, I upgraded to the latest FreeBSD patch level as follows:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># freebsd-update fetch</font></i>
root@f0:~ <i><font color="silver"># freebsd-update install</font></i>
root@f0:~ <i><font color="silver"># freebsd-update reboot</font></i>
</pre>
<br />
<span>I also added the following entries for the three FreeBSD boxes to the <span class='inlinecode'>/etc/hosts</span> file:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># cat &lt;&lt;END &gt;&gt;/etc/hosts</font></i>
<font color="#000000">192.168</font>.<font color="#000000">1.130</font> f0 f0.lan f0.lan.buetow.org
<font color="#000000">192.168</font>.<font color="#000000">1.131</font> f1 f1.lan f1.lan.buetow.org
<font color="#000000">192.168</font>.<font color="#000000">1.132</font> f2 f2.lan f2.lan.buetow.org
END
</pre>
<br />
<span>You might wonder why bother using the hosts file? Why not use DNS properly? The reason is simplicity. I don&#39;t manage 100 hosts, only a few here and there. Having an OpenWRT router in my home, I could also configure everything there, but maybe I&#39;ll do that later. For now, keep it simple and straightforward.</span><br />
<br />
<h2 style='display: inline' id='after-install'>After install</h2><br />
<br />
<span>After that, I installed the following additional packages:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># pkg install helix doas zfs-periodic uptimed</font></i>
</pre>
<br />
<h3 style='display: inline' id='helix-editor'>Helix editor</h3><br />
<br />
<span>Helix? It&#39;s my favourite text editor. I have nothing against <span class='inlinecode'>vi</span> but like <span class='inlinecode'>hx</span> (Helix) more!</span><br />
<br />
<a class='textlink' href='https://helix-editor.com/'>https://helix-editor.com/</a><br />
<br />
<h3 style='display: inline' id='doas'><span class='inlinecode'>doas</span></h3><br />
<br />
<span><span class='inlinecode'>doas</span>? It&#39;s a pretty neat (and KISS) replacement for <span class='inlinecode'>sudo</span>. It has far fewer features than <span class='inlinecode'>sudo</span>, which is supposed to make it more secure. Its origin is the OpenBSD project. For <span class='inlinecode'>doas</span>, I accepted the default configuration (where users in the <span class='inlinecode'>wheel</span> group are allowed to run commands as <span class='inlinecode'>root</span>):</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf</font></i>
</pre>
<br />
<a class='textlink' href='https://man.openbsd.org/doas'>https://man.openbsd.org/doas</a><br />
<br />
<h3 style='display: inline' id='periodic-zfs-snapshotting'>Periodic ZFS snapshotting</h3><br />
<br />
<span><span class='inlinecode'>zfs-periodic</span> is a nifty tool for automatically creating ZFS snapshots. I decided to go with the following configuration here:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># cat &lt;&lt;END &gt;&gt;/etc/periodic.conf</font></i>
daily_zfs_snapshot_enable=<font color="#808080">"YES"</font>
daily_zfs_snapshot_pools=<font color="#808080">"zroot"</font>
daily_zfs_snapshot_keep=<font color="#808080">"7"</font>
weekly_zfs_snapshot_enable=<font color="#808080">"YES"</font>
weekly_zfs_snapshot_pools=<font color="#808080">"zroot"</font>
weekly_zfs_snapshot_keep=<font color="#808080">"5"</font>
monthly_zfs_snapshot_enable=<font color="#808080">"YES"</font>
monthly_zfs_snapshot_pools=<font color="#808080">"zroot"</font>
monthly_zfs_snapshot_keep=<font color="#808080">"6"</font>
END
</pre>
<br />
<a class='textlink' href='https://github.com/ross/zfs-periodic'>https://github.com/ross/zfs-periodic</a><br />
<br />
<span>Note: We have not added <span class='inlinecode'>zdata</span> to the list of snapshot pools. Currently, this pool does not exist yet, but it will be created later in this blog series. <span class='inlinecode'>zrepl</span>, which we will use for replication, later in this blog series will manage the <span class='inlinecode'>zdata</span> snapshots.</span><br />
<br />
<h3 style='display: inline' id='uptime-tracking'>Uptime tracking</h3><br />
<br />
<span><span class='inlinecode'>uptimed</span>? I like to track my uptimes. This is how I configured the daemon:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># cp /usr/local/mimecast/etc/uptimed.conf-dist \</font></i>
  /usr/local/mimecast/etc/uptimed.conf 
root@f0:~ <i><font color="silver"># hx /usr/local/mimecast/etc/uptimed.conf</font></i>
</pre>
<br />
<span>In the Helix editor session, I changed <span class='inlinecode'>LOG_MAXIMUM_ENTRIES</span> to <span class='inlinecode'>0</span> to keep all uptime entries forever and not cut off at 50 (the default config). After that, I enabled and started <span class='inlinecode'>uptimed</span>:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>root@f0:~ <i><font color="silver"># service uptimed enable</font></i>
root@f0:~ <i><font color="silver"># service uptimed start</font></i>
</pre>
<br />
<span>To check the current uptime stats, I can now run <span class='inlinecode'>uprecords</span>:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre> root@f0:~ <i><font color="silver"># uprecords</font></i>
     <i><font color="silver">#               Uptime | System                                     Boot up</font></i>
----------------------------+---------------------------------------------------
-&gt;   <font color="#000000">1</font>     <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">34</font> | FreeBSD <font color="#000000">14.1</font>-RELEASE      Mon Dec  <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font>
----------------------------+---------------------------------------------------
NewRec     <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">33</font> | since                     Mon Dec  <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font>
    up     <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">34</font> | since                     Mon Dec  <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font>
  down     <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">00</font>:<font color="#000000">00</font> | since                     Mon Dec  <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font>
   %up              <font color="#000000">100.000</font> | since                     Mon Dec  <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font>
</pre>
<br />
<span>This is how I track the uptimes for all of my host:</span><br />
<br />
<a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku-</a><br />
<a class='textlink' href='https://github.com/rpodgorny/uptimed'>https://github.com/rpodgorny/uptimed</a><br />
<br />
<h1 style='display: inline' id='hardware-check'>Hardware check</h1><br />
<br />
<h2 style='display: inline' id='ethernet'>Ethernet</h2><br />
<br />
<span>Works. Nothing eventful, really. It&#39;s a cheap Realtek chip, but it will do what it is supposed to do.</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>paul@f0:~ % ifconfig re0
re0: flags=<font color="#000000">1008843</font>&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP&gt; metric <font color="#000000">0</font> mtu <font color="#000000">1500</font>
        options=8209b&lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE&gt;
        ether e8:ff:1e:d7:1c:ac
        inet <font color="#000000">192.168</font>.<font color="#000000">1.130</font> netmask <font color="#000000">0xffffff00</font> broadcast <font color="#000000">192.168</font>.<font color="#000000">1.255</font>
        inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen <font color="#000000">64</font> scopeid <font color="#000000">0x1</font>
        inet6 fd22:c702:acb7:<font color="#000000">0</font>:eaff:1eff:fed7:1cac prefixlen <font color="#000000">64</font> detached autoconf
        inet6 2a01:5a8:<font color="#000000">304</font>:1d5c:eaff:1eff:fed7:1cac prefixlen <font color="#000000">64</font> autoconf pltime <font color="#000000">10800</font> vltime <font color="#000000">14400</font>
        media: Ethernet autoselect (1000baseT &lt;full-duplex&gt;)
        status: active
        nd6 options=<font color="#000000">23</font>&lt;PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL&gt;
</pre>
<br />
<h2 style='display: inline' id='ram'>RAM</h2><br />
<br />
<span>All there:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>paul@f0:~ % sysctl hw.physmem
hw.physmem: <font color="#000000">16902905856</font>

</pre>
<br />
<h2 style='display: inline' id='cpus'>CPUs</h2><br />
<br />
<span>They work:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>paul@f0:~ % sysctl dev.cpu | grep freq:
dev.cpu.<font color="#000000">3</font>.freq: <font color="#000000">705</font>
dev.cpu.<font color="#000000">2</font>.freq: <font color="#000000">705</font>
dev.cpu.<font color="#000000">1</font>.freq: <font color="#000000">604</font>
dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">604</font>
</pre>
<br />
<h2 style='display: inline' id='cpu-throttling'>CPU throttling</h2><br />
<br />
<span>With <span class='inlinecode'>powerd</span> running, CPU freq is dowthrottled when the box isn&#39;t jam-packed. To stress it a bit, I run <span class='inlinecode'>ubench</span> to see the frequencies being unthrottled again:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>paul@f0:~ % doas pkg install ubench
paul@f0:~ % rehash <i><font color="silver"># For tcsh to find the newly installed command</font></i>
paul@f0:~ % ubench &amp;
paul@f0:~ % sysctl dev.cpu | grep freq:
dev.cpu.<font color="#000000">3</font>.freq: <font color="#000000">2922</font>
dev.cpu.<font color="#000000">2</font>.freq: <font color="#000000">2922</font>
dev.cpu.<font color="#000000">1</font>.freq: <font color="#000000">2923</font>
dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">2922</font>
</pre>
<br />
<span>Idle, all three Beelinks plus the switch consumed 26.2W. But with <span class='inlinecode'>ubench</span> stressing all the CPUs, it went up to 38.8W.</span><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-2/watt.jpg'><img alt='Idle consumption.' title='Idle consumption.' src='./f3s-kubernetes-with-freebsd-part-2/watt.jpg' /></a><br />
<br />
<h1 style='display: inline' id='wake-on-lan-setup'>Wake-on-LAN Setup</h1><br />
<br />
<span class='quote'>Updated Sun 11 Jan 10:30:00 EET 2026</span><br />
<br />
<span>As mentioned in the hardware specs above, the Beelink S12 Pro supports Wake-on-LAN (WoL), which allows me to remotely power on the machines over the network. This is particularly useful since I don&#39;t need all three machines running 24/7, and I can save power by shutting them down when not needed and waking them up on demand.</span><br />
<br />
<span>The good news is that FreeBSD already has WoL support enabled by default on the Realtek network interface, as evidenced by the <span class='inlinecode'>WOL_MAGIC</span> option shown in the <span class='inlinecode'>ifconfig re0</span> output above (line 215).</span><br />
<br />
<h2 style='display: inline' id='setting-up-wol-on-the-laptop'>Setting up WoL on the laptop</h2><br />
<br />
<span>To wake the Beelinks from my Fedora laptop (<span class='inlinecode'>earth</span>), I installed the <span class='inlinecode'>wol</span> package:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>[paul@earth]~% sudo dnf install -y wol
</pre>
<br />
<span>Next, I created a simple script (<span class='inlinecode'>~/bin/wol-f3s</span>) to wake and shutdown the machines:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><i><font color="silver">#!/bin/bash</font></i>
<i><font color="silver"># Wake-on-LAN and shutdown script for f3s cluster (f0, f1, f2)</font></i>

<i><font color="silver"># MAC addresses</font></i>
F0_MAC=<font color="#808080">"e8:ff:1e:d7:1c:ac"</font>  <i><font color="silver"># f0 (192.168.1.130)</font></i>
F1_MAC=<font color="#808080">"e8:ff:1e:d7:1e:44"</font>  <i><font color="silver"># f1 (192.168.1.131)</font></i>
F2_MAC=<font color="#808080">"e8:ff:1e:d7:1c:a0"</font>  <i><font color="silver"># f2 (192.168.1.132)</font></i>

<i><font color="silver"># IP addresses</font></i>
F0_IP=<font color="#808080">"192.168.1.130"</font>
F1_IP=<font color="#808080">"192.168.1.131"</font>
F2_IP=<font color="#808080">"192.168.1.132"</font>

<i><font color="silver"># SSH user</font></i>
SSH_USER=<font color="#808080">"paul"</font>

<i><font color="silver"># Broadcast address for your LAN</font></i>
BROADCAST=<font color="#808080">"192.168.1.255"</font>

wake() {
    <b><u><font color="#000000">local</font></u></b> name=$1
    <b><u><font color="#000000">local</font></u></b> mac=$2
    echo <font color="#808080">"Sending WoL packet to $name ($mac)..."</font>
    wol -i <font color="#808080">"$BROADCAST"</font> <font color="#808080">"$mac"</font>
}

shutdown_host() {
    <b><u><font color="#000000">local</font></u></b> name=$1
    <b><u><font color="#000000">local</font></u></b> ip=$2
    echo <font color="#808080">"Shutting down $name ($ip)..."</font>
    ssh -o ConnectTimeout=<font color="#000000">5</font> <font color="#808080">"$SSH_USER@$ip"</font> <font color="#808080">"doas poweroff"</font> <font color="#000000">2</font>&gt;/dev/null &amp;&amp; \
        echo <font color="#808080">"  ✓ Shutdown command sent to $name"</font> || \
        echo <font color="#808080">"  ✗ Failed to reach $name (already down?)"</font>
}

ACTION=<font color="#808080">"${1:-all}"</font>

<b><u><font color="#000000">case</font></u></b> <font color="#808080">"$ACTION"</font> <b><u><font color="#000000">in</font></u></b>
    f0) wake <font color="#808080">"f0"</font> <font color="#808080">"$F0_MAC"</font> ;;
    f1) wake <font color="#808080">"f1"</font> <font color="#808080">"$F1_MAC"</font> ;;
    f2) wake <font color="#808080">"f2"</font> <font color="#808080">"$F2_MAC"</font> ;;
    all|<font color="#808080">""</font>)
        wake <font color="#808080">"f0"</font> <font color="#808080">"$F0_MAC"</font>
        wake <font color="#808080">"f1"</font> <font color="#808080">"$F1_MAC"</font>
        wake <font color="#808080">"f2"</font> <font color="#808080">"$F2_MAC"</font>
        ;;
    shutdown|poweroff|down)
        shutdown_host <font color="#808080">"f0"</font> <font color="#808080">"$F0_IP"</font>
        shutdown_host <font color="#808080">"f1"</font> <font color="#808080">"$F1_IP"</font>
        shutdown_host <font color="#808080">"f2"</font> <font color="#808080">"$F2_IP"</font>
        echo <font color="#808080">""</font>
        echo <font color="#808080">"✓ Shutdown commands sent to all machines."</font>
        <b><u><font color="#000000">exit</font></u></b> <font color="#000000">0</font>
        ;;
    *)
        echo <font color="#808080">"Usage: $0 [f0|f1|f2|all|shutdown]"</font>
        <b><u><font color="#000000">exit</font></u></b> <font color="#000000">1</font>
        ;;
<b><u><font color="#000000">esac</font></u></b>

echo <font color="#808080">""</font>
echo <font color="#808080">"✓ WoL packets sent. Machines should boot in a few seconds."</font>
</pre>
<br />
<span>After making the script executable with <span class='inlinecode'>chmod +x ~/bin/wol-f3s</span>, I can now control the machines with simple commands:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>[paul@earth]~% wol-f3s          <i><font color="silver"># Wake all three</font></i>
[paul@earth]~% wol-f3s f0       <i><font color="silver"># Wake only f0</font></i>
[paul@earth]~% wol-f3s shutdown <i><font color="silver"># Shutdown all three via SSH</font></i>
</pre>
<br />
<h2 style='display: inline' id='testing-wol-and-shutdown'>Testing WoL and Shutdown</h2><br />
<br />
<span>To test the setup, I shutdown all three machines using the script&#39;s shutdown function:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>[paul@earth]~% wol-f3s shutdown
Shutting down f0 (<font color="#000000">192.168</font>.<font color="#000000">1.130</font>)...
  ✓ Shutdown <b><u><font color="#000000">command</font></u></b> sent to f0
Shutting down f1 (<font color="#000000">192.168</font>.<font color="#000000">1.131</font>)...
  ✓ Shutdown <b><u><font color="#000000">command</font></u></b> sent to f1
Shutting down f2 (<font color="#000000">192.168</font>.<font color="#000000">1.132</font>)...
  ✓ Shutdown <b><u><font color="#000000">command</font></u></b> sent to f2

✓ Shutdown commands sent to all machines.
</pre>
<br />
<span>After waiting for them to fully power down (about 1 minute), I sent the WoL magic packets:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>[paul@earth]~% wol-f3s
Sending WoL packet to f0 (e8:ff:1e:d7:1c:ac)...
Waking up e8:ff:1e:d7:1c:ac...
Sending WoL packet to f1 (e8:ff:1e:d7:1e:<font color="#000000">44</font>)...
Waking up e8:ff:1e:d7:1e:<font color="#000000">44</font>...
Sending WoL packet to f2 (e8:ff:1e:d7:1c:a0)...
Waking up e8:ff:1e:d7:1c:a0...

✓ WoL packets sent. Machines should boot <b><u><font color="#000000">in</font></u></b> a few seconds.
</pre>
<br />
<span>Within 30-50 seconds, all three machines successfully booted up and became accessible via SSH!</span><br />
<br />
<h2 style='display: inline' id='wol-from-wifi'>WoL from WiFi</h2><br />
<br />
<span>An important note: **Wake-on-LAN works perfectly even when the laptop is connected via WiFi**. As long as both the laptop and the Beelinks are on the same local network (192.168.1.x), the router bridges the WiFi and wired networks together, allowing the WoL broadcast packets to reach the machines.</span><br />
<br />
<span>This makes WoL very convenient - I can wake the cluster from anywhere in my home, whether I&#39;m on WiFi or ethernet.</span><br />
<br />
<h2 style='display: inline' id='remote-shutdown-via-ssh'>Remote Shutdown via SSH</h2><br />
<br />
<span>While Wake-on-LAN handles powering on the machines remotely, I also added a shutdown function to the script for convenience. The <span class='inlinecode'>wol-f3s shutdown</span> command uses SSH to connect to each machine and execute <span class='inlinecode'>doas poweroff</span>, gracefully shutting them all down.</span><br />
<br />
<span>This is particularly useful for power saving - when I&#39;m done working with the cluster for the day, I can simply run:</span><br />
<br />
<!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre>[paul@earth]~% wol-f3s shutdown
</pre>
<br />
<span>And all three machines will shut down cleanly. The next time I need them, a simple <span class='inlinecode'>wol-f3s</span> command wakes them all back up. This combination makes the cluster very energy-efficient while maintaining quick access when needed.</span><br />
<br />
<h2 style='display: inline' id='bios-configuration'>BIOS Configuration</h2><br />
<br />
<span>For WoL to work reliably, make sure to check the BIOS settings on each Beelink:</span><br />
<br />
<ul>
<li>Enable "Wake on LAN" (usually under Power Management)</li>
<li>Disable "ERP Support" or "ErP Ready" (this can prevent WoL from working)</li>
<li>Enable "Power on by PCI-E" or "Wake on PCI-E"</li>
</ul><br />
<span>The exact menu names vary, but these settings are typically found in the Power Management or Advanced sections of the BIOS.</span><br />
<br />
<h1 style='display: inline' id='conclusion'>Conclusion</h1><br />
<br />
<span>The Beelink S12 Pro with Intel N100 CPUs checks all the boxes for a k3s project: Compact, efficient, expandable, and affordable. Its compatibility with both Linux and FreeBSD makes it versatile for other use cases, whether as part of your cluster or as a standalone system. If you’re looking for hardware that punches above its weight for Kubernetes, this little device deserves a spot on your shortlist.</span><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg'><img alt='Beelinks stacked' title='Beelinks stacked' src='./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg' /></a><br />
<br />
<span>To ease cable management, I need to get shorter ethernet cables. I will place the tower on my shelf, where most of the cables will be hidden (together with a UPS, which will also be added to the setup).</span><br />
<br />
<span>Read the next post of this series:</span><br />
<br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<br />
<span>Other *BSD-related posts:</span><br />
<br />
<a class='textlink' href='./2025-12-07-f3s-kubernetes-with-freebsd-part-8.html'>2025-12-07 f3s: Kubernetes with FreeBSD - Part 8: Observability</a><br />
<a class='textlink' href='./2025-10-02-f3s-kubernetes-with-freebsd-part-7.html'>2025-10-02 f3s: Kubernetes with FreeBSD - Part 7: k3s and first pod deployments</a><br />
<a class='textlink' href='./2025-07-14-f3s-kubernetes-with-freebsd-part-6.html'>2025-07-14 f3s: Kubernetes with FreeBSD - Part 6: Storage</a><br />
<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br />
<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br />
<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br />
<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br />
<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br />
<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let&#39;s Encrypt with OpenBSD and Rex</a><br />
<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br />
<br />
<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br />
<br />
<a class='textlink' href='../'>Back to the main site</a><br />
<p class="footer">
	Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> |
	served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> |
	<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a>
	<br />
	Webring: <a href="https://shring.sh/foo.zone/previous">previous</a> | <a href="https://shring.sh">shring</a> | <a href="https://shring.sh/foo.zone/next">next</a>
</p>
</body>
</html>