<p>I have a ClusterIssuer that is expecting <code>secretName</code>, I see in the <code>ClusterIssuer</code> <code>spec</code>, I can specify the <code>secretName</code>:</p>
<pre><code>apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: postgres-operator-ca-certificate-cluster-issuer
spec:
  ca:
    secretName: postgres-operator-ca-certificate     # &lt;---- Here
</code></pre>
<p>but how to provide the reference to the secret namespace? This secret is created using <code>Certificate</code>:</p>
<pre><code>apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: postgres-operator-self-signed-ca-certificate
  namespace: postgres                 # &lt;---- This namespace can not be changed to cert-manager
spec:
  isCA: true
  commonName: postgres-operator-ca-certificate
  secretName: postgres-operator-ca-certificate
  issuerRef:
    name: postgres-operator-selfsigned-clusterissuer
    kind: ClusterIssuer
</code></pre>
<p>As this is <code>namespaced</code> is the suggestion is to use <code>Issuer</code> instead of <code>ClusterIssuer</code>? Does <code>ClusterIssuer</code> by default look in the <code>cert-manager</code> namespace?</p>

<p>Typically it will look for the secret in the namespace <code>cert-manager</code> by default. Which namespace it looks in can be changed by your cert-manager installation by using the <code>--cluster-resource-namespace</code> argument, but not by individual ClusterIssuer.</p>
<p>From the documentation:</p>
<blockquote>
<p>If the referent is a cluster-scoped resource (e.g. a ClusterIssuer),
the reference instead refers to the resource with the given name in
the configured ‘cluster resource namespace’, which is set as a flag on
the controller component (and defaults to the namespace that
cert-manager runs in).</p>
</blockquote>
<p><a href="https://cert-manager.io/docs/reference/api-docs/#meta.cert-manager.io/v1.LocalObjectReference" rel="nofollow noreferrer">https://cert-manager.io/docs/reference/api-docs/#meta.cert-manager.io/v1.LocalObjectReference</a></p>
