<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Continuous Deployment on inherent site</title>
		<link>https://inherently.xyz/tags/continuous-deployment/</link>
		<description>Recent content in Continuous Deployment on inherent site</description>
		<generator>Hugo</generator>
		<language>en-us</language>
			<lastBuildDate>Wed, 25 Aug 2021 00:44:34 +0300</lastBuildDate>
			<atom:link href="https://inherently.xyz/tags/continuous-deployment/index.xml" rel="self" type="application/rss+xml" />
			<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>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>
	</channel>
</rss>
