Skip to content

fix(chart): drop the ingress-nginx defaults - #199

Merged
uniqueg merged 6 commits into
devfrom
fix/chart-neutral-ingress
Oct 23, 2026
Merged

uniqueg merged 6 commits into
devfrom
fix/chart-neutral-ingress

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

The chart no longer has defaults for one particular (retired) ingress controller. It keeps foca-common 0.1.0 until #179.

  • cloudRegistry.networkPolicy.ingressFrom now defaults to [] instead of the namespace ingress-nginx. The policy stays disabled by default.
    • Enabling it without peers fails rendering, with the library's message ("ingressFrom must list at least one NetworkPolicy peer"), because no peers would allow all sources.
    • The values comment points to the examples.
  • deployment/values.schema.json (the library's app-values.schema.json with documented changes) allows the empty list: minItems is dropped and the description no longer names a default. Both are noted in its $comment and checked in test_schema_of_library.
  • deployment/README.md:
    • Ingress: the chart works with any controller. Controller annotations are examples to add to the values (TLS redirect, rate limits). ingress-nginx is called retired. For the Gateway API, until the chart has httpRoute: disable the Ingress and attach an HTTPRoute of your own to the Service on port 8080, matching only /ga4gh/registry/v1/.
    • TLS and rate limits: the ingress-nginx annotations are examples, with Traefik pointers.
    • Network policies: no default peers, with examples for ingress-nginx, Traefik (k3s), Envoy Gateway and OpenShift.
    • Server: keep-alive notes for Traefik (90 s) and Envoy Gateway (1 h) besides ingress-nginx (60 s).
  • Docs: values.yaml and docs/configuration.md keep-alive notes; docs/upgrading.md step 4 and the 0.3.0 release notes no longer state an ingress-nginx default.
  • Tests: the default is empty, enabling without peers fails, the given peers are rendered, [] is no longer a schema error but a template error, and the schema test is updated.

Left for #179 (needs foca-common 0.2.0), added to its checklist with the existing items kept:

  • cloudRegistry.httpRoute and its tests;
  • links to FOCA's "Exposing the app" guides at chart-v0.2.0 (the README may only link FOCA at the chart's library tag, chart-v0.1.0, which predates the guides);
  • keeping the empty ingressFrom default when copying the 0.2.0 schema.

