Skip to content

CM-830: Integrate trust-manager with cert-manager-operator#1914

Open
chiragkyal wants to merge 2 commits intoopenshift:masterfrom
chiragkyal:trust-manager
Open

CM-830: Integrate trust-manager with cert-manager-operator#1914
chiragkyal wants to merge 2 commits intoopenshift:masterfrom
chiragkyal:trust-manager

Conversation

@chiragkyal
Copy link
Member

@chiragkyal chiragkyal commented Dec 23, 2025

Extend cert-manager-operator to deploy and manage trust-manager as an operand, providing a solution for trust bundle distribution on OpenShift.

@chiragkyal chiragkyal changed the title Add proposal for trust-manager integration in cert-manager-operator Integrate trust-manager with cert-manager-operator Dec 23, 2025
@chiragkyal chiragkyal changed the title Integrate trust-manager with cert-manager-operator CM-830: Integrate trust-manager with cert-manager-operator Dec 23, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 23, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 23, 2025

@chiragkyal: This pull request references CM-830 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Extend cert-manager-operator to deploy and manage trust-manager
as an operand, providing a solution for trust bundle distribution
on OpenShift.

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 23, 2025

@chiragkyal: This pull request references CM-830 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Extend cert-manager-operator to deploy and manage trust-manager as an operand, providing a solution for trust bundle distribution on OpenShift.

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.

@chiragkyal
Copy link
Member Author

/cc @bharath-b-rh @lunarwhite

Copy link
Contributor

@bharath-b-rh bharath-b-rh left a comment

Choose a reason for hiding this comment

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

LGTM mostly. I will need a second read.

@chiragkyal chiragkyal force-pushed the trust-manager branch 4 times, most recently from c31d38c to b7c9665 Compare January 3, 2026 13:36
Copy link
Member

@lunarwhite lunarwhite left a comment

Choose a reason for hiding this comment

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

It looks fairly good to me 👍. I'm very glad to see that the upstream planned Bundle API changes/deprecations are mentioned in this EP. As we move toward GA (future), we might need to adjust our custom APIs based on the stabilized upstream CRD APIs accordingly.

@mytreya-rh
Copy link
Contributor

  • We need to flesh out the defaultca package implementation to avoid/alleviate the cases where the source ConfigMap is not populated in time for the operator to create the operand deployment, and the rollout of operand if the source ConfigMap changes. But this was discussed and we agreed to defer to it during implementation to try out the options.
  • w.r.t cluster privileges needed for the operator: We are still waiting on https://redhat-internal.slack.com/archives/C3VS0LV41/p1759755909042599 and thus we will need to take it up later

/lgtm
/hold for @bharath-b-rh and @lunarwhite on design and test aspects
cc: @TrilokGeer

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 8, 2026
@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Jan 8, 2026
This enhancement describes extending cert-manager-operator to deploy and
manage trust-manager as an operand.

Signed-off-by: chiragkyal <[email protected]>
@chiragkyal chiragkyal force-pushed the trust-manager branch 2 times, most recently from 06b2a15 to 0a6ca23 Compare January 12, 2026 12:55

### User Stories

- As an OpenShift administrator, I want to have an option to deploy trust-manager as a day-2 operation, so that I can
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any specific impact if the trust manager is delivered as default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not all the customers would require trust bundle management from day0, hence an explicit opt-in would give them a choice. Customers who need trust-manager can easily enable it by creating a single TrustManager CR. This approach is consistent with how istio-csr is also delivered as an optional day-2 operand in cert-manager-operator.

If we deliver it as default, I think apart from resource overhead challenges for the customers who don't need this operand, there should not be an impact.

- As an OpenShift administrator, I want to have an option to deploy trust-manager as a day-2 operation, so that I can
distribute CA certificates across my cluster.
- As an OpenShift administrator, I want to be able to configure trust-manager, so that only required features can be enabled.
- As an OpenShift administrator, I want to enable trust-manager to write trust bundles to Secrets in addition to ConfigMaps
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any specific requirements of why these trust bundles need to be in Secrets and not only ConfigMaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

It depends on how the application wants to use the trust bundle. Some applications might require to read CA bundles exclusively from Secrets. This is an optional feature controlled by secretTargets.policy. By default, trust-manager only writes to ConfigMaps. Administrators explicitly enable Secret targets when their applications require it.

