Skip to content

Commit

Permalink
Add missing per-node strategy to TA CRD (#2859)
Browse files Browse the repository at this point in the history
  • Loading branch information
swiatekm authored Apr 16, 2024
1 parent 4d306e9 commit bba5059
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 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"

// TargetAllocatorAllocationStrategyPerNode targets will be assigned to the collector on the node they reside on (use only with daemon set).
TargetAllocatorAllocationStrategyPerNode 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
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40460,7 +40460,7 @@ The current options are least-weighted, consistent-hashing and per-node. The def
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 bba5059

Please sign in to comment.