Repository navigation
feat(apisix): provide opt-in APISIX network policy rules - #1044
NiuBlibing wants to merge 2 commits into
Conversation
|
Recommended merge order to reduce overlapping changes while keeping each PR single-topic: #1039 → #1040 → #1041 → #1042 → #1043 → #1044 → #1045 → #1046 → #1047 The PRs are intentionally all based on |
|
Updated recommended merge order after separating Admin API access policy from Ingress wiring: #1039 → #1040 → #1041 → #1042 → #1043 → #1048 → #1044 → #1045 → #1046 → #1047 Each PR remains based on |
membphis
left a comment
There was a problem hiding this comment.
Reviewed at 0dfd2927d1ccebe46d1a46de9ee394ace817d6fa against baseline acd25584395d905511b68a20420bddf2bbd71a80.
[P1] Allow the controller's required egress before enabling isolation by default
With ingress-controller.enabled=true and a NetworkPolicy-enforcing CNI, networkpolicy-ingress-controller.yaml enables egress isolation but the default egress.to: [] leaves only the DNS rule. The controller can resolve names, but it cannot connect to the Kubernetes API server or APISIX Admin API, so reconciliation stops working.
Please either keep egress isolation opt-in or provide a working default that allows those required connections. This also needs a controller reconciliation test with policy enforcement; rendering alone cannot demonstrate connectivity. See the Kubernetes NetworkPolicy egress semantics.
[P1] Account for configured listener ports and protocols
The APISIX ingress policy is enabled by default and allows only a fixed list of TCP ports. It does not follow service.http.containerPort, additional HTTP/TLS listeners, PROXY protocol listeners, or the TCP/UDP ports configured under service.stream. For example, an existing UDP stream listener remains exposed by its Service but is denied by the new policy.
Please derive allowed ports and protocols from the enabled listeners, or make policy creation opt-in to preserve existing installations. Add coverage for a customized HTTP port, additional listeners, and both TCP and UDP stream traffic. The upgrade impact of enabling these policies by default should also be documented.
0dfd292 to
08f6d35
Compare
45a07bd to
b897c48
Compare
Scope
Add an opt-in APISIX NetworkPolicy with independent ingress and egress switches. Each direction accepts complete Kubernetes NetworkPolicy rules, so custom TCP/UDP/metrics/stream/QUIC ports and actual DNS, API and upstream destinations can be expressed without unsafe fixed defaults.
The values and documentation live beside the APISIX settings to keep this topic isolated from the bundled etcd and ingress-controller policies, which are separate PRs (#1055 and #1056). The chart does not claim CNI runtime enforcement from rendering alone.
Validation
uv run --with PyYAML python test/render/network_apisix.pypassed with UDP ports, namespace selectors, empty deny rules, duplicate-key checks and resource identity checks.