Skip to content

Commit

Permalink
Add missing per-node strategy to TA CRD
Browse files Browse the repository at this point in the history
  • Loading branch information
swiatekm committed Apr 16, 2024
1 parent 61daef2 commit 2fdf345
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion apis/v1beta1/allocation_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package v1beta1

type (
// TargetAllocatorAllocationStrategy represent a strategy Target Allocator uses to distribute targets to each collector
// +kubebuilder:validation:Enum=least-weighted;consistent-hashing
// +kubebuilder:validation:Enum=least-weighted;consistent-hashing;per-node
TargetAllocatorAllocationStrategy string
// TargetAllocatorFilterStrategy represent a filtering strategy for targets before they are assigned to collectors
// +kubebuilder:validation:Enum="";relabel-config
Expand All @@ -30,6 +30,9 @@ const (
// TargetAllocatorAllocationStrategyConsistentHashing targets will be consistently added to collectors, which allows a high-availability setup.
TargetAllocatorAllocationStrategyConsistentHashing TargetAllocatorAllocationStrategy = "consistent-hashing"

// TargetAllocatorAllocationStrategyConsistentHashingPerNode targets will be assigned to the collector on the node they reside on (use only with daemon set).
OpenTelemetryTargetAllocatorAllocationStrategyPerNode TargetAllocatorAllocationStrategy = "per-node"

// TargetAllocatorFilterStrategyRelabelConfig targets will be consistently drops targets based on the relabel_config.
TargetAllocatorFilterStrategyRelabelConfig TargetAllocatorFilterStrategy = "relabel-config"
)
Original file line number Diff line number Diff line change
Expand Up @@ -7146,6 +7146,7 @@ spec:
enum:
- least-weighted
- consistent-hashing
- per-node
type: string
enabled:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7132,6 +7132,7 @@ spec:
enum:
- least-weighted
- consistent-hashing
- per-node
type: string
enabled:
type: boolean
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/opentelemetry.io_targetallocators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ spec:
enum:
- least-weighted
- consistent-hashing
- per-node
type: string
args:
additionalProperties:
Expand Down
5 changes: 3 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40457,9 +40457,10 @@ TargetAllocator indicates a value which determines whether to spawn a target all
<td>
AllocationStrategy determines which strategy the target allocator should use for allocation.
The current options are least-weighted, consistent-hashing and per-node. The default is
consistent-hashing.<br/>
consistent-hashing.
WARNING: The per-node strategy currently ignores targets without a Node, like control plane components.<br/>
<br/>
<i>Enum</i>: least-weighted, consistent-hashing<br/>
<i>Enum</i>: least-weighted, consistent-hashing, per-node<br/>
<i>Default</i>: consistent-hashing<br/>
</td>
<td>false</td>
Expand Down

0 comments on commit 2fdf345

Please sign in to comment.