AJ's Blog

This is a personal blog focused on computer software and hardware. Most projects are implementing software and hardware for a homelab. What is a homelab? I would say a homelab could be a single computer or dozens of computers connected in a network. You can also integrate with computers in the Cloud.

Continue reading...

Recent Posts

Terraform Google Kubernetes Engine

06-18-2022

Terraform is perfect for managing resources in public cloud providers. If you are not familiar with terraform, check out a previous post about terraform in my homelab. I am doing spring cleaning right now, I want to move my public cloud resources from Amazon Web Services to Google Cloud Platform.

GCP allows for your VPC (your private network) to span any region in the world. AWS requires VPC networks to exist in certain geographic areas. The only things I use in the cloud are DNS and web applications, everything else is on my homelab hardware. GCP will be a bit less expensive to run my containers and the networking setup is less complex.

Homelab logging with grafana loki

06-11-2022

updated 2025-04-17: This version of Loki and Promtail is now deprecated.

See a newer post about how to upgrade/install v3 of Grafana Loki as of 2025.

loki_logo
loki_logo

Once there is more than one computer to worry about, having logs in one location to search for errors and troubleshoot applications becomes critical. In a previous post I set up prometheus to collect metrics and grafana to visualize the metrics. Today I am going to look at another tool from grafana called loki. Loki will provide a server to collect logs and we will install an agent on systems to send their logs to the loki server.

Automate and monitor linux backups

06-04-2022

The second most important resources in a homelab other than the lab itself are backups. It is critical not only to take backups but verify that you can restore your backups. I have settled for taking images of the entire host operating system but have run into challenges trying to mount disk images that approach 1 TB or more. I decided to slim down my backups for certain servers. For most servers, I just need config files and persistent data such as databases. Let’s look at a simple script to backup and archive files and then save them to a central data store.

Setting up Network UPS tools

05-29-2022

The primary goal of the Network UPS Tools (NUT) project is to provide support for Power Devices, such as Uninterruptible Power Supplies, Power Distribution Units, Automatic Transfer Switches, Power Supply Units and Solar Controllers. Some of those sound exciting but at this time I only have Uninterruptible Power Supplies.

My environment has 5 UPS devices connected to various servers and networking equipment. They also are not the same model or vendor. Fortunately NUT supports most consumer UPS devices that have a usb port. The goal is to use NUT to create some logic to safely shut down devices when electricity fails for an extended period. UPS devices work well with zero configuration to protect equipment from brief interruptions in power (brownouts). When the power goes out for more than a few minutes, NUT can be used to safely power down systems even if they are not all connected to the UPS via usb. NUT has a server => client configuration using a network port. This allows servers that are not connected to the UPS to respond to power outages.

Terraform for homelab

05-22-2022

Terraform is a tool for orchestrating infrastructure as code with human-readable configuration files. It can be used to create objects in the cloud and in the homelab. Similar to ansible, terraform abstracts various other APIs used to provision virtual machines, containers, or an entire public cloud ecosystem.

terraform
terraform

Terraform has an active community that contributes “providers” that interface with various resources and services. For example I will be switching my entire lab to using terraform. There are existing providers for the platforms that I use: Amazon Web Services, Docker, Kubernetes, github, proxmox, and likely more that I have yet to find.

cadvisor for arm64

05-15-2022

update 2024: the official cadvisor image now supports arm which means it will work on Pis

cadvisor_logo
cadvisor_logo
cadvisor exporter is used by Prometheus to monitor container metrics. If you are not familiar with prometheus, check out a previous post. The cadvisor program will collect metrics and make them available on a http server. Prometheus needs to be configured to collect metrics from the cadvisor exporter and then grafana can be used to visualize those metrics.