Not today...

comments

OS

Shared Mount

I have Kubernetes at home. I use it for my own infrastructure and my own server. I will maybe start a series of post about it in the future. However, today I will speak about a really specific issue I ran into. For my Kubernetes cluster I needed to deploy a monitoring stack. I am using the now standard prometheus + grafana (and some others services) to handle this. To monitor my host machine I am using the node exporter project in a daemon-set and mount the entire host system in it so it can be monitored. Read More...

Tagged kubernetes , alpine

comments

Snippet

Bash base64 padding

Disclaimer: I am not 100% percent sure of my formula. It works every time I use it but I may have misunderstood some concepts. Take this article with a grain of salt. It happens that sometimes I have to process some base64 encoded strings which are not padded correctly (here is the wikipedia explanation of base64 padding). When using the base64 -d command I end up getting the following error: base64: invalid input and a non zero exit code. Read More...

Tagged bash

comments

Snippet

Install custom certificate with mkcert

Following my previous post about generating a custom root certificate and a PKI. I will share today a small snippet to install your self made certificate on your laptop (or fleet) to be used by the system or the browsers. It works on OSX, Linux and Windows by using a nice hidden feature of mkcert. Following the documentation, we can see that we can install a certificate from a custom location. Read More...

Tagged bash , admin

comments

Snippet

Terraform PKI

Once upon a time, I tried to setup an infrastructure using Terraform and Docker. Spoiler alert: I reevaluated my setup to go for a Kubernetes approach which is easier and more robust. However, this experiment gave me the opportunity to better understand a really important part of a self hosted infrastructure: how to set up a PKI. Disclaimer: I may not use the proper terms or be sloppy on some concepts. Read More...

Tagged terraform

comments

Snippet

Viper Multi Config

This post will explain how to overload configurations in Golang using viper and cobra libraries. The use case may be a niche one, but I find this to be an easy to understand and pretty clear way to do configuration merge. The problem and the expectation I am deploying most of my application on Kubernetes nowadays (I also moved my personal infrastructure to it a few weeks ago). This solution come with a big tooling ecosystem and a really opiniated way to deploy. Read More...

Tagged golang , dev , cli

comments

Snippet

KVM with Docker bridge

This post will explain how to use the docker bridge as a KVM bridge. In this post I will use the Qemu command line to manage my VMs. There is a lot of ways to connect a VM to the internet. The most common one is via network address translation (NAT). This method has a few down side, the main one being that you need to explicitely configure port forwarding for your VM services to be reachable from the host. Read More...

Tagged admin , cli

comments

Tuto

Kvm Hello World

Let’s start a small serie of post on KVM. It is a tool I sometime need to use when Docker is too simple for the problem at hand, or if I really need virtualization (to emulate another arch or a totally different system). I will start by giving a series of snippets to quick start your KVM usage. I am doing this because I often struggle to retrieve simple information when I want to come back on this kind of technology. Read More...

Tagged kvm , cli

comments

Snippet

Socat, Telnet and Unix sockets

Once in a while I use telnet, mostly to check if a port is open (the infamous telnet localhost 22) and sometimes to send a random http request. However, telnet has a few caveats which are: not able to read from stdin not able to deal with https not able to handle unix sockets Those limitations are pushing me towards the use of the socat utility. Here I will show a few situations in which I am now using socat. Read More...

Tagged cli , admin , bash

comments

Snippet

Terraform retrieve sensible data

Another post on Terraform. Here to share a little snippet to retrieve some data from your Terraform state. When you are dealing with some Terraform resources or writing modules you may encounter the sensitive keyword/value (here is a bit of doc). This is handy to avoid leaking some data, but from time to time you may want to extract one of those. Code For this article let’s imagine I am creating an aws_iam_user for another team to access some specific resources. Read More...

Tagged cli , terraform

comments

Tuto

Debug Terraform

How to easily debug Terraform? This was one of my biggest problem when dealing with the tool. I followed instructions to use some output ressources or browse the “debug” logs. Disclaimer: none of it was working properly. So here is what I am actually doing and I am perfectly happy with. Oh! And just before starting to enable debug logs you have to pass the environment variable TF_LOG=debug (because there is no man page and it is not written in the --help content). Read More...

Tagged cli , terraform