Skip to content

krissemmy/monitoring-architecture-with-kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Monitoring Setup (Alloy + Loki + Mimir + Grafana )

This repo shows how I’d deploy a monitoring stack on Kubernetes using Helm and simple YAML manifests.

Two ways to deploy:

  • single-cluster-setup/ — simple one-cluster install with Helm values in this folder.
  • **base/ + overlays/ — Kustomize + Helm for multi-env (e.g., dev/prod/staging).
Screenshot 2025-10-24 at 15 35 21

Alloy UI


Prerequisites

Make sure the following are ready before running the commands:

  • Docker Desktop (Kubernetes cluster enabled)
  • Helm installed (brew install helm on MacOS)
  • kustomize installed(brew install kustomize on MacOS)
  • kubectl configured and pointing to your local cluster

You can check with:

kubectl get nodes
helm version
kustomize --help

Quick Start (using Makefile)

You can use the included Makefile for quick setup.

cd single-cluster-setup/

Create and start everything

make create-namespace
make apply ENV=<ENV_NAME> #e.g ENV=dev

Kustomize build uses Helm charts under the hood, so make apply runs: kustomize build overlays/$ENV --enable-helm --load-restrictor=LoadRestrictionsNone | kubectl apply -f -

Check if all pods are running

make status

Delete everything (clean up)

make delete

Forward Alloy UI port

make pf

Helpful commands

# dev
kustomize build overlays/dev | kubectl apply -f -
kubectl -n monitoring rollout status deploy/alloy
kubectl -n monitoring get pods,svc,endpoints -l app.kubernetes.io/name=alloy -o wide

# port-forward Alloy UI
kubectl -n monitoring port-forward deploy/alloy 12345:12345
# open http://127.0.0.1:12345

# check active config and logs
kubectl -n monitoring exec deploy/alloy -c alloy -- sh -c 'sed -n "1,220p" /etc/alloy/config.alloy'
kubectl -n monitoring logs deploy/alloy -c alloy --tail=200

What’s deployed

  1. Alloy as a Deployment (1 replica) with:
    • Kubernetes discovery (pods/endpoints/…)
    • Metrics scrape for annotated targets
    • prometheus.relabel to add cluster, environment, region
    • prometheus.remote_write → Mimir
    • loki.source.kubernetes via K8s API → Loki
    • HTTP UI on :12345

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published