feat: data sink, replaced hard coded secret for credentials #27
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.
Introduce DataSink CRD for Configurable Telemetry Export
This PR introduces the new
DataSinkCustom Resource Definition (CRD) as the primary mechanism for configuring telemetry export endpoints, replacing the previous hardcoded secret-based configuration approach. TheDataSinkCRD enables declarative configuration of OTLP/HTTP endpoints with flexible authentication via Kubernetes Secrets, significantly improving the operator's configurability and maintainability.Key Changes:
🚀 New Feature: DataSink CRD
DataSinkCRD (api/v1alpha1/datasink_types.go) for declarative OTLP/HTTP endpoint configurationMetric,ManagedMetric,FederatedMetric,FederatedManagedMetric) to consumeDataSinkresources instead of hardcoded secretsDataSinkretrieval logic ininternal/controller/datasink_utils.goto reduce code duplicationOPERATOR_CONFIG_NAMESPACE) and in-cluster deployment (POD_NAMESPACE) scenariosinternal/clientoptl/optl.go) to properly parse complete endpoint URLs fromDataSinkconfigurations, including correct handling of host, path, and scheme componentsMakefile, RBAC configurations, and provided comprehensive examples inexamples/datasink/directory🔧 Improvements: Enhanced Status Condition Handling
Readycondition handlingTypeReadyconstant and helper functions (ReadyTrue,ReadyFalse,ReadyUnknown) for reliable condition state managementdefer-based condition setting to ensure theReadycondition is properly initialized and updated (True, False, or Unknown with specific reasons) at the end of each reconciliation loopImpact:
This change significantly improves the operator's flexibility by allowing users to define multiple telemetry endpoints declaratively through Kubernetes resources rather than relying on hardcoded configurations. The
DataSinkCRD provides a clean separation of concerns, better security through Secret-based authentication, and improved maintainability for complex telemetry routing scenarios.