Skip to content

✨ Add tls-profile-sync sidecar to cluster-manager operator#3049

Closed
zhujian7 wants to merge 1 commit intostolostron:mainfrom
zhujian7:add-tls-profile-sync-sidecar-to-cluster-manager
Closed

✨ Add tls-profile-sync sidecar to cluster-manager operator#3049
zhujian7 wants to merge 1 commit intostolostron:mainfrom
zhujian7:add-tls-profile-sync-sidecar-to-cluster-manager

Conversation

@zhujian7
Copy link
Copy Markdown
Contributor

@zhujian7 zhujian7 commented Apr 3, 2026

Description

Add a tls-profile-sync sidecar container to the cluster-manager operator deployment for TLS profile compliance (OpenShift 4.22 requirement, ACM-26882).

The sidecar watches APIServer.spec.tlsSecurityProfile and syncs TLS settings to an ocm-tls-profile ConfigMap that upstream OCM components can consume, enabling dynamic TLS configuration without depending on OpenShift APIs.

Related Issue

Changes Made

  • hack/patches/cluster-manager-tls-sidecar.yaml — Strategic merge patch adding the tls-profile-sync sidecar container to the cluster-manager deployment. Uses managedcluster-import-controller image which bundles the sidecar binary.
  • hack/patches/cluster-manager-tls-sync-clusterrole.yaml — RBAC ClusterRole for watching config.openshift.io/apiservers and managing configmaps.
  • hack/patches/cluster-manager-tls-sync-clusterrolebinding.yaml — ClusterRoleBinding binding the role to the cluster-manager ServiceAccount.
  • hack/bundle-automation/config.yaml — Added patches, additional_templates, and imageMappings entries for the sidecar.
  • pkg/templates/charts/toggle/cluster-manager/ — Regenerated chart templates with sidecar container, RBAC, and updated values.yaml.
  • pkg/templates/crds/cluster-manager/ — Updated CRD from upstream OCM bundle.

How it works

The chart generation pipeline (installer-dev-tools) applies the strategic merge patch to the cluster-manager deployment template before injectRequirements() runs. This means:

  1. The sidecar container is merged into the deployment as pure YAML
  2. fixImageReferences() converts the placeholder image to a Helm template variable
  3. updateDeployments() adds standard Helm flow control (proxy env vars, security context, etc.)

Dependencies

Checklist

  • I have tested the changes locally and they are functioning as expected.
  • I have updated the documentation (if necessary) to reflect the changes.
  • I have added/updated relevant unit tests (if applicable).
  • I have ensured that my code follows the project's coding standards.
  • I have checked for any potential security issues and addressed them.
  • I have added necessary comments to the code, especially in complex or unclear sections.
  • I have rebased my branch on top of the latest main/master branch.

Additional Notes

  • The sidecar gracefully handles non-OpenShift clusters (detects missing CRD, sleeps instead of crash-looping) — handled in the sidecar implementation itself.
  • The sidecar image is the same managedcluster-import-controller image used on the spoke side, which bundles the tls-profile-sync binary.

Assisted by Claude

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zhujian7
Once this PR has been reviewed and has the lgtm label, please assign ngraham20 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

Warning

Rate limit exceeded

@zhujian7 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48c75413-6759-4035-aed3-4a0e43cd49bd

📥 Commits

Reviewing files that changed from the base of the PR and between 26e5420 and 72f3148.

📒 Files selected for processing (10)
  • hack/bundle-automation/config.yaml
  • hack/patches/cluster-manager-tls-sidecar.yaml
  • hack/patches/cluster-manager-tls-sync-clusterrole.yaml
  • hack/patches/cluster-manager-tls-sync-clusterrolebinding.yaml
  • pkg/templates/charts/toggle/cluster-manager/templates/cluster-manager-tls-sync-clusterrole.yaml
  • pkg/templates/charts/toggle/cluster-manager/templates/cluster-manager-tls-sync-clusterrolebinding.yaml
  • pkg/templates/charts/toggle/cluster-manager/templates/cluster-manager.yaml
  • pkg/templates/charts/toggle/cluster-manager/values.yaml
  • pkg/templates/crds/cluster-manager/operator.open-cluster-management.io_clustermanagers.yaml
  • pkg/templates/rbac_gen.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zhujian7
Copy link
Copy Markdown
Contributor Author

zhujian7 commented Apr 3, 2026

/hold

@zhujian7 zhujian7 force-pushed the add-tls-profile-sync-sidecar-to-cluster-manager branch from 9a7bb43 to 387ba62 Compare April 3, 2026 03:33
Inject a tls-profile-sync sidecar container into the cluster-manager
operator deployment for TLS profile compliance (OpenShift 4.22).

The sidecar watches APIServer.spec.tlsSecurityProfile and syncs TLS
settings to an ocm-tls-profile ConfigMap that OCM components consume,
enabling dynamic TLS configuration without upstream OpenShift dependency.

Changes:
- Add strategic-merge patch and RBAC templates under hack/patches/
- Update config.yaml with patches and additional_templates for
  cluster-manager chart generation
- Regenerate cluster-manager chart with sidecar container and RBAC
- Update CRD from upstream OCM bundle

Depends on: https://github.com/zhujian7/installer-dev-tools/tree/add-helm-chart-patching-support

Assisted by Claude

Signed-off-by: zhujian <jiazhu@redhat.com>
@zhujian7 zhujian7 force-pushed the add-tls-profile-sync-sidecar-to-cluster-manager branch from 387ba62 to 72f3148 Compare April 3, 2026 03:39
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 10, 2026

PR needs rebase.

Details

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 kubernetes-sigs/prow repository.

@zhujian7 zhujian7 closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant