Skip to content

docs(best-practice): fix HTTP01 NetworkPolicy examples - correct port, traffic flow, and selectors#2158

Open
lohitkolluri wants to merge 1 commit into
cert-manager:masterfrom
lohitkolluri:fix/http01-networkpolicy-reviews
Open

docs(best-practice): fix HTTP01 NetworkPolicy examples - correct port, traffic flow, and selectors#2158
lohitkolluri wants to merge 1 commit into
cert-manager:masterfrom
lohitkolluri:fix/http01-networkpolicy-reviews

Conversation

@lohitkolluri

Copy link
Copy Markdown

Fixes cert-manager#2334

Addresses all review comments from PR #2151 (karthikk022's original PR). Instead of amending that branch, this PR provides corrected examples based on review feedback and the prior art in closed PR #2110.

Root Cause of Incorrect Examples in #2151

The original NetworkPolicy examples had several errors:

  1. Wrong port (8080 → 8089): cert-manager's acmesolver listens on port 8089 (acmeSolverListenPort = 8089 in pkg/issuer/acme/http/http.go:49), not 8080.
  2. Incorrect traffic flow: The controller does NOT connect directly to solver pods. The self-check (testReachability) goes through port 80 via the ingress/load balancer, following the same path the ACME server uses.
  3. Missing namespaceSelector: A podSelector-only rule won't match solver pods because they run in the Challenge namespace, not the cert-manager namespace.
  4. Wrong ingress source: Ingress should come from the ingress controller's namespace (e.g. ingress-nginx), not the cert-manager namespace.
  5. Incorrect egress rule in values.yaml: The added HTTP01 egress rule used the wrong port (8080), wrong selector (podSelector-only, won't match solver pods in other namespaces), and wrong flow (controller doesn't connect directly to solver pods). The existing port-80 egress rule already covers the controller's self-check.

What Changed

content/docs/installation/best-practice.md

  • New ### NetworkPolicy Examples for HTTP01 Challenges section with:
    • Correct port (8089) for the acmesolver
    • Accurate description of the traffic flow: ACME server → ingress → ingress controller → solver pod (port 8089)
    • Clarification that the controller's self-check uses port 80 via the ingress (same path as ACME server)
    • A correct NetworkPolicy ingress example that allows the ingress controller (via namespaceSelector) to reach solver pods on port 8089
    • No egress-from-controller-to-solver-pods example (it is incorrect)

public/docs/installation/best-practice/values.best-practice.yaml

  • Updated the comment on the port-80 egress rule to accurately describe what it does: allow the controller to reach the challenge URL via the ingress, not "access to the HTTP01 solver pod"

What Was NOT Added (vs. Original #2151)

  • The incorrect egress rule from controller to solver pods (wrong port, wrong selector, wrong flow)
  • The redundant API server port section (already documented in the Network Requirements list and covered by default egress rules)

Testing

  • Only documentation and YAML comments were changed
  • No functional code changes

Signed-off-by: Lohit Kolluri lohitkolluri@gmail.com

…, traffic flow, and selectors

Address all review comments on PR cert-manager#2151:

- Fix solver port 8080 → 8089 to match cert-manager's
  acmeSolverListenPort (pkg/issuer/acme/http/http.go:49)
- Correct the traffic flow documentation: the controller does NOT
  connect directly to solver pods. The self-check (testReachability)
  goes through port 80 via the ingress/load balancer, the same path
  the ACME server uses.
- Replace the ingress rule source from cert-manager namespace to the
  ingress controller namespace (namespaceSelector-based), since the
  ingress controller is the component that routes traffic to solver
  pods on port 8089.
- Remove the incorrect egress-from-controller-to-solver-pods example
  (wrong port, wrong selector, wrong flow - already covered by the
  existing port-80 egress rule for self-checks).
- Remove the redundant API server port example (already documented
  in the Network Requirements list and covered by default egress rules).
- Update the values.yaml comment on the port-80 self-check rule to
  accurately describe the traffic flow.

Closes cert-manager#2151
Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
@cert-manager-prow cert-manager-prow Bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Jun 16, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign erikgb 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

@cert-manager-prow cert-manager-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 16, 2026
@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for cert-manager ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8c0fc2c
🔍 Latest deploy log https://app.netlify.com/projects/cert-manager/deploys/6a3189e0fec6b20008b67841
😎 Deploy Preview https://deploy-preview-2158--cert-manager.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant