-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] Move TargetAllocator CRD to v1alpha1
- Loading branch information
Showing
64 changed files
with
1,146 additions
and
1,017 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package common | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
type ( | ||
// TargetAllocatorAllocationStrategy represent a strategy Target Allocator uses to distribute targets to each collector | ||
// +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 | ||
TargetAllocatorFilterStrategy string | ||
) | ||
|
||
const ( | ||
// TargetAllocatorAllocationStrategyLeastWeighted targets will be distributed to collector with fewer targets currently assigned. | ||
TargetAllocatorAllocationStrategyLeastWeighted TargetAllocatorAllocationStrategy = "least-weighted" | ||
|
||
// 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" | ||
) | ||
|
||
// TargetAllocatorPrometheusCR configures Prometheus CustomResource handling in the Target Allocator. | ||
type TargetAllocatorPrometheusCR struct { | ||
// Enabled indicates whether to use a PrometheusOperator custom resources as targets or not. | ||
// +optional | ||
Enabled bool `json:"enabled,omitempty"` | ||
// Default interval between consecutive scrapes. Intervals set in ServiceMonitors and PodMonitors override it. | ||
//Equivalent to the same setting on the Prometheus CR. | ||
// | ||
// Default: "30s" | ||
// +kubebuilder:default:="30s" | ||
// +kubebuilder:validation:Format:=duration | ||
ScrapeInterval *metav1.Duration `json:"scrapeInterval,omitempty"` | ||
// PodMonitors to be selected for target discovery. | ||
// This is a map of {key,value} pairs. Each {key,value} in the map is going to exactly match a label in a | ||
// PodMonitor's meta labels. The requirements are ANDed. | ||
// +optional | ||
PodMonitorSelector *metav1.LabelSelector `json:"podMonitorSelector,omitempty"` | ||
// ServiceMonitors to be selected for target discovery. | ||
// This is a map of {key,value} pairs. Each {key,value} in the map is going to exactly match a label in a | ||
// ServiceMonitor's meta labels. The requirements are ANDed. | ||
// +optional | ||
ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"` | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.