- As an OpenShift administrator, I want to use OpenShift's trusted CA bundle as the default CA package, so that trust-manager uses certificates appropriate for my cluster.
- As an OpenShift administrator, I want to filter expired certificates from trust bundles to ensure only valid certificates
are distributed.
- As an OpenShift administrator, I want to configure a custom trust namespace where trust sources (ConfigMaps/Secrets)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the custom trust namespace an application-specific namespace?

Copy link
Member Author

@chiragkyal chiragkyal Jan 15, 2026

Choose a reason for hiding this comment

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

No, the trust namespace is not application-specific. It's a centralized namespace where trust-manager reads source CA certificates from. We are making this option immutable once set.

- `cert-manager-operator` to be extended to manage `trust-manager` along with currently managed `cert-manager` and `istio-csr`.
- New custom resource (CR) `trustmanagers.operator.openshift.io` to be made available to install and configure
the trust-manager deployment.
- Provide OpenShift-native integration for the default CA package using CNO's trusted CA bundle injection instead of the
Copy link
Contributor

Choose a reason for hiding this comment

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

Does using CNO directly be better in this case? The user might have better control on the resources that require ca injection.

Copy link
Member Author

Choose a reason for hiding this comment

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

We will be using CNO to inject default CA certificates into the trust-manager Bundle. Detailed steps are mentioned in the DefaultCAPackage Implementation section.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does using CNO directly be better in this case?

It is specifically for making available the RHCOS bundled CA certificates, user configured certificates for proxy... in case the application need those and is optional. But for distributing CA certificate bundle specifically based on the application need, trust-manager fares better, where instead of distributing all the OpenShift Cluster trusted CA certificates, only required certificates can be made available.

The user might have better control on the resources that require ca injection.

@TrilokGeer Could you please elaborate more this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to add a bit more to the context:
Whether or not to include the DefaultCA is a parameter (useDefaultCAs) at each bundle level.
Thus, the user has the choice of which bundles will include the DefaultCA, and which will not.


- Automatic cleanup of Configmap created to support `DefaultCAPackage` option, when this field is toggled or TrustManager CR is deleted.

- For TechPreview, the `targetNamespaces` option will not be configurable. This option controls which namespaces
Copy link
Contributor

Choose a reason for hiding this comment

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

This might result to a conflict and maybe hard to trace, where an un-intended write will override ca configurations in a namespace.

Copy link
Member Author

Choose a reason for hiding this comment

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

The targetNamespaces option defines the RBAC for trust-manager. Actual writes are controlled by individual Bundle CRs through namespaceSelector field.

apiVersion: trust.cert-manager.io/v1alpha1
kind: Bundle
metadata:
  name: my-bundle
spec:
  sources:
    - configMap:
        name: "my-ca"
        key: "ca.crt"
  target:
    configMap:
      key: "ca-bundle.crt"
    # Only writes to namespaces with this label
    namespaceSelector:
      matchLabels:
        trust-bundle-injection: enabled

The actual write behavior is controlled by Bundle CRs, with explicit target naming at the application level.

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally trust-manager doesn't overwrite the target resource, but instead only appends the configured keys. And yes, if keys with same name exists, that would be a misconfiguration.


**Impact**:
- Users who create `Bundle` resources may need to migrate to `ClusterBundle` or the new namespace-scoped `Bundle`
- Helm chart values may change, leading to changes in downstream CRD values.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, this risk must be mitigated by using applicable defaults wherever applicable. Is there any other implementation that cannot be solved by defaults?

Copy link
Member Author

Choose a reason for hiding this comment

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

The Bundle to ClusterBundle migration will happen in a phased manner in upstream. We can definitely handle Helm value changes and CRD defaults if applicable.
Migration and backward compatibility will be defined by upstream. We'll adapt based on the decision and document any required user actions.

Copy link
Contributor

@bharath-b-rh bharath-b-rh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bharath-b-rh
Once this PR has been reviewed and has the lgtm label, please ask for approval from mytreya-rh. 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

Signed-off-by: chiragkyal <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 15, 2026

New changes are detected. LGTM label has been removed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 15, 2026

@chiragkyal: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants