-
Notifications
You must be signed in to change notification settings - Fork 608
ta: inline tls config for config generation #4146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
swiatekm
merged 10 commits into
open-telemetry:main
from
CharlieTLe:fix-ta-tlsconfig-scrapeconfig
Jul 8, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7bba032
ta: inline tls config for config generation
CharlieTLe 13b83f0
add changelog
CharlieTLe 7b33760
retry getting ta metrics
CharlieTLe 161b53d
Merge branch 'main' into fix-ta-tlsconfig-scrapeconfig
CharlieTLe eb2e729
improve testing conditions for less flakiness
CharlieTLe d3e5f06
use x_metrics_decode for parsing metric value
CharlieTLe d171fb7
Merge branch 'main' into fix-ta-tlsconfig-scrapeconfig
CharlieTLe 5493968
Update chainsaw-test.yaml
CharlieTLe f7130b5
Merge branch 'main' into fix-ta-tlsconfig-scrapeconfig
CharlieTLe ef1c530
Merge branch 'main' into fix-ta-tlsconfig-scrapeconfig
CharlieTLe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,17 @@ | ||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: bug_fix | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action) | ||
| component: target allocator | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Allow collector to use TLS Config from Target Allocator with ScrapeConfig | ||
|
|
||
| # One or more tracking issues related to the change | ||
| issues: [3724] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: | | ||
| This change allows the target allocator to configure TLS Config for a collector using the ScrapeConfig. |
This file contains hidden or 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 hidden or 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
16 changes: 16 additions & 0 deletions
16
tests/e2e-ta-collector-mtls/ta-collector-mtls-scrapeconfig-node/00-assert.yaml
This file contains hidden or 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,16 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: prometheus-cr-v1beta1-targetallocator | ||
| status: | ||
| observedGeneration: 1 | ||
| readyReplicas: 1 | ||
| replicas: 1 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: prometheus-cr-v1beta1-collector | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 |
208 changes: 208 additions & 0 deletions
208
tests/e2e-ta-collector-mtls/ta-collector-mtls-scrapeconfig-node/00-install.yaml
This file contains hidden or 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,208 @@ | ||
| apiVersion: v1 | ||
| automountServiceAccountToken: true | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: ta | ||
| --- | ||
| apiVersion: v1 | ||
| automountServiceAccountToken: true | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: collector | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: collector | ||
| annotations: | ||
| kubernetes.io/service-account.name: collector | ||
| type: kubernetes.io/service-account-token | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: (join('-', ['ta', $namespace])) | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - pods | ||
| - nodes | ||
| - services | ||
| - endpoints | ||
| - configmaps | ||
| - secrets | ||
| - namespaces | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - apiGroups: | ||
| - apps | ||
| resources: | ||
| - statefulsets | ||
| - services | ||
| - endpoints | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - apiGroups: | ||
| - discovery.k8s.io | ||
| resources: | ||
| - endpointslices | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - apiGroups: | ||
| - networking.k8s.io | ||
| resources: | ||
| - ingresses | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - apiGroups: | ||
| - monitoring.coreos.com | ||
| resources: | ||
| - servicemonitors | ||
| - podmonitors | ||
| - scrapeconfigs | ||
| - probes | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - nonResourceURLs: | ||
| - /metrics | ||
| verbs: | ||
| - get | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: (join('-', ['collector', $namespace])) | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - pods | ||
| - nodes | ||
| - nodes/proxy | ||
| - nodes/metrics | ||
| - services | ||
| - endpoints | ||
| - namespaces | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - apiGroups: | ||
| - networking.k8s.io | ||
| resources: | ||
| - ingresses | ||
| verbs: | ||
| - get | ||
| - watch | ||
| - list | ||
| - nonResourceURLs: | ||
| - /metrics | ||
| - /metrics/cadvisor | ||
| verbs: | ||
| - get | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: (join('-', ['opentelemetry-operator-controller-manager-cert-manager-role', $namespace])) | ||
| rules: | ||
| - apiGroups: | ||
| - cert-manager.io | ||
| resources: | ||
| - issuers | ||
| - certificaterequests | ||
| - certificates | ||
| verbs: | ||
| - create | ||
| - get | ||
| - list | ||
| - watch | ||
| - update | ||
| - patch | ||
| - delete | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: (join('-', ['opentelemetry-operator-controller-manager-cert-manager-role', $namespace])) | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: (join('-', ['opentelemetry-operator-controller-manager-cert-manager-role', $namespace])) | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: opentelemetry-operator-controller-manager | ||
| namespace: opentelemetry-operator-system | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: (join('-', ['ta', $namespace])) | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: (join('-', ['ta', $namespace])) | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: ta | ||
| namespace: ($namespace) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: (join('-', ['collector', $namespace])) | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: (join('-', ['collector', $namespace])) | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: collector | ||
| namespace: ($namespace) | ||
| --- | ||
| apiVersion: opentelemetry.io/v1beta1 | ||
| kind: OpenTelemetryCollector | ||
| metadata: | ||
| name: prometheus-cr-v1beta1 | ||
| spec: | ||
| config: | ||
| receivers: | ||
| prometheus: | ||
| config: | ||
| scrape_configs: [] | ||
|
|
||
| processors: | ||
|
|
||
| exporters: | ||
| prometheus: | ||
| endpoint: 0.0.0.0:9090 | ||
| service: | ||
| pipelines: | ||
| metrics: | ||
| receivers: [prometheus] | ||
| exporters: [prometheus] | ||
| telemetry: | ||
| logs: | ||
| level: "DEBUG" | ||
| development: true | ||
| encoding: "json" | ||
| mode: statefulset | ||
| serviceAccount: collector | ||
| targetAllocator: | ||
| enabled: true | ||
| prometheusCR: | ||
| enabled: true | ||
| scrapeInterval: 1s | ||
| scrapeConfigSelector: {} | ||
| serviceAccount: ta |
13 changes: 13 additions & 0 deletions
13
tests/e2e-ta-collector-mtls/ta-collector-mtls-scrapeconfig-node/01-assert.yaml
This file contains hidden or 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,13 @@ | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: check-ta-scrape-config-v1beta1 | ||
| status: | ||
| succeeded: 1 | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: check-ta-jobs-scrape-configs-v1beta1 | ||
| status: | ||
| succeeded: 1 |
37 changes: 37 additions & 0 deletions
37
tests/e2e-ta-collector-mtls/ta-collector-mtls-scrapeconfig-node/01-install.yaml
This file contains hidden or 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,37 @@ | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: check-ta-scrape-config-v1beta1 | ||
| spec: | ||
| template: | ||
| metadata: | ||
| labels: | ||
| checker: "true" | ||
| spec: | ||
| restartPolicy: OnFailure | ||
| containers: | ||
| - name: check-metrics | ||
| image: curlimages/curl | ||
| args: | ||
| - /bin/sh | ||
| - -c | ||
| - curl -s http://prometheus-cr-v1beta1-targetallocator/scrape_configs | grep "scrape-config-cr" | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: check-ta-jobs-scrape-configs-v1beta1 | ||
| spec: | ||
| template: | ||
| metadata: | ||
| labels: | ||
| checker: "true" | ||
| spec: | ||
| restartPolicy: OnFailure | ||
| containers: | ||
| - name: check-metrics | ||
| image: curlimages/curl | ||
| args: | ||
| - /bin/sh | ||
| - -c | ||
| - curl -s http://prometheus-cr-v1beta1-targetallocator/jobs | grep "scrape-config-cr" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.