<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Sysadmin on inherent site</title>
		<link>https://inherently.xyz/tags/sysadmin/</link>
		<description>Recent content in Sysadmin on inherent site</description>
		<generator>Hugo</generator>
		<language>en-us</language>
			<lastBuildDate>Sat, 20 Nov 2021 20:56:19 +0200</lastBuildDate>
			<atom:link href="https://inherently.xyz/tags/sysadmin/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>How This Website Is Made</title>
				<link>https://inherently.xyz/blog/how-this-website-is-made/</link>
				<pubDate>Sat, 20 Nov 2021 20:56:19 +0200</pubDate>
				<guid>https://inherently.xyz/blog/how-this-website-is-made/</guid>
				<description>&lt;h2 id=&#34;intro&#34;&gt;Intro&lt;/h2&gt;&#xA;&lt;p&gt;A significant part of having my own site is the way it&amp;rsquo;s made behind the scenes.&#xA;This has changed in a couple different ways for the duration of its existence and in this post I&amp;rsquo;ll try to explain how and why.&lt;/p&gt;&#xA;&lt;h2 id=&#34;beginning&#34;&gt;Beginning&lt;/h2&gt;&#xA;&lt;p&gt;When I first bought &lt;code&gt;inherently.xyz&lt;/code&gt; to host my own website I wanted my site to be built in the way that I&amp;rsquo;d like other sites to be built.&#xA;The main requirements were:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a theme that was mine&lt;/li&gt;&#xA;&lt;li&gt;basically no javascript&lt;/li&gt;&#xA;&lt;li&gt;nothing loading from third-party places&lt;/li&gt;&#xA;&lt;li&gt;code that is easy to understand&lt;/li&gt;&#xA;&lt;li&gt;readable in the devtools&lt;/li&gt;&#xA;&lt;li&gt;reasonably small and fast&lt;/li&gt;&#xA;&lt;li&gt;able to be read on a lot of devices and browsers&lt;/li&gt;&#xA;&lt;li&gt;over the top way to host it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I don&amp;rsquo;t think I have a repository where I developed it but &lt;a href=&#34;https://gitlab.com/insanitywholesale/distrowatch&#34;&gt;this is an archive&lt;/a&gt; of some version of it.&#xA;I&amp;rsquo;ll retell the story of its existence so you don&amp;rsquo;t have to look at the source but it&amp;rsquo;s there if you want to take a look.&lt;/p&gt;&#xA;&lt;h3 id=&#34;evaluation&#34;&gt;Evaluation&lt;/h3&gt;&#xA;&lt;p&gt;In my humble opinion I did fairly well to cover the requirements I had but not as well as I could have.&#xA;However not all was great. For one, I had used bootstrap, the CSS framework, to make the site.&#xA;Because I used the navbar hamburger/button/dropdown thing it required some javascript/jquery which was unfortunate.&#xA;It was my goal to get rid of this but from reading a github issue about it the team behind bootstrap did not feel like providing that functionality through a CSS trick was something they were willing to do.&lt;/p&gt;&#xA;&lt;p&gt;The theme was mostly mine outside of boostrap and it was adapted from someone else&amp;rsquo;s CSS colorscheme.&#xA;As for the code itself, every page consisted of hand-written HTML so that part was easy to read but the minified bootstrap files, aside from being pretty damn big, were unreadable.&#xA;At least the bootstrap files were hosted on my own server and no third-party anything loading so I can check that off the list.&#xA;Additionally, to make the site I had created a file called &lt;code&gt;base.html&lt;/code&gt; containing the basic template of a page which I would manually copy to create a new page and then rsync the files from my computer to the server.&#xA;Surprisingly enough, this worked pretty well although changing code that touched multiple pages like the navigation was somewhat cumbersome.&#xA;Reading the website through a lesser known web browser like &lt;code&gt;netsurf&lt;/code&gt;, &lt;code&gt;surf&lt;/code&gt; or any text-mode web browser was possible so that requirement was basically 100% satisfied.&lt;/p&gt;&#xA;&lt;p&gt;Since the beginning of this site I&amp;rsquo;ve been using docker-compose to host it.&#xA;For this iteration I was using a simple nginx image and mapping the directory on the filesystem to &lt;code&gt;/usr/share/nginx/html&lt;/code&gt; inside the container.&#xA;Traefik was running in front of it acting as a reverse proxy and to support https.&#xA;Overkill for a site that has handwritten HTML? Check.&lt;/p&gt;&#xA;&lt;h2 id=&#34;improvements&#34;&gt;Improvements&lt;/h2&gt;&#xA;&lt;p&gt;There was quite a bit of way to go as you can gather from the above.&#xA;The main pain points were the existence of javascript causing the navigation dropdown to not work on mobile when javascript was disabled, the performance metrics related to using bootstrap in general, dependency on bootstrap and lack of major customization from me.&#xA;The raw HTML workflow was mildly annoying but it never stopped me from writing anything.&lt;/p&gt;&#xA;&lt;h3 id=&#34;solutions&#34;&gt;Solutions&lt;/h3&gt;&#xA;&lt;p&gt;I spent quite a long time trying to find a workaround for the nav dropdown and eventually stumbled into a solution in a post I can&amp;rsquo;t find anymore, I&amp;rsquo;ll update this if I do.&#xA;That worked fine enough and allowed me to get rid of the jquery dependency that, funnily enough, had a vulnerability announced about it while I was rewriting my nav code.&#xA;Bootstrap was also slowing down everything according to all benchmarks I ran.&lt;/p&gt;&#xA;&lt;p&gt;This was all fairly fine for quite a while.&#xA;I kept working on the site, writing stuff and having my own little space on the internet.&#xA;The curse of being into tech and knowing how to make a website even as basic as this was that I wanted to rewrite it.&#xA;That&amp;rsquo;s when I started exploring and found out about &lt;a href=&#34;https://gohugo.io&#34;&gt;hugo&lt;/a&gt;, a fast static site generator (SSG for short) written in Go.&#xA;Given that I was interested in Go at the time of this rewrite and that I knew how the templates worked more or less I decided to give it a try.&lt;/p&gt;&#xA;&lt;h2 id=&#34;hugo&#34;&gt;Hugo&lt;/h2&gt;&#xA;&lt;p&gt;My first idea was to just port it to hugo and then improve it and quickly realized what a mistake that would be.&#xA;Why do one thing you&amp;rsquo;ve never done before if you can do two, right?&#xA;Hugo is a static site generator meaning that it creates the files required for the site once and that&amp;rsquo;s it, the site is not dynamically put together on the client.&#xA;As the author, you mostly write markdown files that are turned into html at build time and then you can put those html files anywhere you&amp;rsquo;d like.&#xA;This is what the site uses to this day and you find the source code for it &lt;a href=&#34;https://gitlab.com/insanitywholesale/inheresite-hugo&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;transitioning&#34;&gt;Transitioning&lt;/h3&gt;&#xA;&lt;p&gt;The real work started when I decided I&amp;rsquo;d make my own theme too.&#xA;I didn&amp;rsquo;t just have to move my content and page structure to it but write some nice fresh CSS too since I decided I&amp;rsquo;ve had enough of bootstrap.&lt;/p&gt;&#xA;&lt;h4 id=&#34;directory-structure&#34;&gt;Directory Structure&lt;/h4&gt;&#xA;&lt;p&gt;The first steps was examining the &lt;a href=&#34;https://gohugo.io/getting-started/directory-structure/&#34;&gt;directory structure&lt;/a&gt;  and finding the most low level template file which is &lt;code&gt;layouts/_default/baseof.html&lt;/code&gt; and making my way up.&#xA;Inside there I defined the very basics of what the HTML would look like, imported my CSS file which at this point had about 5 lines in it and moved on to the other fundamental pages.&#xA;These are &lt;code&gt;layouts/_default/single.html&lt;/code&gt; and &lt;code&gt;layouts/_default/list.html&lt;/code&gt;, the former being about a &amp;ldquo;one of it&amp;rsquo;s kind&amp;rdquo; page and the latter being an aggregation.&#xA;The example here is a blog post and the list of all the blog posts.&#xA;They are based on &lt;code&gt;baseof.html&lt;/code&gt; and in my case are very short, consisting only of the barebones required to implement these types of pages.&#xA;This is because they are overwritten by category-specific &lt;code&gt;single.html&lt;/code&gt; and &lt;code&gt;list.html&lt;/code&gt; which is how I make blog posts have a table of contents and how I make the &lt;code&gt;blog&lt;/code&gt; section look different than the &lt;code&gt;tutorials&lt;/code&gt; section.&lt;/p&gt;&#xA;&lt;h4 id=&#34;layouts&#34;&gt;Layouts&lt;/h4&gt;&#xA;&lt;p&gt;Speaking of sections, the first thing I got up and running was the &lt;code&gt;blog&lt;/code&gt; since that was the easiest one with lots of documentation and examples.&#xA;The second priority was the front page which turned out to be a little bit more complicated.&#xA;You put the content for it inside &lt;code&gt;content/_index.md&lt;/code&gt; and the layout-related stuff inside &lt;code&gt;layouts/index.html&lt;/code&gt;.&#xA;In hindsight it&amp;rsquo;s fairly intuitive but it took a few minutes of digging when I was less familiar.&#xA;For each sub-category you can basically include no layout files in which case the &lt;code&gt;list.html&lt;/code&gt; and &lt;code&gt;single.html&lt;/code&gt; from &lt;code&gt;layouts/_default&lt;/code&gt; will be used or you can write ones that will override them.&#xA;As an example, in &lt;code&gt;layouts/tutorials&lt;/code&gt; I have both a &lt;code&gt;list.html&lt;/code&gt; and a &lt;code&gt;single.html&lt;/code&gt; to build the tutorial-related pages in their own way.&lt;/p&gt;&#xA;&lt;p&gt;Layouts are pretty cool and probably my favorite thing is partial layouts.&#xA;These allow you to put a snippet in a file, let&amp;rsquo;s say &lt;code&gt;footer.html&lt;/code&gt; and then include it using &lt;code&gt;{{ partial &amp;quot;footer&amp;quot; . }}&lt;/code&gt; in another template.&#xA;One other example is the contact form, I just made a &lt;code&gt;layouts/contact/list.html&lt;/code&gt; that has the line &lt;code&gt;{{ partial &amp;quot;comments.html&amp;quot; . }}&lt;/code&gt;  and this way I can keep the template cleaner and allow reusing that comment submission form elsewhere too.&#xA;So I just went around creating my categories, writing specific list or single templates for them if required and throwing some pieces of reusable code in partial layout templates.&lt;/p&gt;&#xA;&lt;h4 id=&#34;css&#34;&gt;CSS&lt;/h4&gt;&#xA;&lt;p&gt;The most involved part was by far the CSS.&#xA;I have to say that if it&amp;rsquo;s not obvious by now I&amp;rsquo;m not a &amp;ldquo;frontend person&amp;rdquo; per se, I just want something that looks clean, fast and readable.&#xA;As a disclaimer, I&amp;rsquo;m not a fan of the size of the fonts which are by far the biggest element right now but I&amp;rsquo;m a huge fan of the fira font family (with the exception of fira code cause I hate ligatures) but they work well enough.&#xA;It took the majority of the time and had the most updates, tweaks and fixes by far compared to anything else.&#xA;Essentially nothing from the original CSS is the same except the colors which was a long process but a necessary one to get where I wanted to be.&#xA;In the end I&amp;rsquo;m satisfied with it, I think it looks fairly unique and serves its purpose well while coming in at under 200 lines (it is way less in reality but the number balloons up because of the way I format the code).&lt;/p&gt;&#xA;&lt;h4 id=&#34;docker&#34;&gt;Docker&lt;/h4&gt;&#xA;&lt;p&gt;This time I went with a custom docker image so I could have more control and no filesystem bind mounts.&#xA;The main problem is that the hugo team does not publish an official docker image so I had to use the following to get hugo installed in the container in order to generate the site (most current Dockerfile is in &lt;a href=&#34;https://gitlab.com/insanitywholesale/inheresite-hugo/-/blob/master/Dockerfile&#34;&gt;the git repository&lt;/a&gt;, check there first before copying):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-dockerfile&#34; data-lang=&#34;dockerfile&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;golang:1.16&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;as&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;buildsite&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;ENV&lt;/span&gt; CGO_ENABLED &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;WORKDIR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;/go/src&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;RUN&lt;/span&gt; git clone https://github.com/gohugoio/hugo.git&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;WORKDIR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;/go/src/hugo&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;RUN&lt;/span&gt; go install -v&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;WORKDIR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;/go/src/inheresite-hugo&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;COPY&lt;/span&gt; . .&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;RUN&lt;/span&gt; hugo&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;nginx:alpine&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;COPY&lt;/span&gt; default.conf /etc/nginx/conf.d/&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;COPY&lt;/span&gt; --from&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;buildsite /go/src/inheresite-hugo/public /usr/share/nginx/html&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;This means I compile hugo every time I want to upload a post but it goes fairly fast and gives a bit of time to reflect on what I&amp;rsquo;ve written.&#xA;If this is not for you, use either an ubuntu image and install it with apt if you don&amp;rsquo;t need the latest features or an arch one if you need the latest release for some reason.&#xA;Using third-party images is a last resort but those are technically also usable for this purpose however I&amp;rsquo;d advise against using images from random people.&lt;/p&gt;&#xA;&lt;h3 id=&#34;impressions&#34;&gt;Impressions&lt;/h3&gt;&#xA;&lt;p&gt;After a long while with hugo I think I&amp;rsquo;ll be sticking with it.&#xA;It allows for some pretty clean code, I&amp;rsquo;m partial to Go templating and it has served me well.&#xA;I&amp;rsquo;d like to look into some small improvements such as merging tutorials into blog and just displaying them in a different way but that&amp;rsquo;s a topic for another day.&#xA;The full server-side syntax highlighting is awesome too, I thought I&amp;rsquo;d need to cave and use some javascript thing to do it but thankfully it worked out great and I found a code theme that matches the rest of the site.&#xA;If you want to get started with it, just make sure you know some basic HTML and have some patience, the rest can be figured out in an evening.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;The site you&amp;rsquo;re currently looking at has been a while in the making and there are still a couple items on my &lt;code&gt;TODO.md&lt;/code&gt; for it but I&amp;rsquo;m happy enough with it for now.&#xA;You might want to check out &lt;a href=&#34;https://github.com/insanitywholesale/gommenter&#34;&gt;the comment microservice&lt;/a&gt; I wrote for use with the comment form mentioned a bit above, it&amp;rsquo;s far from perfect but it gets the job done.&#xA;Thank you for reading this, I hope you enjoyed it and maybe even learned something.&lt;/p&gt;&#xA;</description>
			</item>
			<item>
				<title>Flux Update</title>
				<link>https://inherently.xyz/blog/flux-update/</link>
				<pubDate>Wed, 25 Aug 2021 00:44:34 +0300</pubDate>
				<guid>https://inherently.xyz/blog/flux-update/</guid>
				<description>&lt;p&gt;I wrote about my journey of choosing a continuous deployment tool and why I ultimately ended up using &lt;a href=&#34;https://toolkit.fluxcd.io/&#34;&gt;flux&lt;/a&gt; for my homelab &lt;a href=&#34;https://inherently.xyz/blog/fluxing-my-cluster/&#34;&gt;in this post&lt;/a&gt;.&#xA;It took quite a bit of reasearch and if you&amp;rsquo;re in a similar position as I was it might prove to be helpful.&lt;/p&gt;&#xA;&lt;h2 id=&#34;longish-term-experience&#34;&gt;Long(ish)-term experience&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been using it for about 5 months now, the first post was written about one month of use.&#xA;At that point I had been tinkering with it and attempting to get all the stuff I wanted to be deployed by it.&#xA;Some things were simple, others not so straight-forward.&lt;/p&gt;&#xA;&lt;h3 id=&#34;successes&#34;&gt;Successes&lt;/h3&gt;&#xA;&lt;h4 id=&#34;deploying-raw-manifest-applications&#34;&gt;Deploying raw manifest applications&lt;/h4&gt;&#xA;&lt;p&gt;Deploying raw kubernetes manifests was really easy.&#xA;Since I&amp;rsquo;m somewhat on the fence about Helm, I prefer using normal kubernetes manifests where possible.&#xA;This meant that for my use case mostly everything was smooth sailing after figuring out how to generate a kustomization yaml using the command-line tool.&lt;/p&gt;&#xA;&lt;h4 id=&#34;command-line-tool&#34;&gt;Command-line tool&lt;/h4&gt;&#xA;&lt;p&gt;Speaking of that, flux has a command-line tool to interact with the controllers running inside the cluster.&#xA;It&amp;rsquo;s also the way you can initialize a repository to be used as the place for flux files to be stored.&#xA;It can also be used to install flux to the cluster if the repository already exists.&lt;/p&gt;&#xA;&lt;h4 id=&#34;upgrading&#34;&gt;Upgrading&lt;/h4&gt;&#xA;&lt;p&gt;When a new version of flux comes out, you can upgrade and it will carry over to the cluster.&#xA;It&amp;rsquo;s really easy, it just upgrades its own files so when those are committed it will pull in the new version of the controllers.&lt;/p&gt;&#xA;&lt;h3 id=&#34;trouble&#34;&gt;Trouble&lt;/h3&gt;&#xA;&lt;h4 id=&#34;aggregation-yaml&#34;&gt;Aggregation yaml&lt;/h4&gt;&#xA;&lt;p&gt;For starters here is a minor one that took way too long to diagnose.&#xA;I forget exactly what this is called but essentially it is a yaml file says run deal with the listed resources.&#xA;Imagine the following directory contents:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;drwxrwxr-x 4 angle angle 4,0K Αυγ  25 01:23 .&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;drwxrwxr-x 5 angle angle 4,0K Ιουλ 21 03:42 ..&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;drwxrwxr-x 2 angle angle 4,0K Αυγ  13 15:55 helmrepos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;-&lt;span class=&#34;l&#34;&gt;rw-rw-r-- 1 angle angle  219 Ιουλ 21 03:20 infra-source.yml&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;-&lt;span class=&#34;l&#34;&gt;rw-rw-r-- 1 angle angle  126 Αυγ  12 11:45 kustomization.yaml&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;l&#34;&gt;drwxrwxr-x 2 angle angle 4,0K Αυγ  13 15:56 storage&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;kustomization.yaml&lt;/code&gt; file is as follows:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;&#xA;&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5&#xA;&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6&#xA;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#xA;&lt;td class=&#34;lntd&#34;&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;apiVersion&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;kustomize.config.k8s.io/v1beta1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;kind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;Kustomization&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;resources&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;infra-source.yml&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;helmrepos&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;storage&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;So it&amp;rsquo;s a way to more easily include stuff.&#xA;The issue I had is that I named the file &lt;code&gt;kustomization.yml&lt;/code&gt; instead of &lt;code&gt;kustomization.yaml&lt;/code&gt; which for some reason isn&amp;rsquo;t supported.&#xA;I believe this is a bug and not intended behavior but it was still frustrating to find and fix.&lt;/p&gt;&#xA;&lt;h4 id=&#34;logs&#34;&gt;Logs&lt;/h4&gt;&#xA;&lt;p&gt;Now on to more substantial issues.&#xA;While troubleshooting I got a bit frustrated with how flux displays errors.&#xA;The messages are fairly non-descript and there isn&amp;rsquo;t a lot of guidance for how to fix them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Despite a couple rough edges, flux has been working incredibly well.&#xA;Even before I got it fully functioning, it was amazing to be able to just install it to a newly creted cluster and have all my applications running just like that.&#xA;It&amp;rsquo;s almost magical and I&amp;rsquo;ve been enjoying it quite a lot.&#xA;If you aren&amp;rsquo;t using a continuous deployment tool, feel free to give &lt;a href=&#34;https://toolkit.fluxcd.io/&#34;&gt;flux&lt;/a&gt; a try or read the previous post to learn about some other options&lt;/p&gt;&#xA;</description>
			</item>
			<item>
				<title>Droning On</title>
				<link>https://inherently.xyz/blog/droning-on/</link>
				<pubDate>Sat, 01 May 2021 18:54:59 +0300</pubDate>
				<guid>https://inherently.xyz/blog/droning-on/</guid>
				<description>&lt;p&gt;I described previously how the deployment of applications is automated in my homelab but didn&amp;rsquo;t touch upon how I test my own code.&#xA;The topic came up when I started trying to simulate a development pipeline who&amp;rsquo;s first step after committing code is to be run through the continuous integration system.&#xA;What should that system be though?&#xA;In this post, I&amp;rsquo;ll take you through the things I tried first and then why I went with &lt;a href=&#34;https://www.drone.io/&#34;&gt;drone&lt;/a&gt; in the end.&lt;/p&gt;&#xA;&lt;h2 id=&#34;choose-a-fighter&#34;&gt;Choose a Fighter&lt;/h2&gt;&#xA;&lt;p&gt;My quest is to ultimately end up with the skills to set up kubernetes so that it can be deployed to everything from a DIY NAS and a stack of NUCs to a warehouse full of servers backed by distributed storage.&#xA;I&amp;rsquo;m obviously more towards the first camp so that&amp;rsquo;s where my journey is at.&#xA;With that said, my goal is to have software small and lightweight enough that it can run on the former setup easily so that there can be multiple instances of it in the latter form.&#xA;The current mental model I have is developer organization with not much more than 3 NUCs + 1 NAS per team without losing the ability for continuous integration and continuous deployment.&#xA;Therefore the landscape needs to be explored and the obvious titan of the old world is &lt;a href=&#34;https://www.jenkins.io/&#34;&gt;jenkins&lt;/a&gt; with many newcomers eager to take its place.&#xA;The obvious caveats still apply, it must be open-source, able to be self-hosted, support for gitea is needed and being able to run well on kubernetes is a foregone conclusion.&lt;/p&gt;&#xA;&lt;h3 id=&#34;jenkins&#34;&gt;Jenkins&lt;/h3&gt;&#xA;&lt;p&gt;It should need no introduction, most developers are familiar with the trusty crusty old butler software.&#xA;&lt;a href=&#34;https://www.jenkins.io/&#34;&gt;Jenkins&lt;/a&gt; is probably one of the most prominent pieces of CI/CD software that was pushed to the forefront when the push for more automation and increased code quality really happened.&#xA;Sadly there are a few reasons that annoyed me from the get-go.&#xA;First, the unlocking procedure requires you to &lt;code&gt;kubectl logs &amp;lt;podname&amp;gt;&lt;/code&gt; in order to find the unlock key which I understand but nonetheless find annoying.&#xA;Second, the &lt;code&gt;Jenkinsfile&lt;/code&gt; has its own domain-specific language (DSL for short) that I find unappealing even though you won&amp;rsquo;t catch me praising YAML&amp;rsquo;s lack of curly braces.&#xA;I begrudgingly went though it and wrote a &lt;code&gt;Jenkinsfile&lt;/code&gt; to give it a fair chance but it wasn&amp;rsquo;t a nice experience.&#xA;Next, a single instance uses too much ram to the point that it can barely fit in my k3s VMs which use 2.5GB of ram each together with other software.&#xA;This is an issue because I like running at least 2 instances of most applications to be sure that everything works correctly when scaling up.&#xA;Last but not least, it&amp;rsquo;s a 2-in-1 solution which I don&amp;rsquo;t find appealing as far as architecture and since I was planning to find a standalone piece of software to do CI and another one to handle CD, it was a hard sell from the start.&#xA;As a redeeming quality it has an official kubernetes pipeline plugin which is nice so they&amp;rsquo;ve at least put thought into this use case.&#xA;Ultimately it wasn&amp;rsquo;t the right fit for me so it was time to move on.&lt;/p&gt;&#xA;&lt;h3 id=&#34;drone&#34;&gt;Drone&lt;/h3&gt;&#xA;&lt;p&gt;While pondering this I remembered an old post from one of the blogs I read, specifically &lt;a href=&#34;https://christine.website/blog/drone-kubernetes-cd-2020-07-10&#34;&gt;this one&lt;/a&gt;.&#xA;I said what the hell, why not and started looking its website.&#xA;&lt;a href=&#34;https://www.drone.io/&#34;&gt;Drone&lt;/a&gt; is a very nice and simple continuous integration tool.&#xA;From the start it seemed like it would be a good pick but you never know until you try.&#xA;I wrote some kubernetes manifests, got angry until I got them to work and a half hour later it was hooked up to my local gitea instance and ready to use.&#xA;I added a &lt;code&gt;.drone.yml&lt;/code&gt; to one of my repos, pushed the change, activated the repo from the drone dashboard, made another change to the source code, pushed it and waited to see what happened.&#xA;Instantly drone received the webhook event and got to work.&#xA;The dashboard is pretty simple (and sadly lacks a dark mode) so you just hit the thing you want to look at, click on the build and see it happen.&#xA;It supports different things running at the same time like databases if you want your tests to include that which can be run either as what drone calls &lt;code&gt;services&lt;/code&gt; aka run in the background from the beginning or if you want an ordered dependency you can use detached steps which is especially useful in microservices.&#xA;My only real complaint aside from the lack of dark mode is the inability to trigger a build manually without pushing but that&amp;rsquo;s only an issue when you first activate a repository inside drone&amp;rsquo;s dashboard.&#xA;All in all, it has been a joy to use, most of the projects I am currently developing have a &lt;code&gt;.drone.yml&lt;/code&gt; and get built at least 3 times a day when gitea mirrors the gitlab or github repo they&amp;rsquo;re mainly hosted at.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;This wasn&amp;rsquo;t as big of a journey as finding a continuous development tool because really I only found the two aforementioned options that had the basics I was looking for and one of them didn&amp;rsquo;t really fit the bill.&#xA;I&amp;rsquo;m not huge into software development, it&amp;rsquo;s mostly a hobby for me as might be obvious by now, since my main concern is infrastructure-related stuff.&#xA;With that said it&amp;rsquo;s useful to have the skills to build an application that can communicate with the kubernets api to automate something or write an ansible module and most of all it allows me to see the developer perspective.&#xA;I haven&amp;rsquo;t started looking into &lt;a href=&#34;https://github.com/mozilla/sops&#34;&gt;SOPS&lt;/a&gt; or &lt;a href=&#34;https://renovatebot.com/&#34;&gt;renovate bot&lt;/a&gt; or the &lt;a href=&#34;https://github.com/rancher/system-upgrade-controller&#34;&gt;k3s upgrade controller&lt;/a&gt; or &lt;a href=&#34;https://velero.io&#34;&gt;velero&lt;/a&gt; but I hope to get the chance to do so in the future.&#xA;Thank you for reading, I hope you enjoyed it and maybe learned something.&lt;/p&gt;&#xA;</description>
			</item>
			<item>
				<title>Fluxing My Cluster</title>
				<link>https://inherently.xyz/blog/fluxing-my-cluster/</link>
				<pubDate>Sat, 17 Apr 2021 17:24:22 +0300</pubDate>
				<guid>https://inherently.xyz/blog/fluxing-my-cluster/</guid>
				<description>&lt;p&gt;It&amp;rsquo;s no secret that I&amp;rsquo;m a fan of automation and making life easier (even if I made it harder in the first place).&#xA;One of the issues I&amp;rsquo;ve been having in my homelab is dealing with deploying stuff to kubernetes.&#xA;Initially I wanted to just add a plugin to &lt;a href=&#34;https://www.drone.io/&#34;&gt;drone&lt;/a&gt; and be done with it.&#xA;However, that didn&amp;rsquo;t really pan out which ended up being to my benefit since I discovered &lt;a href=&#34;https://toolkit.fluxcd.io/&#34;&gt;flux&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;The cluster in its current state is a little sad because I end up doing too many things manually.&#xA;Whenever something changes it&amp;rsquo;s time to bring out ye old &lt;code&gt;kubectl apply -f&lt;/code&gt; in a local clone of the repo and that doesn&amp;rsquo;t spark joy.&#xA;This was obviously bad form and couldn&amp;rsquo;t continue.&#xA;What you also have to keep in mind is that I&amp;rsquo;ve chosen a 3rd-party storage plugin, &lt;a href=&#34;&#34;&gt;democratic-csi&lt;/a&gt; and assume it&amp;rsquo;s the default storageclass in the cluster.&#xA;This means that on a new cluster it&amp;rsquo;s required that before anything else, that one is added as a storageclass and set as default and &lt;code&gt;local-path&lt;/code&gt; is removed from being a default.&#xA;After that, the applications can be deployed which includes a mix of stuff I&amp;rsquo;ve written for the purposes of testing as well as 3rd-party software.&#xA;Now that the stage has been set, let&amp;rsquo;s see what I tried&lt;/p&gt;&#xA;&lt;h2 id=&#34;solutions&#34;&gt;Solutions&lt;/h2&gt;&#xA;&lt;h3 id=&#34;drone-ci-plugin&#34;&gt;Drone CI plugin&lt;/h3&gt;&#xA;&lt;p&gt;Initially the idea was that since I&amp;rsquo;ve alrady solved this for code using drone for CI (this will be discussed in a later post), I could just use a plugin and be done.&#xA;However, my experience with writing helm charts is limited and the only official plugin for deploying to kubernetes is for helm charts, not kubernetes manifests.&#xA;Furthermore, as I mentioned previously, not all software deployed on the cluster is something that I have written so even if there was an official kubernetes manifest plugin it wouldn&amp;rsquo;t cover 3rd-party software.&#xA;At this point, I was thinking of finding some all-inclusive CI/CD software that would cover everything I wanted to do.&#xA;It took no more than 10 seconds of thinking to realize that I was looking for non-modular software and discard that idea.&lt;/p&gt;&#xA;&lt;h3 id=&#34;standalone-continuous-delivery&#34;&gt;Standalone Continuous Delivery&lt;/h3&gt;&#xA;&lt;p&gt;This was the obvious choice but the software in this category is plentiful.&#xA;The main competitors were &lt;a href=&#34;https://toolkit.fluxcd.io/&#34;&gt;flux&lt;/a&gt;, &lt;a href=&#34;https://argoproj.github.io/projects/argo-cd/&#34;&gt;argo&lt;/a&gt; and &lt;a href=&#34;https://tekton.dev/&#34;&gt;tekton&lt;/a&gt;.&#xA;Their designs differ quite a bit so there is going to be quite a bit of opinion in the following analysis so just keep that in mind.&#xA;The few things they had in common were that they were all advertised as cloud-native with support for kubernetes, had a cli and were written in Go.&lt;/p&gt;&#xA;&lt;h4 id=&#34;argocd&#34;&gt;ArgoCD&lt;/h4&gt;&#xA;&lt;p&gt;I started with argo because one of the people that wrote a really good blog post on using kubernetes at home mentioned that they use it so I thought I&amp;rsquo;d try it first.&#xA;The installation process required a massive yaml file that you just &lt;code&gt;curl | kubectl apply -f&lt;/code&gt; which I wasn&amp;rsquo;t a big fan of but alright whatever.&#xA;It also had a weird unlock procedure like jenkins where you have to find a token generated at runtime to unlock it but that&amp;rsquo;s okay, just an one-time setup thing.&#xA;After spending a couple evenings with it, I wasn&amp;rsquo;t satisfied with the experience.&#xA;The docs weren&amp;rsquo;t really good at explaining all the argo custom resources and getting a basic single-pod application running took me more than 2 hours.&#xA;It was doable but this was going to be something I had to do for every application running on my cluster and the prospect didn&amp;rsquo;t seem appealing.&#xA;I&amp;rsquo;m sure with more time I could maybe become more familiar and eventually warm up to it however first impressions were bad so I decided to move on.&lt;/p&gt;&#xA;&lt;h4 id=&#34;tekton&#34;&gt;Tekton&lt;/h4&gt;&#xA;&lt;p&gt;Tekton&amp;rsquo;s marketing was interesting so I took a look at it next.&#xA;It seemed to be easier to set up and a couple random blog posts seemed to praise it so I downloaded another massive installation yaml which the guide told me to just &lt;code&gt;kubectl apply -f&lt;/code&gt; which is okay I guess.&#xA;I spent a few hours with it and it became clear you basically had to use it both for CI and CD so I put it to the side and moved on.&lt;/p&gt;&#xA;&lt;h4 id=&#34;flux&#34;&gt;Flux&lt;/h4&gt;&#xA;&lt;p&gt;So why did I mention this one first but try it last?&#xA;A few reasons.&#xA;While researching, the v1 -&amp;gt; v2 development effort was going on and v2 didn&amp;rsquo;t have a lot of features but v1 was being phased out so I didn&amp;rsquo;t know if I should spend time learning v1 while v2 was coming along or if it&amp;rsquo;s worth jumping into alpha/beta stage software to avoid using legacy versions.&#xA;By the time I did get around to it though v2 was clearly the way forward.&#xA;Not only was it officially endorsed but among people that self-host, it was already the way to go 6-12 months ago.&#xA;The docs were pretty clear, the cli was cross-platform and could be installed on a Raspberry Pi (something that argo at the time didn&amp;rsquo;t have available) and the examples worked.&#xA;In an evening I had learned basically everything I needed to in order to just drop it in, generate the flux CRDs for my existing kubernetes manifests as well as helm charts and be up and running.&#xA;The only issue I had, probably just a pet peeve of mine, was that the repo it creates on github is private by default and my goal is to have everything public and also secure (not there yet) but whatever.&#xA;Flux v2 also mentioned as the gitops toolkit is made up of several different parts that have a specific purpose which is something I certainly appreciate.&#xA;All in all, I think I&amp;rsquo;m going to stick with flux but you never know how homelab things will end up.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Flux is a really great project and I&amp;rsquo;ve enjoyed using it so far.&#xA;The problem of continuous delivery has been solved for me and I recommend checking out if you&amp;rsquo;re in a similar position.&#xA;Next up, I&amp;rsquo;m going to look at &lt;a href=&#34;https://renovatebot.com/&#34;&gt;renovate bot&lt;/a&gt; for automating image updates, &lt;a href=&#34;https://github.com/mozilla/sops&#34;&gt;SOPS&lt;/a&gt; for secret management (which &lt;a href=&#34;https://toolkit.fluxcd.io/guides/mozilla-sops/&#34;&gt;flux supports&lt;/a&gt; and &lt;a href=&#34;https://github.com/rancher/system-upgrade-controller&#34;&gt;an upgrade controller&lt;/a&gt;) to further help automate operations.&#xA;Thank you for reading, I hope you enjoyed it and maybe learned something.&lt;/p&gt;&#xA;</description>
			</item>
			<item>
				<title>Homelab Current Form</title>
				<link>https://inherently.xyz/blog/homelab-current-form/</link>
				<pubDate>Sun, 07 Feb 2021 14:35:32 +0200</pubDate>
				<guid>https://inherently.xyz/blog/homelab-current-form/</guid>
				<description>&lt;p&gt;The first part of the software changes I made was covered &lt;a href=&#34;https://inherently.xyz/blog/homelab-evolved/&#34;&gt;in the first part&lt;/a&gt; where I explained how and why I started going down this path.&lt;/p&gt;&#xA;&lt;h2 id=&#34;software-choices&#34;&gt;Software choices&lt;/h2&gt;&#xA;&lt;p&gt;This whole journey was about making my home infrastructure better.&#xA;Part of that was about having a way to more easily create the foundation on which kubernetes would run on, as well as describing my setup as code.&#xA;Proxmox is a beast in its own right. Features include being able to manage kvm virtual machines and lxc containers, an API that can be used to interact with it programmatically and most importantly being open source.&#xA;While researching what automation tools could interact with proxmox, I found a community-made terraform provider as well as a set of two ansible community modules (kvm and lxc).&#xA;After thinking about it a little bit, I wanted to use terraform in a non-cloud environment but also gather some knowledge about it so that’s what I decided to use.&#xA;I can have my provisioning requirements in a file that terraform understands and store it in git which is exactly what I was going for.&#xA;Ansible is still in the picture since it is used to set up and configure the debian environment inside the virtual machines.&#xA;Now that the hypervisor part is covered, let&amp;rsquo;s move on to running services.&lt;/p&gt;&#xA;&lt;h2 id=&#34;making-it-store-is-harder-than-making-it-run&#34;&gt;Making it store is harder than making it run&lt;/h2&gt;&#xA;&lt;p&gt;As mentioned &lt;a href=&#34;https://inherently.xyz/blog/homelab-evolved/&#34;&gt;in the first part about software changes&lt;/a&gt;, I was learning kubernetes and now I could not only wipe and recreate the cluster itself but also the entire virtual machines that it was running on.&#xA;Some time after starting to use proxmox with terraform I attempted to use rancher to manage kubernetes but ended up ditching it due to various problems with running even basic stuff on it (very likely that it’s a case of PEBCAK, I don’t think rancher is terrible or anything like that).&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-problem&#34;&gt;The problem&lt;/h3&gt;&#xA;&lt;p&gt;However the problem of shared storage continued to taunt me for the following months.&#xA;There was seemingly nothing that a simple fella could do to use a nice and simple NAS running truenas core as storage that is able to be dynamically provisioned for use by kubernetes.&#xA;Now, I hear you, &amp;ldquo;what about nfs-client-provisioner&amp;rdquo;, someone less familiar with this pile of madness might exclaim.&#xA;Indeed it does exist and barely work except the helm chart for it is deprecated and it does not work with kubernetes version 1.20 and later since it does not seem to be using CSI drivers.&lt;/p&gt;&#xA;&lt;h3 id=&#34;i-really-tried&#34;&gt;I really tried&lt;/h3&gt;&#xA;&lt;p&gt;Months of furious and frustrating testing ensued.&#xA;Not only was I trying to get applications running on kubernetes, I was also fighting with the unexpectedly complex tast of using the storage server I had available.&lt;/p&gt;&#xA;&lt;h4 id=&#34;glusterfs&#34;&gt;glusterfs&lt;/h4&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve gone through basically any and all commonly suggested options for dynamically provisioned storage.&#xA;Prette early on I tried glusterfs with heketi by making 3 LXC containers and mounting an nfs share to each one that would serve as the brick in the gluster volume.&#xA;Suffice it to say that it didn&amp;rsquo;t work and things were getting out of hand.&lt;/p&gt;&#xA;&lt;h4 id=&#34;longhorn&#34;&gt;longhorn&lt;/h4&gt;&#xA;&lt;p&gt;After a bit more research and I found out that longhorn, another project by the authors of k3s, used iscsi to communicate with kubernetes.&#xA;That could work I thought, except there was no coherent example of how to use it without using targetd for iscsi.&#xA;Longhorn was starting to look more appealing, I could just put the virtual drives of the VMs on an nfs share, run longhorn inside the VMs to pool all their storage together and call it good enough.&#xA;No, I could not give up yet.&#xA;A sub-optimal solution would do if there was no other way but I was convinced something more was out there.&#xA;My patience and hope were running out but not empty yet.&lt;/p&gt;&#xA;&lt;h4 id=&#34;success&#34;&gt;success&lt;/h4&gt;&#xA;&lt;p&gt;That all changed in early January where during my nearly daily search for possible storage solutions I hadn’t tried, I found out about &lt;a href=&#34;https://github.com/democratic-csi/democratic-csi&#34;&gt;democratic-csi&lt;/a&gt;.&#xA;This was it. Made to be used with freenas, truenas as well as DIY ZFS setups.&#xA;The silver bullet was here.&#xA;Just a few minutes of reading about it and writing my configs, a short(read: long) helm command later and&amp;hellip;success!&#xA;The test pod was using the newly created storageclass that was backed by the nfs share on truenas.&#xA;After that I rushed to deploy my standard set of gitea, droneci and minecraft to test it out and it was working for real without a hitch.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;This was a long journey and it isn’t coming to a close any time soon.&#xA;The next step is to continuous deployment but that’s an issue for another time.&#xA;To conclude as briefly as possible, I’ve no put most of the critical pieces of my homelab in a single git repo that I can use to recreate almost all of it from scratch with minimal manual intervention (there are still a few quirks like not having dynamic inventory for ansible and having to manually copy IPs but I can put that aside for now).&#xA;Despite the imperfections like not having dynamic inventory for ansible or having secrets stored unencrypted in git, I&amp;rsquo;m very happy with the setup is working.&#xA;If you missed them, make sure to check out the &lt;a href=&#34;https://inherently.xyz/blog/hardware-updates-2020/&#34;&gt;hardware updates&lt;/a&gt; and &lt;a href=&#34;https://inherently.xyz/blog/homelab-evolved/&#34;&gt;the first part about software changes&lt;/a&gt; for a better of what I&amp;rsquo;ve been up to.&lt;/p&gt;&#xA;</description>
			</item>
			<item>
				<title>Homelab Evolved</title>
				<link>https://inherently.xyz/blog/homelab-evolved/</link>
				<pubDate>Sun, 07 Feb 2021 13:53:10 +0200</pubDate>
				<guid>https://inherently.xyz/blog/homelab-evolved/</guid>
				<description>&lt;p&gt;The hardware side of the changes made to my homelab were covered &lt;a href=&#34;https://inherently.xyz/blog/hardware-updates-2020/&#34;&gt;in a previous post&lt;/a&gt; where I also alluded to some software changes.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-came-before&#34;&gt;What came before&lt;/h2&gt;&#xA;&lt;p&gt;This is the first part explaining more in-depth the issues that I had and how I dealt with them.&#xA;Let&amp;rsquo;s set the stage first, my homelab was working fine in many ways.&#xA;It was nice and stable debian install running kvm virtual machines using qemu and libvirt with virt-manager to perform the simpler start/stop tasks.&#xA;There was really nothing wrong with it, I was exploring different software, running some services on the local network and even hosting a public website on it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;good-enough-is-not-good-enough&#34;&gt;Good enough is not good enough&lt;/h2&gt;&#xA;&lt;p&gt;However as someone interested in infrastructure a few things were bothering me.&#xA;Sure, I was using docker-compose with traefik for my public website and services.&#xA;Yes, I was using ansible to manage the configuration of most virtual machines.&#xA;But &amp;ldquo;good enough&amp;rdquo; and &amp;ldquo;I guess it works&amp;rdquo; doesn&amp;rsquo;t cut it.&#xA;On the upside, I really liked having ZFS snapshots on a 2x2TB mirror.&#xA;The ability to go back to a point in time where things were not broken had saved me a couple times when I inevitably broke one thing or deleted a file that could be replaced but would take a while.&#xA;My backups were also on that ZFS mirror, on a different dataset of course, and that also very useful.&#xA;I knew I wanted ZFS and that there was much room for improvement in regards to handling how I was running services. The single docker-compose virtual machine for the public stuff and another one for local stuff were mostly adequate but the manual management was not.&#xA;Not to mention that and all my precious stuff was on one box which is well below ideal.&lt;/p&gt;&#xA;&lt;h2 id=&#34;taking-the-step&#34;&gt;Taking the step&lt;/h2&gt;&#xA;&lt;p&gt;One day I decided it was time to move up in the world.&#xA;Despite using docker and docker-compose for years I had never dived into kubernetes because it seemed difficult and complex.&#xA;New syntax, new system with its own architecture and internal structure, new workflow, new everything.&#xA;I decided to set up 3 VMs and played with default k8s as well as k3s on them.&#xA;Dipping my toes into it was pretty fun and since nothing depended on it I was free to wipe it and start over.&#xA;The same issue kept cropping up, having to manually install debian thrice and set up kubernetes just to delete all of it and redo it was again, less than ideal&#xA;Initially I started writing a playbook before finding out that someone smarter had already gone down this path.&#xA;Setting up &lt;a href=&#34;https://github.com/k3s-io/k3s-ansible&#34;&gt;k3s-ansible&lt;/a&gt; was easy so there was at least kubernetes setup automation but the whole thing was too thrown together there was no shared storage.&#xA;However, I was becoming more familiar with kubernetes and learning the concepts as well as how to write yaml manifests.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;At some point it became too bothersome, a lot of manual work was involved and basic stuff like copying over ssh keys was also done mostly manually so I had to move on.&#xA;While all of this was going on, I had started planning what hardware updates I would get which you can read about here: &lt;a href=&#34;https://inherently.xyz/blog/hardware-updates-2020/&#34;&gt;Hardware Updates 2020&lt;/a&gt;&lt;/p&gt;&#xA;</description>
			</item>
			<item>
				<title>Hardware Updates 2020</title>
				<link>https://inherently.xyz/blog/hardware-updates-2020/</link>
				<pubDate>Fri, 15 Jan 2021 21:10:38 +0200</pubDate>
				<guid>https://inherently.xyz/blog/hardware-updates-2020/</guid>
				<description>&lt;h2 id=&#34;getting-a-real-storage-server&#34;&gt;Getting a real storage server&lt;/h2&gt;&#xA;&lt;p&gt;During 2020 I got a few upgrades to my setup but I don’t remember the exact order of them.&#xA;The most exciting was a 4U rackmount case that I could use to put up to 6×3.5″ hard drives by default and up to 9 with a 2×5.25″ to 3×3.5″ hotswap bay.&#xA;Also I bought 3x4TB ironwolf hard drives to put in it initially because my 2x2TB mirror was regularly reaching 95% capacity meaning I had to prune the snapshots regularly and couldn’t use it to store more files on it.&#xA;This made me warm and fuzzy inside but the old mirror had to sit on the bench for this transition.&#xA;The power supply in my server had only 4 sata connections which would be enough for a boot SSD and one of the arrays but not everything at once.&#xA;Initially that wasn’t a problem, installed truenas core on the ssd, set up the 3 4TB hard drives in a raidz1 configuration and started creating datasets and shares.&lt;/p&gt;&#xA;&lt;h2 id=&#34;adding-some-extra-spice&#34;&gt;Adding some extra spice&lt;/h2&gt;&#xA;&lt;p&gt;After a while I wanted to access the data on the old miror which meant having to buy a new power supply so I got one.&#xA;Namely the Corsair CV550 which has 7 sata power connectors, more than enough to power the five hard drives and the one SSD.&#xA;Moving on to issue number two, data connections of which the motherboard only had 4 of.&#xA;Admittedly 50 euros for an extra 4 sata ports seemed excessive but I saved up and acquired a nice and simple pcie card that did the job, no raid controller of course.&#xA;Alright, we’re cooking with gas now, storage is taken care of.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dealing-with-separation-of-concerns&#34;&gt;Dealing with separation of concerns&lt;/h2&gt;&#xA;&lt;p&gt;However, I used to have a multi-purpose server and now it is just a NAS so I can’t run all my services anymore.&#xA;Fear not because the trusty old and used Dell Optiplex came to the rescue.&#xA;A shop near my house had one with an i5 2400 and 4gb of ram as well as a 250gb hard drive with windows on it for just 130 euros so I jumped on it.&#xA;First things first, I can&amp;rsquo;t be using a mechanical hard drive for the operating system and proxmox doesn&amp;rsquo;t dual boot so the HDD has to be replaced.&#xA;Luckily the 240gb SSD from when I originally built my desktop is still alive and it&amp;rsquo;ll do more than fine for this purpose.&#xA;The hard drive will be put aside for now but rest assured I do plan to use it at some point.&lt;/p&gt;&#xA;&lt;h2 id=&#34;serially-accessing-memories-about-ram-upgrades&#34;&gt;Serially accessing memories about ram upgrades&lt;/h2&gt;&#xA;&lt;p&gt;More importantly, I got a handle on the ram situation of my NAS.&#xA;Upgraded that beast from 12 to 16 gigabytes of ram which left the 4gb stick as a spare.&#xA;Not being one to miss out on some extra ram, the spare got added to the optiplex.&#xA;Going from 4 to 8 is nice but I want to run more than 2 virtual machines.&#xA;With that in mind and a deal available, I added an 8gb to the optiplex.&#xA;So we&amp;rsquo;re up to 16(8+8) gigabytes for the NAS and 16(2+2+4+8) gigabytes for the server..&#xA;An odd configuration but ram is ram and you bet I’ll use it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Perfect, we had storage and now we have compute as well.&#xA;How was this hardware used though? Check back later (or read the next post if it&amp;rsquo;s up) to find out.&lt;/p&gt;&#xA;</description>
			</item>
	</channel>
</rss>
