Skip to content

Conversation

sky333999
Copy link

@sky333999 sky333999 commented Aug 6, 2025

Description:

  • Introduces new Collector CRD config options for configuring & managing the ClusterIP Service, Headless Service, Monitoring Service & Extension Service.
  • For each of the Services, config to Enable/Disable the service and override the Name of the service.
  • To maintain backwards compatibility, I considered the following two options and decided to go with the second.
    • Call the flag Disabled instead of Enabled such that it initializes to false when not set and the behavior stays the same.
    • Make the flags pointers instead of bools such that we can know whether the flag was explicitly provided i.e. nil implies retain old behavior.

Link to tracking Issue(s):

Testing:

Unit Testing

  • Updated existing unit tests and added new ones accordingly

Local Testing

  • Setup: Created a new image with my local changes, pushed to ECR, deployed the Operator via the helm chart using my custom image.
  • Scenario 1: Install a Collector CR (used this example) as-is.
    Validation: Daemonset is created, all 4 services are created. No observable change in behavior.
  • Scenario 2: Update the Collector CR to disable ClusterIP service.
    Validation: Apply failed complaining the CRD did not recognize the new field. Expected behavior.
  • Scenario 3: Updated CRD to include new fields, re-applied the Collector CR to disable the ClusterIP service.
    Validation: Apply was successful; The ClusterIP service is deleted.
  • Scenario 4: Updated Collector CR to disable all 4 services.
    Validation: All 4 services are deleted.
  • Scenario 5: Updated Collector CR to enable only the ClusterIP service and override the Name.
    Validation: Only the ClusterIP service is recreated and has the overridden name.

E2E Testing

  • Added E2E tests to capture default scenario, disabling scenario and name override scenario.

Documentation: CRDs are self-documenting, no further changes made.

@sky333999 sky333999 force-pushed the configure-collector-services branch 2 times, most recently from e3cefe7 to c8a51c7 Compare August 6, 2025 21:01
@@ -657,6 +657,7 @@ TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
echo "replace fybrik.io/crdoc => github.com/fybrik/crdoc v0.5.2" >> go.mod ;\
Copy link
Author

@sky333999 sky333999 Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fybrik.io domain seems to have expired. So adding a replace temporarily.

Idk why this is a problem just for me. Is is that the go mod cached on the GH runners for the actions?

@@ -558,6 +558,48 @@ service:
Annotations: map[string]string{},
},
},
&networkingv1.Ingress{
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a re-ordering since now services are created after the ingress in collector.go.

@sky333999 sky333999 marked this pull request as ready for review August 6, 2025 21:10
@sky333999 sky333999 requested a review from a team as a code owner August 6, 2025 21:10
@@ -239,6 +239,22 @@ type OpenTelemetryCollectorSpec struct {
// +optional
ServiceName string `json:"serviceName,omitempty"`

// Service to override configuration of the generated Collector Service.
// +optional
Service ServiceSpec `json:"service,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no need to edit the v1alpha1 resources, these are deprecated and we shouldnt be touching them anymore.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I can revert the changes and remove the changes to the converter as well.

@sky333999 sky333999 force-pushed the configure-collector-services branch from 520d45d to ec2bfc3 Compare August 7, 2025 21:27
Copy link
Contributor

E2E Test Results

 33 files  ±0  223 suites  +2   4h 4m 20s ⏱️ + 19m 46s
 86 tests +1   84 ✅  - 1  0 💤 ±0  2 ❌ +2 
227 runs  +2  225 ✅ ±0  0 💤 ±0  2 ❌ +2 

For more details on these failures, see this check.

Results for commit 5771abd. ± Comparison against base commit 531de9c.

# Conflicts:
#	bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
#	bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable creation of collector's K8s services
2 participants