Alloy clustering doubts

Hi!

I have installed Alloy in a kubernetes cluster via Helm Chart.

I have read this and this articles about clustering, but i still don’t fully understand the feature.

  1. If I have set on the Helm chart values controller.type = statefulset, what’s the difference between setting alloy.clustering.enabled = true or just having more replicas (controller.replicas = N). Does clustering make sense with statefulset or deployment?

  2. If I have set on the Helm chart values controller.type = daemonset, so i have only one pod in all nodes, and each alloy pod scrape its own node, what is the difference if we set alloy.clustering.enabled = true?

Thanks!

  1. I don’t think it really matters. When running clustering mode you just want to make sure all Alloy agents can talk to each other. But I would run Alloy in daemon mode if i were thinking about collecting logs as well. You only need it to be stateful if you need to keep state of alloy agent (such as log scraping position file), but then it might be easier to just run in daemon and use a host mount instead.
  2. clustering mode is only useful for external scraping targets. Say you need to scrape from 100 external endpoints (not part of your kubernetes cluster) then it’s useful to have a cluster for load distribution. See here for list of components that support / use cluster mode: Clustering | Grafana Alloy documentation
1 Like

Thanks for your explanations @tonyswumac!

For now i am only configuring Alloy as a receiver for OpenTelemetry traces, and sending them to Tempo. Which controller.type ( statefulset, deployment) would you recommend? I guess daemonset makes no sense in this scenario.

If you are just sending traces deployment type would be sufficient.

1 Like