<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Zfs on inherent site</title>
		<link>https://inherently.xyz/tags/zfs/</link>
		<description>Recent content in Zfs on inherent site</description>
		<generator>Hugo</generator>
		<language>en-us</language>
			<lastBuildDate>Wed, 10 Mar 2021 00:54:04 +0200</lastBuildDate>
			<atom:link href="https://inherently.xyz/tags/zfs/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Reinstalling Gentoo</title>
				<link>https://inherently.xyz/blog/reinstalling-gentoo/</link>
				<pubDate>Wed, 10 Mar 2021 00:54:04 +0200</pubDate>
				<guid>https://inherently.xyz/blog/reinstalling-gentoo/</guid>
				<description>&lt;h2 id=&#34;why&#34;&gt;Why&lt;/h2&gt;&#xA;&lt;p&gt;This gentoo install has lasted a good long couple of years.&#xA;There is nothing really wrong with it, the SSD it&amp;rsquo;s installed on is a bit full and it&amp;rsquo;s a good opportunity to make a change.&#xA;However I&amp;rsquo;m looking to shake things up a bit.&#xA;The big change is installing on ZFS this time.&#xA;It&amp;rsquo;s fairly well-known that I&amp;rsquo;m a big fan of ZFS, my storage server has been using it in one form or another sinc forever and all of my home infrastructure directly or indirectly depends on it.&#xA;However it is not the only change being made, executing the install using ansible will be a good improvement too.&#xA;One of the issues with gentoo, to people that have been using it for a while, is the seeming non-repeatability of the install.&#xA;A script can get really close however certain steps are not as easy to get right and everything is highly procedural instead of declarative or idempotent way.&#xA;The other changes will include moving to a system with as few, as I view them, harmful or unnecessary componenets.&#xA;Stuff like dbus, eudev, elogind, pulseaudio, systray and a few other things that I&amp;rsquo;m in the process of nailing down will be (hopefully) gone.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how&#34;&gt;How&lt;/h2&gt;&#xA;&lt;h3 id=&#34;ansible&#34;&gt;Ansible&lt;/h3&gt;&#xA;&lt;p&gt;First off, the ansible playbook. There are a few different ones floating around but are outdated or don&amp;rsquo;t fit my needs.&#xA;Of course that doesn&amp;rsquo;t mean I can&amp;rsquo;t examine the pre-existing solutions, I will absolutely take inspiration from solutions that smarter people have come up with.&lt;/p&gt;&#xA;&lt;h3 id=&#34;zfs&#34;&gt;ZFS&lt;/h3&gt;&#xA;&lt;p&gt;The most important decision will be the layout.&#xA;I know I&amp;rsquo;ll be using docker and libvirt so adjustments to /var/lib are needed.&#xA;Also, the system needs to be bootable and usable to some extent even if the ZFS kernel module doesn&amp;rsquo;t get loaded.&#xA;There are 2 different solutions to this, either go with EXT4/XFS or just build ZFS into the kernel.&#xA;I&amp;rsquo;m still undecided about the route I&amp;rsquo;ll go with but remain open to experimenting and seeing which one is better.&lt;/p&gt;&#xA;&lt;h3 id=&#34;cruft-removal&#34;&gt;Cruft removal&lt;/h3&gt;&#xA;&lt;p&gt;Several components are impacted here.&#xA;The most interesting one I&amp;rsquo;m looking forward to installing is &lt;a href=&#34;https://github.com/illiliti/libudev-zero&#34;&gt;libudev-zero&lt;/a&gt; to seemingly satisfy any dependencies that require (e)udev while in reality using busybox mdev.&#xA;This gets rid of some dependency problems with libinput/evdev and anything else that has a hard dependency on a single device manager implementation without source code patches to those projects.&#xA;It also give me the ability to use input classes in xorg instead of hardcoding device paths which is something that was somewhat annoying last time I tried switching away from eudev.&#xA;As for the rest, I&amp;rsquo;m testing out what can be effortlessly removed and what requires significant changes to one thing or another on my laptop.&#xA;We&amp;rsquo;ll see what I end up with, I&amp;rsquo;ll update this post after it&amp;rsquo;s up and running.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve enjoyed my gentoo system for multiple years at this point but I want to make things better so I&amp;rsquo;ll be reinstalling and starting from a clean slate.&#xA;Switching the filesystem to the one my storage server relies on will be pretty sweet (I might also look into some pre or post package install hooks).&#xA;The installation process, and hopefully the full system setup, will be described using ansible to make it more easily repeatable&#xA;And finally, any piece of software I don&amp;rsquo;t like or use will be removed or replaced and incompatibilites fixed along the way.&#xA;I look forward to a better gentoo system in 2021.&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>
	</channel>
</rss>
