Skip to content

Commit b366286

Browse files
fix(ingress-nginx): drop the admission-webhook policy a rebase brought back (#5088)
## What this PR does Rebase behind [#3931](#3931) brought back namespaced `CiliumNetworkPolicy` for admission webhook, which [#3997](#3997) deleted in favour of clusterwide policy. It renders only on `admissionWebhookPolicy.enabled` (true by default) and never checks that Cilium API exists, so on cluster without Cilium every tenant with `ingress: true` fails to install with `no matches for kind "CiliumNetworkPolicy"`. On cluster with Cilium it repeats deny that clusterwide policy already has, and also renders for child tenants where webhook is disabled. This PR removes the template with its test and adds suite that renders whole package without Cilium API and fails if any Cilium resource comes out. Existing capability suite selects only clusterwide template, so it could not catch this file coming back. Clusterwide policy and `admissionWebhookPolicy` value are unchanged. Fixes #4706 On cluster without Cilium nothing in this chart restricts webhook port. Removed policy could not do it either because it needs Cilium CRD to install at all, and clusterwide policy already renders only where Cilium API is served, so no protection is lost, such cluster now just installs ingress instead of failing. Only `tenant-root` runs webhook, child tenants set `admissionWebhooks.enabled: false`. Restricting webhook port on non-Cilium clusters is separate design question, not part of this PR. Checked `helm template` with and without `cilium.io/v2/CiliumClusterwideNetworkPolicy` in api versions: without it no Cilium object renders, with it only clusterwide policy, same as before. New suite fails on tree before this change. ### Screenshots Not a UI change. ### Downstream repositories Only template and tests under `packages/system/ingress-nginx` changed, `admissionWebhookPolicy` value kept, nothing from trigger map in `docs/agents/contributing.md` matches. - [x] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: ### Release note ```release-note fix(ingress-nginx): remove the namespaced admission-webhook CiliumNetworkPolicy that was re-added by mistake. It was rendered without checking that the Cilium API exists, so on clusters without Cilium every tenant ingress failed to install with `no matches for kind "CiliumNetworkPolicy"`. The clusterwide admission-webhook policy is unchanged and still renders only where the Cilium API is served. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Configuration** * The ingress-nginx chart no longer generates an admission webhook network policy. Deployments that relied on this policy to restrict access to the webhook will need to configure equivalent traffic controls separately. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 372c855 + 8c1d2db commit b366286

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)