Skip to content

Commit cf00b41

Browse files
fix(ingress-nginx): drop the admission-webhook policy a rebase brought back
A rebase re-applied the namespaced CiliumNetworkPolicy that the move to source-side clusterwide policies had deleted, so two policies now guard the same webhook port and the older one is the worse of the two. It is gated only on admissionWebhookPolicy.enabled, which defaults to true, and never checks that the Cilium API exists. On a cluster without Cilium every tenant ingress release therefore fails to install with `no matches for kind "CiliumNetworkPolicy"`. On a Cilium cluster it repeats the target-side deny the clusterwide policy already carries. It also renders for child tenants, whose controller runs with the admission webhook disabled and for which the clusterwide policy renders nothing, so there it denies a port nothing listens on and is the only thing that puts a cluster-spanning peer onto the controller endpoints. That peer is enumerated per pod identity, the coupling to namespace churn the clusterwide policy was written to contain. The clusterwide policy and the admissionWebhookPolicy value it reads are left as they are. The existing capability suite selects only the clusterwide template, so it could not have noticed this file coming back; a suite with no template filter now fails if any Cilium kind renders while the Cilium API is absent. Assisted-by: LLM Signed-off-by: Myasnikov Daniil <[email protected]> (cherry picked from commit 8c1d2db)
1 parent 70e61ae commit cf00b41

3 files changed

Lines changed: 29 additions & 214 deletions

File tree

‎packages/system/ingress-nginx/templates/admission-webhook-networkpolicy.yaml‎

Lines changed: 0 additions & 97 deletions
This file was deleted.

‎packages/system/ingress-nginx/tests/admission_webhook_networkpolicy_test.yaml‎

Lines changed: 0 additions & 117 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
suite: ingress-nginx renders no Cilium resource without the Cilium API
2+
release:
3+
name: ingress-nginx
4+
namespace: cozy-ingress-nginx
5+
# No templates: filter on purpose. The capability suite next to this one selects
6+
# only the clusterwide policy template, so a Cilium resource added in any other
7+
# template would escape it, and the ingress application is installed on clusters
8+
# that serve no Cilium API at all.
9+
capabilities:
10+
apiVersions: []
11+
tests:
12+
- it: emits no CiliumNetworkPolicy
13+
asserts:
14+
- hasDocuments:
15+
count: 0
16+
documentSelector:
17+
path: kind
18+
value: CiliumNetworkPolicy
19+
matchMany: true
20+
skipEmptyTemplates: true
21+
- it: emits no CiliumClusterwideNetworkPolicy
22+
asserts:
23+
- hasDocuments:
24+
count: 0
25+
documentSelector:
26+
path: kind
27+
value: CiliumClusterwideNetworkPolicy
28+
matchMany: true
29+
skipEmptyTemplates: true

0 commit comments

Comments
 (0)