Jump to content

[Guide] Arch Linux Kubernetes cluster on Unraid


SpaceAce

Recommended Posts

8/4/2024 update: A new version of the guide has been released. Highlights include switching to containerd, and big jumps in the Arch Linux and Unraid version. See my reply further down for more information.

 

 

Hello, all. I'm only a few days into using Unraid, but I've already given the virtual machine functionality a pretty good thumping. I have written a comprehensive guide to creating a Kubernetes cluster on top of Arch Linux inside Unraid. After I'd gotten it all together and published it to Github, I realized there was probably an official forum for this sort of thing, and it turns out there is, so here I am.

 

The guide is here: https://github.com/SpaceAceMonkey/spaceace-arch-kubernetes-unraid

 

Please let me know if you have any problems following the instructions, or notice anything missing. It probably needs a little cosmetic cleanup, but I am mostly concerned with making sure the content is accurate and easy to follow.

Edited by SpaceAce
Updated guide.
  • Like 2
  • Thanks 3
Link to comment
  • 4 weeks later...

Hey OP, I saw this result when searching for kubernetes on unraid. I was wondering why unraid didn't have maybe a kubernetes plugin or easy way to install it. I didn't have much issue just manually installing kubectl and setting up a simple minikube cluster on my unraid machine. I have a simple need to run an app that is a container image and I plan to use helm to facilitate CI/CD with gitlab. 

 

It looks like you chose to use a VM for kubernetes, but that overhead isn't really needed. I'm new to kubernetes but experienced with docker. So I thought I would follow up on the discussion of k8s on unraid, seems like a good fit. But at the same time the more I learn about it, the more I realize perhaps k8s is superior and the entire ecosystem of docker templates is really just a clone of helm charts.

  • Like 1
Link to comment
  • 2 months later...
  • 3 weeks later...
  • 2 months later...
  • 1 month later...
  • 4 weeks later...

Thanks for sharing this guide! I followed it back in April, finished the guide and made the cluster my own dev environment, integrating Drone CI and Gitea into it. Unfortunately I stopped playing around with it in May when I went on vacation. Finally picking it back up. I have to say, this guide is very good! Thanks for sharing it.

 

One suggestion though, I remember when I worked through it, it would have been very helpful to SSH into the VMs instead of doing it all over VNC. One big hiccup was copying the token/cert that gets generated and used for the worker node. I had to hand type it all in, squinting at VNC hoping I typed each letter correctly. I think I made a few attempts before getting it right. It would have been much easier to select, copy and paste the printed value instead, but VNC in the browser didn't let me.

 

Any suggestions on networking to the kubernetes service? The last thing I think I was looking into was load balancing in my home network, but that didn't seem to be a thing or easily achievable. Best bet I'm thinking was set up nginx and use reverse proxy to forward commands to the cluster.

 

Also, any guidance for updating packages? I'd like to update things, but a little nervous as the nodes need to be the same version and in sync.

 

Lastly, good work! If you do containerd, I'd probably give that a try at some point.

  • Thanks 1
Link to comment
  • 1 year later...
Posted (edited)

Hi, all. I have finally gotten around to updating this guide. I want to thank everyone who reached out to me here or through GitHub to report issues and offer suggestions. This was a long time coming, but that's because I knew it would be a pain in the butt, and it was. I've spent pretty much two entire workdays on this between yesterday and today, but I've finally got something to show for it.

 

https://github.com/SpaceAceMonkey/spaceace-arch-kubernetes-unraid

 

Here is an overview of what changed in this version.

 

- Updated Unraid version from 6.9.2 to 6.12.10.
- Updated Arch ISO from 2022.02.01 to 2024.08.01.
- Removed docker in favor of containerd. [Resolves #3]
- Removed usage of --cni-bin-dir. [Fixes #4]
- Removed timedatectl in favor of manual symlink. [Fixes #5]
- Updated boot partition size from 512M to 1G per latest Arch recommendations.
- Updated sample outputs so they match output from the versions of software used in this guide.
- Updated guide to reflect the fact that current Arch install media comes with reflector installed.
- Added configuration steps to upgrade pause to 3.9 and enable systemd cgroups for containerd.
- Added explicit configuration steps for the worker node where they differ from the control plane node,

  such as when configuring static IP addresses.
- Updated instructions for installing weave to pull from new repository now that Weaveworks has closed shop and their website is defunct. Weavenet may be

  replaced with a different CNI solution in a future version of this guide.
- Clarified that some steps need only be run on either the control plane or the worker node, but not both.
- Removed references to master except in places that are part of Kubernetes output.
- Updated image to match new naming convention.
- Minor formatting changes, such as adding vertical space to clarify where some sections end.
- Added several __Note__ sections to clarify portions of the tutorial or to add context.

Edited by SpaceAce
Link to comment
Posted (edited)
On 11/11/2022 at 3:08 PM, klosboss said:

Thanks for sharing this guide! I followed it back in April, finished the guide and made the cluster my own dev environment, integrating Drone CI and Gitea into it. Unfortunately I stopped playing around with it in May when I went on vacation. Finally picking it back up. I have to say, this guide is very good! Thanks for sharing it.

 

One suggestion though, I remember when I worked through it, it would have been very helpful to SSH into the VMs instead of doing it all over VNC. One big hiccup was copying the token/cert that gets generated and used for the worker node. I had to hand type it all in, squinting at VNC hoping I typed each letter correctly. I think I made a few attempts before getting it right. It would have been much easier to select, copy and paste the printed value instead, but VNC in the browser didn't let me.

 

Any suggestions on networking to the kubernetes service? The last thing I think I was looking into was load balancing in my home network, but that didn't seem to be a thing or easily achievable. Best bet I'm thinking was set up nginx and use reverse proxy to forward commands to the cluster.

 

Also, any guidance for updating packages? I'd like to update things, but a little nervous as the nodes need to be the same version and in sync.

 

Lastly, good work! If you do containerd, I'd probably give that a try at some point.

 

You're welcome. I'm glad you found it useful.

 

In fact, the update that I just pushed to GitHub initially discussed using ssh instead of VNC, but I took that part out! I figured people following the guide would probably have a working knowledge of both Unraid VM networking and ssh, and I didn't want to make the guide any longer than necessary. Now I'm bummed, because I may have made the wrong decision. The guide did, and still does, mention using ssh once you've completed the initial provisioning.

 

I'm not sure what you're trying to achieve in your networking scenario. Do you want Kubernetes to load-balance across your home network, as in everything goes to Kubernetes and then gets distributed to non-Kubernetes services you have elsewhere on your network? I've never tried to do that, but if that's what you're thinking, my first impulse would be to move those non-Kubernetes services into Kubernetes.

 

In my experience, Kubernetes is pretty robust. I have not personally run into any problems when upgrading OS packages, although I wouldn't do it in a mission-critical environment without a great deal of planning. As for updating Kubernetes itself, that's a breeze. I have never had a serious problem when upgrading a Kubernetes installation in-place.

 

Thank you for the compliment, and you may be interested to know that the switch to containerd is one of the main changes in this version of the guide.

Edited by SpaceAce
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...