LOG-8972: Enhance cluster-logging-operator to react to cluster TLS Profile updates#3228
LOG-8972: Enhance cluster-logging-operator to react to cluster TLS Profile updates#3228jcantrill wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
@jcantrill: This pull request references LOG-8972 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@jcantrill: This pull request references LOG-8972 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
3e8e69a to
18d5156
Compare
|
/test all |
|
/hold |
|
@jcantrill: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
This PR enhances the cluster-logging-operator to react to cluster TLS Profile updates, ensuring both the operator itself and deployed collectors use the cluster's TLS security configuration.
Fixes LOG-8972
Changes
Operator's Own TLS Configuration
TLSProfileSpecto Gocrypto/tls.ConfigCollector TLS Configuration
Implementation Details
Part A: Operator TLS Configuration
Added
internal/tls/tls.goconversion functions:CipherSuiteStringToID: Convert cipher suite names to crypto/tls IDsTLSVersionToConstant: Convert TLS version strings to crypto/tls constantsTLSConfigFromProfile: Create crypto/tls.Config from TLSProfileSpecGetTLSConfigOptions: Get TLS options for controller-runtime managerCreated
internal/controller/tlsprofile/watcher controller:Updated
cmd/main.go:Part B: Collector TLS Configuration
internal/controller/observability/clusterlogforwarder_controller.go:config.openshift.io/v1/APIServerBehavior
When Cluster TLS Profile Changes
Operator:
Collectors:
TLS Profile Precedence
Testing
Unit Tests
Verification
make build- Successmake lint- 0 issuesManual Testing Recommendations
oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Modern"}}}'RBAC
No changes needed - existing ClusterRole already has permissions to read APIServer resources.
Notes
Why restart the operator? The controller-runtime manager's TLS configuration is set at creation time and cannot be dynamically updated. Restarting is the cleanest way to apply new TLS settings.
Impact on running collectors: The operator restart does not affect running collectors. They continue operating normally during the brief restart period.
TLS Curves: OpenShift's TLSProfileSpec doesn't have a separate field for EC curves. Curves are implicitly controlled by cipher suites (e.g., ECDHE cipher suites use EC curves).
Graceful degradation: If APIServer cannot be fetched, operator logs a warning and uses default TLS configuration (TLS 1.2).
Commits
feat(tls): Add TLS profile conversion helpers for crypto/tls configfeat(controller): Add TLS profile watcher to restart operator on changesfeat(operator): Apply cluster TLS profile to metrics endpointfeat(controller): Watch APIServer TLS profile for collector updatesDocumentation
Follow-up PR needed to update
docs/features/tls_security_profile.adocwith:🤖 Generated with Claude Code via
/jira:solve [LOG-8972](https://redhat.atlassian.net/browse/LOG-8972)