Max Rosin

Last week during our weekly #everyonecancontribute call we started to build a k3s cluster on Hetzner Cloud. Based on my existing personal k3s cluster I gave an introduction to Terraform, Ansible and the related hcloud libraries, like the hcloud Terraform provider and the hcloud Ansible collection . In the next part we will actually start to use Ansible to deploy k3s on our virtual machines and deploy our first containers in the cluster. If you want to try it yourself you can find the current state of our experiments at GitLab . youtube: https://www.youtube.com/watch?v=LvFvQmqce5o

Max Rosin

The " PEP 8 - Style Guide for Python Code " defines the following order for Python imports: Imports should be grouped in the following order: Standard library imports. Related third party imports. Local application/library specific imports. You should put a blank line between each group of imports. Taking care of that manually is just tedious work! This is something the editor or IDE should take care of instead. VS Code has a feature called Organize Imports to do exactly that, but unfortunately by default we have to run it manually. Instead, it would be much nicer if it was triggered each time we save a file. We can achieve that by adding the following to VS Codes settings.json : And just…

Max Rosin

A while ago Michael invited me to join the weekly #everyonecancontribute coffee chats . It took me a while until I actually managed to join, but yesterday I attended the call for the second time and was promptly surprised when the agenda turned out to be a hands-on demo of an earlier blogpost of mine: Autoscaling GitLab Runners on Hetzner Cloud . Thanks to Niclas for the demo, it was quite nice seeing someone else implementing something based on the words I wrote. 🙂 youtube: https://www.youtube.com/watch?v=isKaBJ4VT24

Max Rosin

For static pages like this blog I like to use Caddy as a webserver. It is (mostly) easy to configure, small, fast and easy to put into a Docker container. Recently I wanted to serve a custom 404 page and assumed it would be straight forward with Caddy. At least for me it was not. handle_errors with rewrite The documentation contains a few examples how to deal with errors, which all come down to something like this: It is also possible to limit this to 404 errors , but for the sake of simplicty we will just rewrite all possible errors to /404.html for now. This has two major downsides: It redirects the user, e.g. from https://example.com/non-existing-path to https://example.com/40…

Max Rosin

Most software projects use other projects/libraries as dependencies. And if we describe infrastructure as code we also depend on other things, e.g. specific versions of Terraform modules or Docker images. The best practice is to always specify dependencies as precise as possible to make the outcome of the build or deployment reproducible. When a codebase has many dependencies it can become a tedious task to keep track of all new releases of all dependencies and to keep the dependency definitions up to date (and tested). Wouldn't it be nice to automate this? Dependabot 🤖 Users of GitHub probably know Dependabot. It is a bot that monitors GitHub repositories and creates pull requests if it…