-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting target allocator via label
- Loading branch information
Showing
14 changed files
with
389 additions
and
6 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
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
40 changes: 40 additions & 0 deletions
40
tests/e2e-targetallocator-cr/targetallocator-label/00-assert.yaml
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,40 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: ta-collector | ||
data: | ||
collector.yaml: | | ||
receivers: | ||
prometheus: | ||
config: | ||
scrape_configs: | ||
- job_name: otel-collector | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: | ||
- 0.0.0.0:8888 | ||
exporters: | ||
debug: {} | ||
service: | ||
telemetry: | ||
metrics: | ||
address: 0.0.0.0:8888 | ||
pipelines: | ||
metrics: | ||
exporters: | ||
- debug | ||
receivers: | ||
- prometheus | ||
--- | ||
apiVersion: v1 | ||
data: | ||
targetallocator.yaml: | | ||
allocation_strategy: consistent-hashing | ||
collector_selector: null | ||
filter_strategy: "" | ||
kind: ConfigMap | ||
metadata: | ||
name: ta-targetallocator |
30 changes: 30 additions & 0 deletions
30
tests/e2e-targetallocator-cr/targetallocator-label/00-install.yaml
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,30 @@ | ||
--- | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: TargetAllocator | ||
metadata: | ||
name: ta | ||
spec: | ||
--- | ||
apiVersion: opentelemetry.io/v1beta1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: ta | ||
spec: | ||
mode: statefulset | ||
config: | ||
receivers: | ||
prometheus: | ||
config: | ||
scrape_configs: | ||
- job_name: 'otel-collector' | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: [ '0.0.0.0:8888' ] | ||
exporters: | ||
debug: {} | ||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [prometheus] | ||
exporters: [debug] | ||
|
26 changes: 26 additions & 0 deletions
26
tests/e2e-targetallocator-cr/targetallocator-label/01-add-ta-label.yaml
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,26 @@ | ||
--- | ||
apiVersion: opentelemetry.io/v1beta1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: ta | ||
labels: | ||
opentelemetry.io/target-allocator: ta | ||
spec: | ||
mode: statefulset | ||
config: | ||
receivers: | ||
prometheus: | ||
config: | ||
scrape_configs: | ||
- job_name: 'otel-collector' | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: [ '0.0.0.0:8888' ] | ||
exporters: | ||
debug: {} | ||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [prometheus] | ||
exporters: [debug] | ||
|
39 changes: 39 additions & 0 deletions
39
tests/e2e-targetallocator-cr/targetallocator-label/01-assert.yaml
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,39 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: ta-collector | ||
data: | ||
collector.yaml: | | ||
exporters: | ||
debug: {} | ||
receivers: | ||
prometheus: | ||
config: {} | ||
target_allocator: | ||
collector_id: ${POD_NAME} | ||
endpoint: http://ta-targetallocator:80 | ||
interval: 30s | ||
service: | ||
pipelines: | ||
metrics: | ||
exporters: | ||
- debug | ||
receivers: | ||
- prometheus | ||
telemetry: | ||
metrics: | ||
address: 0.0.0.0:8888 | ||
--- | ||
apiVersion: v1 | ||
data: | ||
targetallocator.yaml: | ||
( contains(@, join(':', ['app.kubernetes.io/component', ' opentelemetry-collector'])) ): true | ||
( contains(@, join('', ['app.kubernetes.io/instance:', ' ', $namespace, '.ta'])) ): true | ||
( contains(@, join(':', ['app.kubernetes.io/managed-by', ' opentelemetry-operator'])) ): true | ||
( contains(@, join(':', ['app.kubernetes.io/part-of', ' opentelemetry'])) ): true | ||
( contains(@, join(':', ['job_name', ' otel-collector'])) ): true | ||
kind: ConfigMap | ||
metadata: | ||
name: ta-targetallocator |
Oops, something went wrong.