Verification

  • pytest with coverage (mongomock, helm 3.22.1 from the CI version for the chart tests): 1181 passed, 100%.
  • pre-commit run --all-files passed.
  • helm lint deployment --strict -f deployment/ci/test-values.yaml passed.
  • mkdocs build --strict passed.
  • python scripts/release_notes.py check docs/releases/0.3.0.md passes.
  • Sourcery: fixed in b05c0ec (on OpenShift the chart's Route still exposes all paths next to an HTTPRoute; where Envoy Gateway runs its proxies); one finding declined (below).
  • CI on b05c0ec: all checks pass (tests with mongomock and MongoDB 7.0, static analysis, Helm chart, release readiness, docs, Docker Compose, image scan, CodeQL, Read the Docs).
  • Reviews: adversarial-reviewer and quality-reviewer (round 1), adversarial-reviewer (round 2). Fixed: stale defaults in the upgrade steps and notes, the HTTPRoute port (8080, as backendRefs take numbers), keep-alive notes, and the schema test.

Declined review findings

  • Raising the Gunicorn keepalive default (75) above Traefik's 90 s: that is the image's default and out of this issue's scope. The docs now say to raise it for Traefik.
  • The schema's gunicorn.keepalive description, which still names only ingress-nginx: it is the library's wording, and the schema test requires the copy to match the library apart from the documented changes. That belongs in foca-common.
  • The $comment wording "0.2.0 for release 0.3.0": it describes the state at the release, after build: require FOCA 0.17.0 and foca-common 0.2.0 #179.
  • Sourcery: documenting --reuse-values upgrades with the old peer: no chart release had the ingress-nginx default (the chart is first released in 0.3.0), and the documented upgrade reinstalls with a new values file.
  • The library still sets nginx.ingress.kubernetes.io/proxy-body-size on the Ingress: this is foca-common's template, not a values default. Other controllers ignore it, and it is documented.

Proposed follow-up (not filed)

Closes #196

🤖 Generated with Claude Code

uniqueg and others added 4 commits October 23, 2026 14:15
The app's NetworkPolicy has no peers by default (ingressFrom: []):
they depend on the cluster's ingress controller or Gateway, and
rendering fails if the policy is enabled without any. The values
schema allows the empty default (noted in its $comment and the
schema test). The chart README treats ingress-nginx as one
example among others (it is retired), with NetworkPolicy peers for
ingress-nginx, Traefik, Envoy Gateway and OpenShift, and explains
how to use the Gateway API with an HTTPRoute of one's own until
the chart moves to foca-common 0.2.0 (#179).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Gateway API guidance: the HTTPRoute's backend is the Service on
  port 8080 (HTTPRoutes take port numbers), matching only
  /ga4gh/registry/v1/; in a paragraph of its own.
- Keep-alive notes name Traefik and Envoy Gateway besides
  ingress-nginx (README, values, configuration docs).
- The upgrade steps and 0.3.0 notes no longer state an
  ingress-nginx default for ingressFrom.
- The schema test takes the description from the copy, checking
  that it names no ingress-nginx default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The chart now has no ingress-nginx-specific NetworkPolicy peers by default: the schema permits an empty list, but enabling the policy without explicitly configured peers fails safely during template rendering. Tests cover the new defaults, validation, peer rendering, and library-schema exception, while deployment and release documentation is updated for controller-neutral Ingress usage, Gateway API migration, supported peer examples, and controller-specific keep-alive settings.

Sequence diagram for safe NetworkPolicy rendering

sequenceDiagram
    participant Helm
    participant Chart
    participant NetworkPolicy

    Helm->>Chart: render with networkPolicy.enabled
    Chart->>NetworkPolicy: render ingressFrom
    alt ingressFrom contains peers
        NetworkPolicy-->>Helm: NetworkPolicy with configured peers
    else ingressFrom is empty
        NetworkPolicy-->>Helm: rendering error: ingressFrom must list at least one NetworkPolicy peer
    end
Loading

File-Level Changes

Change Details Files
Remove the chart’s ingress-nginx-specific NetworkPolicy default while preserving safe rendering behavior when the policy is enabled.
  • Set ingressFrom to an empty list by default and retain the template-level non-empty-peer validation.
  • Allow the empty list in the chart schema while documenting and testing the intentional divergence from the library schema.
  • Update chart tests for no defaults, explicit peers, rendering failures, and schema synchronization.
deployment/values.yaml
deployment/values.schema.json
tests/test_chart.py
Revise deployment guidance to support controller-agnostic Ingress and Gateway API deployments.
  • Reframe ingress-nginx annotations as optional examples and identify ingress-nginx as retired.
  • Add Gateway API guidance using a user-managed HTTPRoute targeting Service port 8080 and restricting paths to the registry API.
  • Provide NetworkPolicy peer examples for ingress-nginx, Traefik, Envoy Gateway, and OpenShift.
  • Document controller-specific keep-alive behavior and configuration considerations.
deployment/README.md
Align operational and release documentation with the removal of controller-specific defaults.
  • Update keep-alive guidance in configuration and values documentation for multiple controllers.
  • Remove the ingress-nginx NetworkPolicy default from upgrade instructions and release notes.
  • Record the changed NetworkPolicy behavior in the 0.3.0 release documentation.
docs/configuration.md
docs/upgrading.md
docs/releases/0.3.0.md

Assessment against linked issues

Issue Objective Addressed Explanation
#196 Remove the ingress-nginx NetworkPolicy peer as a default, require deployments to provide peers when enabling the policy, and document examples for different controllers or Gateway implementations. ✅
#196 Make ingress annotations examples rather than controller-specific chart defaults, and link the chart documentation to FOCA's Gateway API and Ingress guides. ❌ The PR documents controller annotations as examples and describes Gateway API use, but it explicitly leaves the FOCA guide links for #179. It also acknowledges that the foca-common Ingress template still sets an ingress-nginx request-body-size annotation, so that controller-specific behavior remains a chart default.
#196 Add or update tests to cover the new defaults and the behavior when the app NetworkPolicy is enabled without peers. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@uniqueg
uniqueg marked this pull request as ready for review October 23, 2026 12:40
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ba5ace9) to head (b05c0ec).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #199   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1136      1136           
=========================================
  Hits          1136      1136           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="deployment/README.md" line_range="223-224" />
<code_context>
+
+The Gateway API is the successor of the Ingress API. This version of the
+chart creates no HTTPRoute: disable the Ingress (`enabled: false`; on
+clusters without Routes, the chart then creates none) and attach an HTTPRoute
+of your own to the Gateway, next to the release, with the app's Service as
+its backend (`backendRefs`, port `8080`); to keep the permissions API off the
+internet, match only the path prefix `/ga4gh/registry/v1/`.
</code_context>
<issue_to_address>
**Admin API remains exposed**

When the Gateway API guidance is followed on an OpenShift cluster serving `route.openshift.io/v1`, disabling Ingress still makes the chart create an OpenShift Route for all paths, so requests bypass the user-created HTTPRoute's path match and expose `/admin/` through that Route.

Update the chart or guidance so the OpenShift Route cannot expose paths outside the intended HTTPRoute match.

Also at `deployment/README.md:227`.
</issue_to_address>

### Comment 2
<location path="deployment/values.yaml" line_range="109" />
<code_context>
+    # proxies (see deployment/README.md, Network policies, for examples).
+    # None by default, as they depend on the cluster; rendering fails if the
+    # policy is enabled without any (which would allow all sources)
+    ingressFrom: []
   # Security contexts of the pod and the container; the image runs as user
   # 1000, and with a read-only root file system, temporary files go to an
</code_context>
<issue_to_address>
**Old controller peer survives upgrades**

When an existing release that used the old default is upgraded with `--reuse-values`, then the policy is enabled or the ingress controller is changed without explicitly replacing `ingressFrom`, helm carries the previous chart’s effective values into the upgrade, so the old `ingress-nginx` peer remains in `cloudRegistry.networkPolicy.ingressFrom`; enabling the policy or switching to another controller without replacing that value leaves the app unreachable through the new controller.

Document that upgrades using `--reuse-values` must explicitly set `cloudRegistry.networkPolicy.ingressFrom` to the intended peers, or use `--reset-values` and reapply the deployment values file.
</issue_to_address>

### Comment 3
<location path="deployment/README.md" line_range="412" />
<code_context>
+      # the Gateway `gateway` in the namespace `gateway-system`
+      # - namespaceSelector:
+      #     matchLabels:
+      #       kubernetes.io/metadata.name: envoy-gateway-system
+      #   podSelector:
+      #     matchLabels:
</code_context>
<issue_to_address>
**Envoy Gateway peers select wrong namespace**

When a deployment uses Envoy Gateway's default proxy deployment and copies this NetworkPolicy example, in Envoy Gateway's default deployment mode, the proxy pods are deployed in the Gateway's namespace, `gateway-system`, not the control-plane namespace `envoy-gateway-system`. The namespace selector therefore excludes the Gateway's proxies, so enabling the app NetworkPolicy with this example blocks requests through the Gateway.

Set the namespace selector to the namespace where the default proxy deployment places the Gateway's proxies, or qualify the example for a deployment that actually places them in `envoy-gateway-system`.
</issue_to_address>

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: deployment/README.md:224, deployment/values.yaml:109, deployment/README.md:412


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread deployment/README.md Resolved
Comment thread deployment/values.yaml Resolved
Comment thread deployment/README.md Resolved
On OpenShift, the chart creates a Route for all paths without an
Ingress, also when an HTTPRoute is used, so say to block /admin/ in
front of the router there. Say where Envoy Gateway runs the proxies in
the default mode and what to select in the Gateway namespace mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit a5cfba7 into dev Oct 23, 2026
17 checks passed
@uniqueg
uniqueg deleted the fix/chart-neutral-ingress branch October 23, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(chart): drop the ingress-nginx defaults

1 participant