Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apis/v1alpha1/allocation_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ package v1alpha1

type (
// AmazonCloudWatchAgentTargetAllocatorAllocationStrategy represent which strategy to distribute target to each collector
// +kubebuilder:validation:Enum=consistent-hashing
// +kubebuilder:validation:Enum=consistent-hashing;per-node
AmazonCloudWatchAgentTargetAllocatorAllocationStrategy string
)

const (
// AmazonCloudWatchAgentTargetAllocatorAllocationStrategyConsistentHashing targets will be consistently added to collectors, which allows a high-availability setup.
AmazonCloudWatchAgentTargetAllocatorAllocationStrategyConsistentHashing AmazonCloudWatchAgentTargetAllocatorAllocationStrategy = "consistent-hashing"

// AmazonCloudWatchAgentTargetAllocatorAllocationStrategyPerNode targets will be allocated to the collector running on the same node as the target.
// Targets without a resolvable node fall back to the configured fallback strategy (consistent-hashing).
AmazonCloudWatchAgentTargetAllocatorAllocationStrategyPerNode AmazonCloudWatchAgentTargetAllocatorAllocationStrategy = "per-node"
)
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (c *consistentHashingAllocator) handleCollectors(diff diff.Changes[*Collect
}
// Insert the new collectors
for _, i := range diff.Additions() {
c.collectors[i.Name] = NewCollector(i.Name)
c.collectors[i.Name] = NewCollector(i.Name, i.NodeName)
c.consistentHasher.Add(c.collectors[i.Name])
}

Expand Down
Loading
Loading