Repository navigation
fix(chart): drop the ingress-nginx defaults - #199
Conversation
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe 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 renderingsequenceDiagram
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
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
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]>
Summary
The chart no longer has defaults for one particular (retired) ingress controller. It keeps foca-common 0.1.0 until #179.
cloudRegistry.networkPolicy.ingressFromnow defaults to[]instead of the namespaceingress-nginx. The policy stays disabled by default.deployment/values.schema.json(the library'sapp-values.schema.jsonwith documented changes) allows the empty list:minItemsis dropped and the description no longer names a default. Both are noted in its$commentand checked intest_schema_of_library.deployment/README.md:httpRoute: disable the Ingress and attach an HTTPRoute of your own to the Service on port 8080, matching only/ga4gh/registry/v1/.values.yamlanddocs/configuration.mdkeep-alive notes;docs/upgrading.mdstep 4 and the 0.3.0 release notes no longer state an ingress-nginx default.[]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.httpRouteand its tests;chart-v0.2.0(the README may only link FOCA at the chart's library tag,chart-v0.1.0, which predates the guides);ingressFromdefault when copying the 0.2.0 schema.Verification
pytestwith coverage (mongomock, helm 3.22.1 from the CI version for the chart tests): 1181 passed, 100%.pre-commit run --all-filespassed.helm lint deployment --strict -f deployment/ci/test-values.yamlpassed.mkdocs build --strictpassed.python scripts/release_notes.py check docs/releases/0.3.0.mdpasses.backendRefstake numbers), keep-alive notes, and the schema test.Declined review findings
keepalivedefault (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.gunicorn.keepalivedescription, 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.$commentwording "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.--reuse-valuesupgrades 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.nginx.ingress.kubernetes.io/proxy-body-sizeon 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)
ingressFrom). FOCA could drop that default too, so that CR needs no schema change in build: require FOCA 0.17.0 and foca-common 0.2.0 #179. This does not block this PR.Closes #196
🤖 Generated with Claude Code