main
1<!DOCTYPE html>
2<html lang="en">
3<head>
4<!-- Oct 07, 2022 -->
5<meta charset="utf-8" />
6<meta name="viewport" content="width=device-width, initial-scale=1" />
7<title>Kubernetes on NixOS</title>
8<meta name="author" content="Vincent Demeester" />
9<meta name="generator" content="Org Mode" />
10<link rel='icon' type='image/x-icon' href='/images/favicon.ico'/>
11<meta name='viewport' content='width=device-width, initial-scale=1'>
12<link rel='stylesheet' href='/css/new.css' type='text/css'/>
13<link rel='stylesheet' href='/css/syntax.css' type='text/css'/>
14<link href='/index.xml' rel='alternate' type='application/rss+xml' title='Vincent Demeester' />
15</head>
16<body>
17<main id="content" class="content">
18<header>
19<h1 class="title">Kubernetes on NixOS</h1>
20</header><p>
21This document will serve to document the way I setup my own little personal kubernetes
22cluster on NixOS. I am using virtual machines for this (as of today) because it is simpler
23to use, and as for <a href="microk8s.html">microk8s</a> document, I rely on the fact that my network setup is capable
24of assigning a predefined IP to a given mac address.
25</p>
26
27<section id="outline-container-Why%20Kubernetes%20at%20home%20%3F" class="outline-2">
28<h2 id="Why%20Kubernetes%20at%20home%20%3F">Why Kubernetes at home ?</h2>
29<div class="outline-text-2" id="text-Why%20Kubernetes%20at%20home%20%3F">
30<p>
31The first question that can come to mind is “why the hell do you want to setup a
32kubernetes cluster at home” ? And… that’s a valid question.
33</p>
34
35<p>
36I work daily on Kubernetes and OpenShift, and on a CI/CD tooling that I want to be as
37useful as possible. If I don’t use it myself, what the hell am I doing right ? That’s the
38main reason why setuping a Kubernetes (and of course <a href="https://tekton.dev">Tekton</a> on it) — gaining operational
39knowledge, find the gap and enhancements, …
40</p>
41</div>
42</section>
43
44<section id="outline-container-Bootstrap%20the%20cluster" class="outline-2">
45<h2 id="Bootstrap%20the%20cluster">Bootstrap the cluster</h2>
46<div class="outline-text-2" id="text-Bootstrap%20the%20cluster">
47<p>
48How big should the cluster be ? 3 nodes or 5 nodes ?
49Let’s start with 3, and figure the rest out.
50</p>
51
52<p>
53We need to do the following to boostrap the cluster:
54</p>
55<ul class="org-ul">
56<li>Configure the network to allocate a set of IP for a set a MAC address</li>
57<li>Create VMs images (<code>qcow2</code>) with NixOS and the base system on</li>
58<li>Create VMs on a remote server libvirt</li>
59<li><i>Hopefully</i> enjoy, and <code>ssh</code> onto them in need be</li>
60</ul>
61
62<p>
63Ideally, the image we build is using the configuration, this means we should, in theory,
64use <code>nixos-generate</code> targeting our <i>node</i> configuration, and it should be the exact same thing
65used for <code>morph</code>.
66</p>
67
68<p>
69Once the images are created, we need to copy them to the right host and from there, create
70the virtual machine. Ideally, we do this automatically, command-line, …
71</p>
72</div>
73</section>
74
75
76<section id="outline-container-References" class="outline-2">
77<h2 id="References">References</h2>
78<div class="outline-text-2" id="text-References">
79</div>
80<div id="outline-container-%5B%5Bhttps%3A%2F%2Fnixos.wiki%2Fwiki%2FKubernetes%5D%5BKubernetes%20-%20NixOS%20Wiki%5D%5D" class="outline-3">
81<h3 id="%5B%5Bhttps%3A%2F%2Fnixos.wiki%2Fwiki%2FKubernetes%5D%5BKubernetes%20-%20NixOS%20Wiki%5D%5D"><a href="https://nixos.wiki/wiki/Kubernetes">Kubernetes - NixOS Wiki</a></h3>
82<div class="outline-text-3" id="text-%5B%5Bhttps%3A%2F%2Fnixos.wiki%2Fwiki%2FKubernetes%5D%5BKubernetes%20-%20NixOS%20Wiki%5D%5D">
83<p>
84<span class="timestamp-wrapper"><span class="timestamp">[2020-06-11 Thu 15:25]</span></span>
85</p>
86</div>
87</div>
88</section>
89</main>
90<footer id="postamble" class="status">
91<footer>
92 <small><a href="/" rel="history">Index</a> • <a href="/sitemap.html">Sitemap</a> • <a href="https://dl.sbr.pm/">Files</a></small><br/>
93 <small class='questions'>Questions, comments ? Please use my <a href="https://lists.sr.ht/~vdemeester/public-inbox">public inbox</a> by sending a plain-text email to <a href="mailto:~vdemeester/public-inbox@lists.sr.ht">~vdemeester/public-inbox@lists.sr.ht</a>.</small><br/>
94 <small class='copyright'>
95 Content and design by Vincent Demeester
96 (<a rel='licence' href='http://creativecommons.org/licenses/by-nc-sa/3.0/'>Some rights reserved</a>)
97 </small><br />
98</footer>
99</footer>
100</body>
101</html>