Skip to content

Conversation

@joluc
Copy link
Contributor

@joluc joluc commented Oct 27, 2025

Description

This PR adds support for configuring a custom URL for operator-to-cluster communication, resolving the issue where the operator cannot connect to OpenSearch clusters using LoadBalancer services with external TLS certificates.

Key Features

  1. OperatorClusterURL Configuration: New field in OpenSearchCluster spec that allows specifying a custom URL for operator-to-cluster communication, overriding the default internal service DNS name.
  2. CustomFQDN Support: New field in TLS HTTP configuration for specifying custom fully qualified domain names, ensuring certificate generation aligns with external domain requirements.

Use Cases

  • LoadBalancer services with external certificates for direct client access (avoiding ingress latency)
  • External load balancers requiring valid TLS certificates from public CAs
  • Enterprise environments with custom DNS and certificate requirements

Issues Resolved

#1146

Check List

  • Commits are signed per the DCO using --signoff
  • Unittest added for the new/changed functionality and all unit tests are successful
  • Customer-visible features documented
  • No linter warnings (make lint)

If CRDs are changed:

  • CRD YAMLs updated (make manifests) and also copied into the helm chart
  • Changes to CRDs documented

Please refer to the PR guidelines before submitting this pull request.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

joluc added 10 commits October 27, 2025 17:36
Add new configuration fields to support custom cluster URLs and FQDNs:
- OperatorClusterURL: allows specifying a custom cluster URL
- CustomFQDN: enables custom fully qualified domain names

These fields provide flexibility for different deployment scenarios
and networking configurations.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Implement utility function to generate cluster URLs with support for
the new OperatorClusterURL configuration. Includes comprehensive tests
to verify URL generation logic.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Update URLForCluster function to utilize the new OperatorClusterURL
field when available. Includes tests to verify the integration works
correctly with both default and custom URL configurations.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Extend TLS certificate generation to support custom FQDNs through the
CustomFQDN field. This enables proper certificate validation for
custom domain configurations.

Includes comprehensive tests covering various FQDN scenarios.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Add Helm chart documentation, configuration examples, and user guide
improvements for the new OperatorClusterURL and CustomFQDN features.

Includes practical examples showing how to configure custom cluster URLs
and domain names in different deployment scenarios.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Consolidate URL generation logic to eliminate code duplication and
improve maintainability. Move shared functionality to helper functions
and update tests accordingly.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Refactor TLS configuration code for better readability and
maintainability. Simplify logic flow and improve error handling.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Move utility tests from util package to helpers package for better
organization and clearer separation of concerns.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Update documentation to reference the current version for accuracy
and consistency across all documentation files.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Replace placeholder comment with descriptive documentation for
DashboardsTlsConfig TlsCertificateConfig field.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
joluc added 4 commits October 27, 2025 18:22
Add comprehensive tests for the new ClusterURL helper function:
- Test custom operatorClusterURL usage
- Test default internal DNS fallback
- Test default port handling

Tests are added to the existing helpers test structure from main branch.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
@synhershko
Copy link
Collaborator

There seems to be a failing test can you pleaes review?

@josedev-union can you have a look too please?

joluc added 2 commits October 27, 2025 18:55
The test was expecting port 0 when HttpPort is not set, but the ClusterURL
function correctly defaults to port 9200 when HttpPort is 0. Updated the
test expectation to match the correct behavior.

Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Signed-off-by: Jonathan Schwarze <jonathan.schwarze@sap.com>
Copy link
Contributor

@josedev-union josedev-union left a comment

Choose a reason for hiding this comment

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

@joluc followings are missing in your PR

  • regenerate opensearchclusters CRD
  • regenerate deepcopy file

you can get them running

make generate
make build manifests

@josedev-union
Copy link
Contributor

@joluc can you please fix DCO issue and resolve conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In Review

Development

Successfully merging this pull request may close these issues.

3 participants