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.
Grafana Loki was introduced in a previous post. If you do not have grafana and loki, check out that post to get started. Today we will set up a grafana dashboard to explore log files that are collected by Loki. As mentioned in the previous post, logs are sent to grafana loki using an agent called promtail. This agent can securely forward logs over HTTPS so all log messages will be encrypted in transit.
There are a lot of kubernetes components to keep track of. Today I am looking at some tools to make kubernetes easier to manage. In the kubernetes post, I deployed the kubernetes web based dashboard using a built in command for minikube. Let’s look at how to deploy the dashboard into any kubernetes distribution.
Kubernetes dashboard
Requirements
In order to deploy the kubernetes dashboard, you need to have a cluster configured. If you do not, check out the previous post on how to install minikube and gain access to that cluster’s API.
Having a dashboard webpage that links to your web applications makes navigating homelab and cloud services easier. It is certainly possible to create a custom web app or web page but there is a great open-source project called Heimdall that not only serves as a homepage/dashboard but has API integrations to many applications used in a homelab. More web applications are added over time so if an app you use does not have an API integration currently, submit a request to the maintainers.
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.
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
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.
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.