-
Notifications
You must be signed in to change notification settings - Fork 173
Add openshift resource detector for distribution: openshift #2330
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
Changes from 10 commits
1aafdc9
4e09e68
d4cc32a
27a7ac8
05c6c95
cdf8d1f
e042c82
acbb4b7
cf178a4
e3f7ecd
f2179eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # 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. agent, clusterReceiver, gateway, operator, chart, other) | ||
| component: agent, clusterReceiver, gateway | ||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Fix resource detection for non-EKS Kubernetes clusters on AWS | ||
| # One or more tracking issues related to the change | ||
| issues: [2330] | ||
| # (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: | | ||
| Two issues were fixed for non-EKS Kubernetes clusters running on AWS (cloudProvider=aws): | ||
| 1. The chart was using the eks detector, which only activates on actual EKS clusters | ||
| (it checks for EKS-specific signals like IRSA/Pod Identity token paths, the OIDC | ||
| issuer, and the cluster version string). On non-EKS clusters these checks all fail | ||
| and the detector returns empty, so EC2 metadata (host.id, cloud.account.id, | ||
| cloud.availability_zone, etc.) was never collected. Switched to the ec2 detector, | ||
| which works on any AWS instance with IMDS access. | ||
| 2. The condition for detecting non-EKS AWS clusters only matched when distribution was | ||
| unset (empty string), excluding the OpenShift distribution that can run on AWS | ||
| but is not EKS. Broadened the condition to match any non-EKS distribution on AWS. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: enhancement | ||
| # The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other) | ||
| component: agent, clusterReceiver, gateway | ||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Add OpenShift resource detection support | ||
| # One or more tracking issues related to the change | ||
| issues: [2330] | ||
| # (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: | | ||
| When distribution is set to "openshift", the openshift detector is enabled regardless of | ||
| cloudProvider. It auto-discovers k8s.cluster.name, cloud.provider, cloud.platform, and | ||
| cloud.region via the OpenShift API (config.openshift.io/v1/infrastructures). The | ||
| cloud.platform value reflects the actual hosting environment (e.g., aws_openshift, | ||
| gcp_openshift, azure.openshift). Cloud-provider-specific detectors are also enabled | ||
| alongside the openshift detector to collect instance metadata: ec2 on AWS, gcp on GCP, | ||
| and azure on Azure. Distribution-specific detectors (openshift, aks) now take priority | ||
| over the cloud-provider catch-all in detector selection, ensuring the correct | ||
| cloud.platform is always set. The clusterName field is now optional for OpenShift. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,7 @@ data: | |
| resourcedetection: | ||
| detectors: | ||
| - env | ||
| - openshift | ||
| - system | ||
| override: true | ||
| timeout: 15s | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ data: | |
| resourcedetection: | ||
| detectors: | ||
| - env | ||
| - openshift | ||
| - system | ||
| override: true | ||
| timeout: 15s | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ resourceMetrics: | |
| stringValue: abcd | ||
| - key: cloud.platform | ||
| value: | ||
| stringValue: abcd | ||
| stringValue: aws_eks | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I excluded this attribute from the normalization done in test; this is a good attr value to ascertain that the order of detectors are correct |
||
| - key: cloud.provider | ||
| value: | ||
| stringValue: abcd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,15 @@ | ||
| resourceMetrics: | ||
| - resource: | ||
| attributes: | ||
| - key: cloud.platform | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ec2 detector resources are missing in the test cluster because openshift has restriction on IMDS access originating from non-host network. User can run the clusterReceiver in hostNetwork or they can give IAM permission to the pod. |
||
| value: | ||
| stringValue: aws_openshift | ||
| - key: cloud.provider | ||
| value: | ||
| stringValue: abcd | ||
| - key: cloud.region | ||
| value: | ||
| stringValue: abcd | ||
| - key: cluster_name | ||
| value: | ||
| stringValue: abcd | ||
|
|
@@ -15,7 +24,7 @@ resourceMetrics: | |
| stringValue: abcd | ||
| - key: k8s.cluster.name | ||
| value: | ||
| stringValue: ci-k8s-cluster | ||
| stringValue: rosa-test-htcpw | ||
| - key: k8s.namespace.name | ||
| value: | ||
| stringValue: abcd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,6 @@ extraAttributes: | |
| - name: "customfield2" | ||
| value: "customvalue2" | ||
|
|
||
| clusterName: ci-k8s-cluster | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed to test the cluster name is retrieved correctly |
||
| environment: dev | ||
| cloudProvider: aws | ||
| distribution: openshift | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.