<p>I've been trying for the last 3 days to setup cert-manager on a K8S cluster (v1.19.8) in an OpenStack environment with 1 master and 2 nodes.
It worked before (like 1 month ago), but since I re-created the cluster, pod ACME challenges cannot be created due to this error:</p>
<pre><code>Status:
  Presented:   false
  Processing:  true
  Reason:      pods &quot;cm-acme-http-solver-&quot; is forbidden: PodSecurityPolicy: unable to admit pod: []
  State:       pending
Events:
  Type     Reason        Age                    From          Message
  ----     ------        ----                   ----          -------
  Normal   Started       8m25s                  cert-manager  Challenge scheduled for processing
  Warning  PresentError  3m18s (x7 over 8m23s)  cert-manager  Error presenting challenge: pods &quot;cm-acme-http-solver-&quot; is forbidden: PodSecurityPolicy: unable to admit pod: []
</code></pre>
<p>I've tried different versions of the ingress-nginx, different versions of cert-manager, different versions of k8s, but to no avail. I'm getting crazy..., please help. Many thanks :)</p>
<h2>Cluster setup</h2>
<pre class="lang-sh prettyprint-override"><code>kubectl create namespace ingress-nginx &amp;&amp; \
helm install ingress-nginx ingress-nginx/ingress-nginx -n ingress-nginx &amp;&amp; \
kubectl create namespace cert-manager &amp;&amp; \
helm install cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --version v1.1.0 \
  --set installCRDs=true
</code></pre>
<p>Issuer</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: email@example.com
    preferredChain: &quot;ISRG Root X1&quot;
    privateKeySecretRef:
      name: letsencrypt-prod
    solvers:
      - http01:
          ingress:
            class: nginx
</code></pre>
<p>Ingress</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: main-ingress
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
    nginx.ingress.kubernetes.io/from-to-www-redirect: &quot;true&quot;
    cert-manager.io/issuer: &quot;letsencrypt-prod&quot;
spec:
  tls:
  - hosts:
      - host.com
    secretName: the-secret-name
  rules:
  - host: host.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: api-nginx
            port: 
              number: 80
</code></pre>

<p>After some debugging and much help from the hosting provider, we found the problem and the solution.</p>
<p>We were using the latest (from master) version of Magnum/OpenStack, which got an update that installed by default a PodSecurityPolicy controller. That prevented ACME pods to be created by cert-manager.</p>
<p>Recreating the cluster without a policy controller solved the issue:</p>
<pre class="lang-sh prettyprint-override"><code>openstack coe cluster create \
  --cluster-template v1.kube1.20.4 \
  --labels \
admission_control_list=&quot;NodeRestriction,NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota,TaintNodesByCondition,Priority,DefaultTolerationSeconds,DefaultStorageClass,StorageObjectInUseProtection,PersistentVolumeClaimResize,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,RuntimeClass&quot; \
  --merge-labels
  ...
</code></pre>
