NixOS Declarative Approach for Operating System Management

Arch Linux is my favourite distribution for long time. I can get the benefit of bleeding-edge and highly configurable system, yet still manageable with its lovely package management like pacman, AUR and additionally brew. I also use ansible / chef to manage the workstations / VMs for the sake of immutability. But, managing the playbooks takes time even for doing simple things. In distrowatch, there are page hit ranks and I already familiar with most of them in the list and I found NixOS there, which I haven’t used. I interested with the declarative configuration approach that NixOS offer to manage the system. Go straight to the documentation rightaway, and try it in VM. Aaaand.. I got overwhelmed at first with the nix language. 30 minutes learning the configurations, finally I can make the configuration usable and enjoying it more than Arch! The offered approach allows us to manage the workstations from zero just by utilizing the nix configurations, so we technically having an immutable system! ...

December 19, 2024 · 4 min · 829 words · Me

Bulding Docker Image with Cloud Builder

Docker BuildKit has been there since couple years back and its become default builder to replace the legacy builder since Docker Desktop 23.0. I really like this BuildKit since its offers some helpful features. The one that I mostly feel help was the build cache which can possibly save some build time and also the data used to download the dependencies of your image. Recently, I just got to know about Docker Build Cloud which allows us to build our image with cloud builder. I got to know when I try to built some images and it takes long time to complete and decided to read the docs and found out there is Docker Build Cloud section. Docker Build Cloud is part of the buildx and available for personal use with usage up to 50 build minutes every month. With this, your build will be offloaded to the cloud instance as well as the cache, so no need to worry when your Internet is problematic or your machine is not strong enough to build the image. ...

September 23, 2024 · 3 min · 567 words · Me

Ressurection of My Homelab

1.5 years living in Singapore makes me put down my homelab. Despite I already made the environment accessible as possible, apparently its still has lot of issues due to Indonesia ISP unstability and also electricity issues. Since now I currently in Indonesia, I was decided to wake them up again! The Born of the Undead I put my homelab in my working room, and since my house was empty and no one take care of it, then yaaa! Its fully covered by dusts. Unfortunately, several devices completely dead. I tried to turn on everything, zonk! I need to start from scratch again. Since I don’t want to spend too much time building it at once, I started to pick up one of the machine that I often used for hypervisor. My DeskMini X300 is still solid AsRock! I was using plain LibVirt in the past and manage everyting using terraform-libvirt which allows me to manage everything through pipeline. But, this time I try to do differently. ...

September 20, 2024 · 5 min · 885 words · Me

Cache Terraform Provider Plugins

Overview Terraform required provider plugin to be able to work and communicate with the cloud providers. But, do you know that by default it will download and cache it in the current directory of the Terraform configs? This behaviour will be painful to your Internet quota since it will download same binary in every Terraform config directories. This post will give you information on how to set the plugin cache directory. So, if the provider version already downloaded, we can just pick it from the cache directory instead of redownload everytime. ...

February 27, 2024 · 2 min · 272 words · Me

Bootstrapping ArgoCD With Terraform

Overview Kubernetes has lot of flexibility and features. But, in order to make use of it to the full potential, it requires us to install some essentials tools in it. One of the example of the most used tools in industry right now is ArgoCD. ArgoCD allows us to manage the applications inside the Kubernetes cluster. This post written to help you on how to bootstrapping the Kubernetes cluster. What is Bootstrapping? Bootstrapping is to make your system ready by ensuring it loads your essential components In Kubernetes, we have options to bootstrap the cluster with several examples: Having ingress controller, prometheus operator, and telemetry collector Having applications management / delivery tools installed like ArgoCD or FluxCD In this case we want to bootstrap ArgoCD to the cluster, so that for all the remaining components can be managed using Application or ApplicationSet in ArgoCD Why Bootstrapping? Bootstrapping will only contains the minimum essentials tools get installed This will make the cluster management less painful We can manage the essentials tools altogether with cluster provisioning definition We can separate the other essentials tools management into different layer (for ArgoCD, using Application or ApplicationSet) How to Bootstrapping Kubernetes Cluster? Terraform widely known tools to provisioning Kubernetes cluster It has Helm provider support Helm chart is versioned and more easier than dealing with plain manifests (especially if we have it already in artifacthub, haha) We can leverage Terraform and Helm to bootstrap the cluster So we can manage the cluster provisioning (using whatever your cloud platform is), and manage the essentials components (in this case ArgoCD) See below Terraform snippet to bootstrapping the ArgoCD with the cluster. The snippet assuming that the kubeconfig is there locally. So if you want to have it together with your cluster definition, you might need to adjust the kubernetes and helm provider in order to authenticate to the cluster. ...

February 27, 2024 · 4 min · 831 words · Me