🏠 Homelab - Episode 1 - Installing k3s on Ubuntu Server and Setting Up My Project
Estimated read time: 1:20
Learn to use AI like a Pro
Get the latest AI workflows to boost your productivity and business performance, delivered weekly by expert consultants. Enjoy step-by-step guides, weekly Q&A sessions, and full access to our AI workflow archive.
Summary
In this video, creator Mischa van den Burg embarks on a home lab project using an old laptop running Ubuntu Server to create a Kubernetes cluster. Mischa shares his journey of setting up k3s, a lightweight Kubernetes distribution, after previously using kubeadm. He documents his process, discusses his use case for querying Strava data with Grafana, and overcomes challenges, providing a behind-the-scenes look at his approach to this technical endeavor.
Highlights
Mischa introduces his new home lab project using an old laptop running Ubuntu Server. 🎉
He discusses reasons for switching from kubeadm to k3s for simpler Kubernetes management. 🔄
The video showcases setting up a Pomodoro Timer for focused work sessions. 🍅
Mischa addresses a permission issue with his kubeconfig file, demonstrating problem-solving. 🤔
Highlighting the ASMR quality of watching systems setup, creating a relaxed viewing experience. 🎧
Key Takeaways
Starting a homelab project can be simple; just reuse old equipment and give it a new life. 💻
Using k3s instead of kubeadm can simplify managing Kubernetes on a small scale. 🚀
Always document your process; it helps with troubleshooting later and sharing knowledge. 📚
Creating a home lab is a continuous learning journey; mistakes happen and that's okay! ✨
Don't forget to secure access and keep control over your local network when experimenting. 🔐
Overview
Mischa van den Burg takes us on a journey into setting up his home lab using an old laptop running Ubuntu Server. He originally started with kubeadm but decided to switch to the lightweight and easier-to-manage k3s, documenting every step for a seamless sharing experience. Mischa's vision is clear: he wants to extract and visualize Strava data with Grafana, adding a practical touch to his home lab setup.
Throughout the video, Mischa candidly shares his process, including the hiccups faced along the way, like issues with firewall settings and access permissions which he resolved by making necessary adjustments. He emphasizes the importance of documentation and maintaining a clean and secure network environment while learning something new each step of the way.
This episode is not just a technical how-to but also serves as an engaging peek into the world of a professional doing real-time problem-solving. Complete with a mixture of silence and candid narration, it offers a calming yet insightful experience, much like a live-stream without the distractions. Mischa ends with a successful Kubernetes cluster setup, ready for further explorations into the world of monitoring with Grafana.
Chapters
00:00 - 00:30: Introduction and project overview The chapter introduces the author's YouTube channel and outlines a new project focusing on setting up a home lab. The author shares that they started this project six months ago but hadn't progressed much. They mention having an old laptop where they have installed Ubuntu server as the first step in their home lab project.
00:30 - 01:00: Strava data use case for Kubernetes The chapter discusses the practical use case of integrating Strava data with Kubernetes using Grafana dashboards. Initially, the speaker set up a Kubernetes cluster with minimal utilization. However, discovering that Strava data can be queried and visualized through Grafana provided a meaningful purpose to employ Kubernetes effectively. This marks a transition from a dormant setup to an actively used configuration, motivated by the ability to gain insights from personal data.
01:00 - 01:30: New format for the video In this chapter titled 'New format for the video', the narrator discusses the constraints of living in a small apartment, limiting them from utilizing popular video elements like fancy lighting or solar panels. They describe their usual content as 'how-to' videos, which involve explaining processes and tasks. However, they are experimenting with a new video format where they will let the camera run without explaining or interacting, resulting possibly in extended periods of silence. This represents a shift from their traditional method of engaging with the audience.
01:30 - 02:00: Pain points and documenting the process The chapter discusses the approach of a professional engineer who records and documents their work process in real-time. The aim is to demonstrate the process as it happens, similar to an ASMR experience, which could provide insight and aid in understanding how engineering tasks are tackled. The engineer emphasizes the learning aspect, taking the viewers along the journey of discovering solutions and methodologies.
02:00 - 02:30: Initial setup and configurations In this chapter, the focus is on the initial setup and configurations necessary for a coding project. The narrator plans to thoroughly document the process and notes that they will be setting up a repository. This repository will house not only all the configuration files but also the documentation of the process. The narrator emphasizes the importance of public access to this documentation, indicating an intent to share knowledge and facilitate collaborative work. They begin the work process, anticipating how much they will be able to accomplish.
02:30 - 03:30: Creating a GitHub repository for the project The chapter discusses the initial steps for creating a GitHub repository for a project. It mentions using a Pomodoro timer to manage time effectively while working on setting up the project repository. Details about the specific steps or tools aren't provided in the transcript.
03:30 - 04:00: Setting up new configurations The chapter discusses setting up new configurations for a system using a laptop running Ubuntu Server 22. The laptop, stored in a closet, is operating with a static IP address. The 'Etc host' file is configured to recognize a control plane, identified by a specific IP address.
04:00 - 05:00: Plan for installation of k3s on Ubuntu Server In this chapter, the focus is on planning the installation of k3s on an Ubuntu server. The narrator describes encountering multiple IP addresses due to a change in their router and provider. They demonstrate logging into a system via SSH using a root password, humorously inviting others to "hack them". The chapter sets the stage for further technical steps in setting up k3s.
05:00 - 06:00: Cleaning up old installations The chapter discusses setting up a system with an IP address, noting the lack of recent updates and the installation of Cube ADM. The narrator mentions that there was previously a cluster running on the system, but it appears to no longer be active. They indicate a desire to clean up the old installation and possibly start anew.
06:00 - 07:00: Installing and configuring k3s The chapter discusses the advantages of using k3s for Kubernetes distribution, highlighting its lightweight nature and ease of setup and maintenance. It emphasizes that k3s simplifies the addition of more nodes and manages certificate rotation efficiently, making it a preferable choice for lightweight Kubernetes deployments.
07:00 - 09:00: Dealing with configuration issues In this chapter titled 'Dealing with configuration issues', the focus is on addressing configuration challenges in a computing environment. The speaker begins by mentioning their current task, which involves cleaning up existing installations, including 'CU blet' and other components, to prepare for the installation of 'k3s' with the goal of running a cluster. Before proceeding with the installation, the speaker plans to create a repository on their GitHub account.
09:00 - 10:00: Rebooting and troubleshooting access In this chapter, the process of rebooting and troubleshooting access is discussed. It starts with the creation of a repository named 'home lab configuration'. This repository is intended for documenting and configuring the home lab setup. Although the speaker does not currently have a repository for their home lab, they outline their intention to create and use this new repository for better organization and management of their home lab environment.
10:00 - 11:00: Successful access and cluster setup The chapter discusses the initial step in the process of setting up a cluster, which involves cloning a repository from Misha Vandenberg's home lab. The script mentioned is a helpful tool found within the user's personal DOT files, originally inspired by rwx Rob. The action takes place in the user's repository directory, marking the commencement of setting up a successful access and cluster environment.
11:00 - 12:00: Documenting the new setup The chapter discusses the scenario of setting up a new environment for work, emphasizing the difficulty of multitasking. The narrator mentions enjoying the sunlight but finds it distracting when focusing, likening the focus mode to being in a cave. There's a contemplation about live streaming the process, but the narrator admits to struggling with multitasking, such as monitoring chat interactions, making it a challenging task.
12:00 - 13:00: Local access and future plans The chapter discusses local access and future plans within the context of a live stream that is recorded. The speaker mentions their repository and introduces the task of adding a readme file.
13:00 - 14:00: Conclusion and next steps The chapter briefly concludes the previous discussions and transitions into considering what needs to be done next. However, the details of the conversation are not included in the provided text.
🏠 Homelab - Episode 1 - Installing k3s on Ubuntu Server and Setting Up My Project Transcription
00:00 - 00:30 hello good people of YouTube welcome back to my channel um today I'm doing something a little bit different I am going to work on my home lab this is a project that I've been thinking about for a long time I actually did started maybe six months ago but I never really got going with it um I basically have one laptop an old laptop on which I already installed Ubuntu server and I already installed
00:30 - 01:00 cube kubernetes with Cube ADM but I never really started running anything on it and it's it it ran for about 3 months I never really used it so I turn it off but recently I figured out that you can do that you can query your Strava data with grafana dashboards and now I finally have a use case to actually have a a kubernetes cluster running at home I live in a very
01:00 - 01:30 small and easy apartment so I don't have any cool stuff I can do with lights or uh solar panels like all the other cool guys are doing so I had to find my own uh things to do and I finally found it so usually I make like howto videos where I sort of show you things and talk through what I'm doing this time I'm going to do it a little bit differently I'm just going to let the camera run and I might sitting in silence for long
01:30 - 02:00 stretches of time and I'm just going to do what I would do if the camera was off just do my work and kind of record it and document it in that way maybe it is some sort of ASMR for you maybe it can be helpful but it might be useful to see how uh like a professional engineer approaches this and um yeah I'm just also just learning learning along the
02:00 - 02:30 way I'll be Googling and one thing I will be doing is uh documenting everything that I do or almost everything I love taking notes and I'm also going to do that in this video I'm going to set up the repo where I'm going to keep all the config files but also I'm going to keep all the documentation and um make it public as well so yeah I'm just going to start working on it and uh see how long I how far I come
02:30 - 03:00 today so I will do a poo start so when my screen keys move away you'll see that I have a Pomodoro Timer up here up in the corner there and uh I plan to yeah set that one out and um see how far I come so what I have is to start with is
03:00 - 03:30 I have my um laptop that's running in a in a closet over there it's just lying there it's a laptop with its lid folded on which I have running Ubuntu Server 22 and I have given it a static IP address and if I cat my Etc host file you'll see that I have this CP here this is this stands for control plane and this is the IP address address of the of
03:30 - 04:00 of the thing of the laptop here you see a couple of other IP addresses uh which are different that's because I had to I had a different router and I switched providers so now I have a new one uh but now if I just do SSH CP and I enter my super secret um root password you saw it on the screen keys it's water so come hack me bro and now I'm in that laptop so I I already did a
04:00 - 04:30 bit of work here I already set it up with an IP address which is nice and um yeah the thing is that you can see I haven't been I haven't updated for a while but I did install Cube ADM on here so there should be no there isn't well there was a cluster running on here but but I want I
04:30 - 05:00 want to get rid of all of that and I want to just um I want to use k3s uh now it's a very small lightweight thing to do distribution of kubernetes very easy to set up and maintain but also it um it will be easier to when I add more nodes to it and it handles the certificate rotation nicely and yeah it will just be a lot easier so
05:00 - 05:30 that's where I'm um starting today so I'm going to be yeah let's see which uh cuet yeah see I I installed CU blet and all all sorts of things on here I'm going to clean that up and then I'm going to install k3s and see if I can get a cluster running but before I do that I want to um create a repo let's go to my GitHub account here
05:30 - 06:00 and I don't think I have a repo no I don't have a repo with home lab yet so just going to create myself a repository called home lab configuration and documentation of my home lab
06:00 - 06:30 okay then I will clone that clone Misha Vandenberg uh home lab it's a nice little script that I have you can find in my DOT files I stole it from rwx Rob but now I'm in my clone repo it in my repos directory just going to close the curtain here
06:30 - 07:00 as I have the sun shining on my face which is nice but not when I'm in my cave mode so yeah the idea is like I could be live streaming this but I uh I can only do one thing at a time I'm very bad at multitasking so having to monitor a chat for example on the right that would be yeah very difficult for me so considered
07:00 - 07:30 this some sort of live stream but then it's recorded uh okay I have my my repo here and let's start with a uh just add a read me file
07:30 - 08:00 yeah so let's see
08:00 - 08:30 tooling I'll be using k3s for now and my goal is um have a run run Prometheus gra
08:30 - 09:00 stack have um have gra dashboard available at a URL so that will need Ingress I'll need to start thinking about
09:00 - 09:30 Ingress TLS and um local DNS so that's enough to work with already there a bunch of stuff that need to be set up there and G Ops everything should run with should
09:30 - 10:00 be using GI Ops and the thing is that I am I have already experience with Argo CD but I think I would like to uh try out flux try out flux okay that's enough to get going um I did have some notes already uh
10:00 - 10:30 [Music] about um how I set up the control play uh I might share those later I'm not going to do that now uh this is just enough for now let's just um push this initial commit okay so now I have my home lab
10:30 - 11:00 repository and I have a place where I can start documenting and I can start uh configuring my kubernetes cluster okay so I'm on my control plane and I installed kubernetes on here and actually let's let's do go to
11:00 - 11:30 my notes into the [Music] server um yeah I might as well do this now I might as well just talk through it so these are some notes I made on creating my Ubuntu Server instances and because I'm using a laptop I had to do a bit of configuration and and yeah what you know what let's just
11:30 - 12:00 let's just just do this let's just let's see this is now in my home lab Ubuntu Server this is now in my second brain here I here you see I documented how I um installed kubernetes basically following this guide so if I just go through this guide
12:00 - 12:30 I should be able um yeah here this is exactly what I needed because now I know exactly which packages I installed and I can just delete those and um I can use k3s instead so I installed container d
12:30 - 13:00 y kubernetes oh yeah these are the packages Cube admin Cube CTL and cubet okay yeah yeah
13:00 - 13:30 okay okay so this is I this is what I use for installing with QBE ADM M all right so let's see CD
13:30 - 14:00 Projects Home lab I have some stuff in here already um this home lab Ubuntu Server document can go to my repo move home lab to server repos home lab my home lab repo I'll make a dock
14:00 - 14:30 directory and I'll move home lab to server to the dock directory
14:30 - 15:00 y this is the network config that I did [Music] sure okay this can can I can take out
15:00 - 15:30 this and then I'll make a new file ADM MD my first iteration
15:30 - 16:00 of the home lab I use Cube ADM to install my cluster now I'm moving to [Music] k3s however are the steps are used if you are interested
16:00 - 16:30 yeah is there's any information no okay okay do Bo to server
16:30 - 17:00 docs and keep admin okay now that's done now I know exactly what I installed there so
17:00 - 17:30 um now I'm going to add a Alias to my bash RC and as you see I have many aliases for just going to a directory very quickly so
17:30 - 18:00 here I'll do home lab K up mberg home lab okay spr sourcing my bash RC home lab and I'm in my home lab really quick okay
18:00 - 18:30 great then qm okay uh what is it is it app Purge to delete everything app remove
18:30 - 19:00 um the app remove command allows you to
19:00 - 19:30 reuse an application with similar [Music] configuration app remove app Purge we have to get rid of custom configuration files sure I'll just use app Purge so sudo app Purge um Q ADM cuet
19:30 - 20:00 okay Cube CTL C be install I can keep that installed and I also used container d right so what else did I install using this guide container
20:00 - 20:30 D so dep Purge container d
20:30 - 21:00 package container D is not installed so not removed uh should go app list installed con
21:00 - 21:30 D container container d. iudo Purge container and delete that one as well
21:30 - 22:00 okay container D has been purged so that means that we are getting clo getting somewhere um yeah I have purged out of that how is my network configuration looking yeah nice before I had flannel and all sorts of stuff running there and now I don't so that's
22:00 - 22:30 great CD I still have a do Cube directory let's delete that too so now we are getting close to a clean install here okay let's try k3s let's do
22:30 - 23:00 it K 3s lightweight kubernetes um this seems like a little bit too short quick start guide in stall
23:00 - 23:30 script so you run the script service will be configured to automatic restart after no reboots or if the process crashes or is killed that's nice Cube CTL will be installed
23:30 - 24:00 yeah Cube config file single node server installation is a fully functional kuet including yeah it's not necessary to add additional server agent nodes but you may want to do so that's nice okay
24:00 - 24:30 no okay so I can just use this to set up the control plane and then add nodes later so let's see how easy it is I do remember I have done this before I had an oracle VM there you can you can
24:30 - 25:00 get an oracle VM for free and there I had k3s running but yeah this is so nice that you have it running as a system D service oh beautiful okay starting k3s it's already
25:00 - 25:30 started okay Local Host 880 was refused uh do I have the firewall in here let's see to
25:30 - 26:00 UFA show status inactive okay it's not even active um
26:00 - 26:30 okay the here is the cube config file supposedly say the ETC Rancher PS
26:30 - 27:00 okay ah so my maybe my user doesn't have access to this um no connection refused
27:00 - 27:30 boom
27:30 - 28:00 tube okay firewall stopped let's try again
28:00 - 28:30 it's still stopped well what I'm going to do is I'm going to do an apt upgrade
28:30 - 29:00 it needs an upgrade and I'm going to be restarting it because I think maybe the port is already in use by the old kubernetes CL cluster that was running there so I deleted all of that um yeah that's what I'm going to do I should be able
29:00 - 29:30 to
29:30 - 30:00 [Music] let's see cluster access
30:00 - 30:30 no I'll have to check if that Environ environment variable is set even well it's looking at port 8080 and it can't access that so why why is that well let's do the update first then [Music] reboot and see what happens then
30:30 - 31:00 [Music] problem is likely caused by a bad Cube config perhaps you have a f different Comin stall yeah
31:00 - 31:30 yeah you know what let's try that too so I'll do another SSH session Echo Q yeah that environment variable isn't set even so let's try
31:30 - 32:00 that yeah okay now we're getting somewhere CD Etc Venture sudo um what did he say 600 for the permissions
32:00 - 32:30 um
32:30 - 33:00 can I just Cho this Linux multiple file yeah sudo CH roots Misha okay three
33:00 - 33:30 yo yeah
33:30 - 34:00 permission denied okay then I'll go to CDC [Music] Adventure sudo CH own Ria rout
34:00 - 34:30 recurs if visit capital r why am I not allowed to open that
34:30 - 35:00 shs mod 777 K3 y okay permission denied
35:00 - 35:30 what about if I just do it as roots okay getting somewhere new kernel
35:30 - 36:00 available okay good let's reboot
36:00 - 36:30 this wait for it to come up for a little bit
36:30 - 37:00 okay machine is back up again go to minus
37:00 - 37:30 hey now it works okay but now I'm running as root uh yeah go back to my normal user export the cube
37:30 - 38:00 config it still won't work that's strange okay um um so it's not very nice to have it s777
38:00 - 38:30 so I'll just do what this guy said
38:30 - 39:00 okay make Cube directory okay this is the generation for the cube so that is correct
39:00 - 39:30 and of course my environment variable is Echo Cube config should set that to this so export
39:30 - 40:00 okay great we have a cluster running and I can access it nice nice okay so far so good what do I have now I have the control plane the the laptop is running with my control plane I did have to disable the ultimate
40:00 - 40:30 firewall or uncomplicated firewall that's a little bit annoying but now I have the control P running and now here it said something about um okay well let's let's take a few notes here let's take a few notes Docs uh k3s
40:30 - 41:00 ND k3s decided to use k3s for my for installing kubernetes used um Cube ADM before but prefer a or a less complicated approach for
41:00 - 41:30 now even though Cube ADM is a great way to learn and I managed without problems for longterm maintenance it is better to use some to use k3s or micro
41:30 - 42:00 Kates um for maintaining also takes away C complexity now might use Cube ADM later installing
42:00 - 42:30 k3s just use the docs these are the docks struggled a bit with the error local uh what did the error
42:30 - 43:00 Sayed with this problem was a quy Cube config
43:00 - 43:30 configuration also had to disable UF so I'll I have some goals here but I'm also going to be keeping a Todo
43:30 - 44:00 allow uh um um use UFA on all servers it's not much much to
44:00 - 44:30 ask I want to have control over which ports are open and which or not even though it's not a problem because it's only my local network must be nice to do have it in the future and I also decided I'm going to be keeping a change log or a log it's going to be logging what I did
44:30 - 45:00 clean up old Cube installed from control plane set up k3s on control play set up repo and added documentation of earlier
45:00 - 45:30 install Okay add k3s documentation
45:30 - 46:00 okay now last thing I want to do is to make it available to from my local machine so accessing from outside with Cube CDL copy or machine located outside the
46:00 - 46:30 cluster as cube config then replace the value of server with the IP or name of your k3s server ah well that is something that I cannot do on uh on video because my Cube config file does contain uh information of all the Clusters that I uh manage in my day job and I don't
46:30 - 47:00 want to be exposing those certificates on video obviously uh it will be hard but you could theoretically use that to uh get gain access to those clusters so I'll have to uh I'll have to do that offline but that's the next thing that I'm going to do after I stop this video I'm going to make sure that I can just access my cluster from my local Cube CTL commands and uh I'll start cobbling from there so
47:00 - 47:30 yeah hopefully you've uh enjoyed me struggling through this and um but but I did solve it in the end I have a nice kubernetes cluster running on my control plane uh free it is using yeah I'm currently H using one gigabyte
47:30 - 48:00 of memory more or less the thing only has four gigabytes of memory it's it's fantastic and um yeah things are looking good I'm happy with uh where I am right now and I really like that I can just do system CTL status K 3s service and I see everything that's running oh so nice so nice oh I
48:00 - 48:30 of course I have to do the obligatory uh k run uh engine X image is engine X engine X is created okay expose pod x uh Port is 80
48:30 - 49:00 [Music] Okay C yay welcome to engine X so it works I have a pot running engine X and I can curl it by uh exposing it with a service and yeah it works so okay delete pod
49:00 - 49:30 next okay delete service engine X and we're all clean again great well in the next one I am going to set up my uh monitoring in grafana looking forward to that so thank you for watching I hope this was useful to you and uh see you later