Menu
Open source
Configure clustering
You can configure Alloy to run with clustering so that individual Alloy instances can work together for workload distribution and high availability.
To configure clustering, complete these two steps:
- Enable clustering in Alloy: Configure Alloy itself to join a cluster using Helm chart settings or command-line flags.
- Enable clustering in components: Add a
clusteringblock to each component that should participate in workload distribution.
Note
Cluster mode at the Alloy level doesn’t automatically distribute workload. You must also enable clustering in each component that should participate in the cluster. Only components with a configured
clusteringblock distribute workload.
Enable clustering in components
Several components support workload distribution through clustering, including prometheus.scrape, loki.source.kubernetes, and pyroscope.scrape.
Refer to Distribute workload across cluster nodes for the complete list.
To enable clustering in a component, add a clustering block with enabled = true:
prometheus.scrape "example" {
targets = discovery.kubernetes.pods.targets
forward_to = [prometheus.remote_write.default.receiver]
clustering {
enabled = true
}
}Next steps
- Configure Alloy for clustering: Enable clustering in your Alloy installation.
- Distribute workload across cluster nodes: Configure components to distribute workload.


