Things I learned about Kubernetes version upgrades

Back what I was setting up my home Kubernetes cluster the latest Kubernetes version was 1.18.6.

A lot of minor and major versions were released since then and now the latest version is 1.21.0. I didn't go all the way to 1.21.0 but I've recently performed upgrade to latest stable version in 1.20 branch.

Kubernetes has somewhat decent upgrade instructions. But they are far from comprehensive and I've learned a few thing things even upgrading my small home cluster with a very small number of apps. I can understand now why Kubernetes admins fear upgrades.

Read more…

Setting up single-node Ceph cluster for Kubernetes

After setting up my shiny single-node Kubernetes "cluster" I wanted to do something useful with it. Many of the useful things require your useful data not to disappear, so I needed to figure out how to do that.

In Kubernetes storage is organized via Volumes. These Volumes can be attached to Pods via Volume Claims. There are two types of Volumes: regular ones and Persistent Volumes. Regular Volumes are ephemeral and destroyed together with Pods (e.g. when it crashes or rescheduled). These are of course less interesting than Persistent Volumes which as the name suggest survive Pod restarts.

There are many ways to implement Persistent Volumes, the simplest is probably to use Local Persistent Volumes. They simply bind local directory into pod. However they force pods to be always running on the same node.

This was not interesting enough for me so I went with something more complicated.

Read more…

Building new PC

As Ireland went into second lockdown of 2020, I've decided to upgrade my home personal computer.

I use my PC for gaming, hacking around with Linux and general wasting time in the Internet.

Previously I used PC with Intel i5-3550. After an SSD, GPU and memory upgrades it was still a very capable machine. It is actually still in use today to play some less demanding games co-op with my spouse. However I was not 100% happy with how some CPU-heavy games behaved (city/transport simulators), and compile times were getting annoyingly long while hacking. Another thing I was not happy about is fan management - the old PC had proprietary Lenovo motherboard which would spin case and CPU fans too much.

Desires

Given above I wanted:

  • Quietness. Ideally I wanted it to be semi-passive so that all fans will stop completely under light load.
  • Good single-core performance for games which don't do multi-threading too well.
  • 8 or more cores for compiling stuff (also, it's fun to have many bars in htop).

Read more…

Backups part 2: using restic to back up files to Backblaze

This post is a follow-up to a post where I talk about backups strategy.

Here I describe my solution for file backups from my Linux computers, and don't yet go into the subject of other devices and online services.

After some experimentation I decided to use restic for this. Restic is a modern, open-source backup program with an active community. It is written in Go. It runs on Linux (but also BSD, Mac and Windows) and can back up to local disks as well as remote/cloud services.

And as I wanted my backups to be cheap, "pay as you go" and off-site I've opted to use Backblaze for storage.

Why restic?

Read more…

Backups part 1: Strategy

There are two kinds of people in this world: people who back up their files and people who will back up their files.

If you don't do backups, check the world backup day website. It lists a number of reasons of why backups are important and provides some advice on how to start backing your files up.

However, their advice is rather simplistic. After following it and setting up /some/ backup, one may end up with no usable backups still and false sense of security. Or, people who are more paranoid (or experienced?), may still have some anxiety. There are still many open questions. Do I backup the right files? Did I forget anything? Will these backups protect me from all data loss situations? Do they cost me too much?

Read more…

Donating with Liberapay

Donating with Liberapay

Recently I've stumbled upon Liberapay.

Liberapay is a non-profit crowdfunding platform. It does not charge any fees for donations. Instead it relies on donations itself: Liberapay has an account on Liberapay, and you can donate to it the same way you would donate to any other user. Another big upside is that it appears to be entirely open-source.

The biggest downside is that it does not appear to be very popular, and UX is somewhat questionable. So there isn't a lot of projects and people to donate to.

Still, I found a few things and set up a few tiny recurring donations.

Then I thought it would be interesting to get some. Mostly as a social experiment - I would be surprised to get a single cent.

Receiving donations from Liberapay

The setup was fairly straightforward. Any registered user can add Stripe or PayPal account. I was not registered in either, so I opted to sign up for Stripe which took around 10 minutes.

Then in order to attract people I've installed a couple of buttons on this website. It required a small modification of templates. The buttons use JavaScript but appear to have a fallback, and don't appear to set or collect any cookies.

It is also quite easy to add "Donate" button to GitHub. Once simply needs to place .github/FUNDING.yml file to their default branch. For me it looked like this:

liberapay: rvs

There are more docs and examples on GitHub.

Click my button, give me some money. I don't intend to profit on it, and would try to match anything given to me, though quite likely not through Liberapay unless it suddenly becomes more popular.

I found following interesting (to me) projects there:

  • Liberapay itself
  • Syncthing - Open-Source p2p file synchronization tool. I did not set up donation in Liberapay since I already donate through other channels.
  • LVFS - collaborative initiative to install firmware in Linux

Setting up single-node Kubernetes cluster

Kubernetes log As almost any engineer I have a small "server" at home. This server is nothing more than an old laptop running CentOS and a few docker containers in it. At some point I got tired of restarting and updating them manually. And of course instead of writing a few systemd unit files I've decided to over-engineer it and run Kubernetes on it.

This was a nice way to keep myself busy for a few evenings and get some relevant experience.

Choices

After small amount of reading it was quite obvious there is no single way to set up Kubernetes. There are many ways to set Kubernetes up and it's easy to get lost. Thus before doing everything else, let's outline what is it that I wanted:

  • Working Kubernetes "cluster" that fits on one machine with dual-code CPU and 4 GiB of RAM.
  • It must be possible to run it on more than one machine in the future.
  • It must be close to what I'd run in production - I want to get relevant experience. So no Minikube or similar things.

Read more…

Monit: lightweight monitoring solution

Monit is a simple, lightweight, but useful and powerful enough monitoring solution for your servers.

Monit can monitor:

  • OS processes (presence, resources)
  • files, directories and file system for changes (mtime, size and checksum changes)
  • network hosts (ping, TCP connections)

Monit can notify administrator via configurable e-mail messages. It also can automatically restart failed service.

Monit has an embedded web-server which allows to view state on monitoring objects and disable or enable them.

Read more…