CFP-44138: Cilium Clusterwide Local Redirect Policy #106
GROQ_API_KEY / GROQ_API_KEY_backup in .env
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
Self review:
the resolved frontend address and port@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
+
+The CCLRP CRD will only be promoted to the `cilium.io/v2` API version once it is stable and migration-ready, at which point the existing CLRP CRD will be marked as deprecated.
+
+It is expected that both promotion and deprecation will be implemented in the same Cilium minor release. CCLRP and CLRP can continue to co-exist for several additional minor releases, providing sufficient time for administrators to migrate to the new resource.
+
+It is expected that CLRP will be removed in a future Cilium minor release; this scheduling is outside the scope of this document.
+
+### Migration approach
+
+There will be no automatic object conversion from CLRP to CCLRP.
+
+Administrators will need to translate an existing CLRP into a CCLRP and explicitly add any namespace restriction that was previously implied by the namespaced resource. For example, a backend selector that was previously limited to `kube-system` must include `io.kubernetes.pod.namespace: kube-system` in the CCLRP selector.
+
+It is reasonable to expect the intent of a CLRP, re-declared via CCLRP, to reconcile to the same final state (subject to any behavioural differences such as loop prevention).
+
+CLRP and CCLRP resources will be able to co-exist to facilitate migration. The initial proposal gives CCLRP precedence when both resource types attempt to claim the same concrete frontend. This avoids depending on creation order, allowing a CCLRP to override the effective behaviour of an existing CLRP. Reconciled forwarding state, previously derived from the CLRP, is expected to transition to the CCLRP.
+
+Administrators will need to verify the CCLRP operation before deciding whether to proceed by removing the legacy CLRP, or roll back by deleting the CCLRP.
+
+Migration documentation will provide a mechanical conversion checklist and explain how to roll out a CCLRP before removing its corresponding CLRP. The expected behaviour will be documented, surfaced through diagnostics, and covered by upgrade and migration tests.
+
+## Impacts / Key Questions
+
+### Impact: cluster-wide permissions and blast radius
+
+CCLRP is intentionally cluster-scoped. Creating or modifying one requires cluster-level authorisation, and the resulting redirect can affect traffic from workloads in any namespace. This is a larger authorisation boundary than the current resource presents, but it accurately reflects the effect of the feature.
+
+The documentation and RBAC examples must make this explicit. Namespace-specific ownership or delegation is outside the initial proposal.
+
+### Key Question: how should backend namespace scope be expressed?
+
+The examples above make use of the `io.kubernetes.pod.namespace` label in `localEndpointSelector` to align with the selector conventions of `CiliumClusterwideNetworkPolicy`. However, this creates a safety foot gun for local redirects: omitting that label broadens the selector to pods in every namespace, which can cause unintended pods to become redirect backends.
+
+This is a more serious failure mode than an overly broad policy selector because the selected pods change the load-balancer destination for matching traffic. The API should make namespace scope explicit and should not silently default to all namespaces as a consequence of a missing label.
Self review: the question shouldn't state functional requirement. It should be moved below into the option as a 'could'.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
Thanks for adding the historical context. My understanding is as follows:
skipRedirectFromBackend. Its commits acknowledge that loop prevention had previously been enforced by default, but do not explain why the default behavior was changed or identify a use case requiring skipRedirectFromBackend=false.
My inference is that making the new mechanism opt-in may have been motivated by its implementation constraints, rather than by a requirement to support both behaviors. It introduced a kernel requirement and additional BPF map management. The implementation review also noted that only a small number of map entries was expected, and the maps were initialized only when a policy requested the feature. This is only an inference, since the rationale was not documented explicitly.
Given this history, I do not see evidence of a use case that requires skipRedirectFromBackend=false. Therefore, making loop prevention the default and only behavior for CCLRP appears reasonable. I think the CFP should state this conclusion and its rationale directly, instead of saying that the safety of the change is not guaranteed.
However, the resource consumption of the skip maps should still be evaluated. The current IPv4 and IPv6 skip maps each have a maximum of 100 entries. Entries are keyed by the backend network namespace and frontend address/port. Could the CFP evaluate the expected skip-map usage for the intended CCLRP use cases and whether the current maximum of 100 entries needs to be revisited?
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
I think zero-downtime migration from CLRP to CCLRP should be an explicit goal of this CFP. This is necessary to support migration in large clusters that already depend on CLRP. For example, when CLRP is used for NodeLocal DNS, even temporarily withdrawing the local redirect may cause DNS traffic from all workloads on the affected nodes to fall back to the central kube-dns Service. The resulting sudden increase in traffic could overload kube-dns and cause a cluster-wide DNS outage.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
+
+The CCLRP CRD will only be promoted to the `cilium.io/v2` API version once it is stable and migration-ready, at which point the existing CLRP CRD will be marked as deprecated.
+
+It is expected that both promotion and deprecation will be implemented in the same Cilium minor release. CCLRP and CLRP can continue to co-exist for several additional minor releases, providing sufficient time for administrators to migrate to the new resource.
+
+It is expected that CLRP will be removed in a future Cilium minor release; this scheduling is outside the scope of this document.
+
+### Migration approach
Could you describe both the concrete migration procedure and the implementation approach supporting it? In particular, I would like to understand how the existing StateDB Service, Frontend, and Backend model represents CLRP and CCLRP during coexistence, and how ownership of a frontend is transferred without temporarily withdrawing the redirect.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
Could you propose a concrete migration schedule, including the target releases for introducing CCLRP as v2alpha1, promoting it to v2 and deprecating CLRP, and eventually removing CLRP?
Thank you for the CFP! I like the new CCLRP API. I've left a few comments.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
I will improve the detail in the history then; most CFPs don't seem to go this far, though, so hence I kept it quite light. I had assumed the detail in the linked issue/PRs was sufficient.
I also agree the skip maps sizing should probably be assessed, but I wonder if that is just an implementation task rather than a design decision? The design of the mechanism exists today, and I don't believe it to be in question, beyond removing the API-level exposure to the administrator.
Now you bring it up, two things though:
1. I wonder if the sizing is documented properly. It's a constraint that should probably be visible.
2. I wonder if that should be runtime sizeable. What do you think?
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
Yes, sorry, I missed explicitly calling it out as a goal. Good spot!
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
+
+The CCLRP CRD will only be promoted to the `cilium.io/v2` API version once it is stable and migration-ready, at which point the existing CLRP CRD will be marked as deprecated.
+
+It is expected that both promotion and deprecation will be implemented in the same Cilium minor release. CCLRP and CLRP can continue to co-exist for several additional minor releases, providing sufficient time for administrators to migrate to the new resource.
+
+It is expected that CLRP will be removed in a future Cilium minor release; this scheduling is outside the scope of this document.
+
+### Migration approach
I can expand on that, yes, but to do so would obviously re-introduce the data model into the CFP again. I actually took that out in an effort to get to a good first CFP within our time constraints.
As-is, there's a 1:N relationship between the CLRP and the number of possible frontends it has to reconcile against. At first glance this makes it somewhat difficult to store the reconciliation status between CLRP and said frontends. It's my view the status field in the frontends table should only reflect status in respect to the BPF reconciler.
In my prototype I did explore introducing a new mapping table, which sat between the reflected LRP state from Kubernetes and the load balancer control plane state. This introduces a nice place to store LRP/frontend-specific status, but caused some duplication, so I parked it.
The reason I mention this is that it also facilitated alignment between the existing CLRP and CCLRP mappings. It provided a simple mechanism by which to enlighten the existing CLRP controller for overlap with CCLRP, allowing the CLRP controller to "stand down" and yield to CCLRP.
I will have a think on another approach here that can be documented in the CFP.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
[deleted]
I have deleted this comment because, having done a better search, there are examples of this in other CFPs. I will propose something - apologies!
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
I think reassessing the skip map sizing belongs in this CFP because the proposal expands the use of the mechanism from CLRPs that explicitly opt in to every active CCLRP. The current limit of 100 might be introduced when loop prevention was opt-in and only a small number of entries was expected.
I think we should first estimate how much additional skip-map capacity will be required when all CCLRPs use the equivalent of skipRedirectFromBackend=true on capable kernels, and compare that with the current limit of 100 entries. Based on that estimate, we can evaluate whether to increase the default size or make it configurable. Since changing the size of an existing pinned BPF map may require recreating or migrating it, the upgrade path should also be considered to avoid a period in which redirects are active but the required skip map entries are missing.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
I've added some more context to this, I hope it aligns with what you were thinking.
Interestingly, I've noticed that the skip LB map is actually protocol agnostic. I wonder if this is just a left-over from before Cilium introduced protocol differentiation.
I've expanded on the skip map implementation, and introduced an additional question as to whether this should be addressed.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
I've introduced the additional goal.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
+
+The CCLRP CRD will only be promoted to the `cilium.io/v2` API version once it is stable and migration-ready, at which point the existing CLRP CRD will be marked as deprecated.
+
+It is expected that both promotion and deprecation will be implemented in the same Cilium minor release. CCLRP and CLRP can continue to co-exist for several additional minor releases, providing sufficient time for administrators to migrate to the new resource.
+
+It is expected that CLRP will be removed in a future Cilium minor release; this scheduling is outside the scope of this document.
+
+### Migration approach
I've not had chance to introduce anything more concrete here. Unfortunately my schedule for this week changed last minute and I lost 2-3 days. I will have to introduce this in another follow-up.
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a service reference that cannot be resolved
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+The precise status representation is an implementation detail for the initial release, but validation and reconciliation failures must be visible through agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback. A full status API is a possible follow-up milestone.
+
+### Observability
+
+The existing local redirect debugging commands should be extended to identify:
+
+* whether an entry came from CLRP or CCLRP;
+* the policy that owns the entry;
+* the resolved frontend address and port;
+* the selected node-local backends;
+* validation or reconciliation errors.
+
+This is required to make cluster-wide redirects diagnosable during the coexistence period.
+
+### Examples
+
+#### Link-local address redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: cloud-metadata-redirect
+spec:
+ addressMatcher:
+ ip: 169.254.169.254
+ localEndpointSelector:
+ matchLabels:
+ app: metadata
+ io.kubernetes.pod.namespace: cloud-infra
+ ports:
+ - port: 80
+ targetPort: 8080
+ protocol: TCP
+ - port: 443
+ targetPort: 8443
+ protocol: TCP
+```
+
+This redirects traffic to the link-local metadata address to a node-local backend selected from the `cloud-infra` namespace.
+
+#### Node-local DNS redirect
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: node-local-dns-redirect
+spec:
+ serviceMatcher:
+ namespace: kube-system
+ service: kube-dns
+ localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+ ports:
+ - port: 53
+ targetPort: 53
+ protocol: UDP
+ - port: 53
+ targetPort: 53
+ protocol: TCP
+```
+
+This redirects both DNS protocols for the cluster DNS Service to the node-local DNS backend.
+
+#### Comparison with CiliumLocalRedirectPolicy
+
+When comparing the above CCLRP examples with the existing CLRP facility:
+
+* The cluster-wide impact of this redirect is explicit in both resource type and lack of namespace in the resource metadata.
+* The frontend-to-backend port mapping is explicitly declared in one place.
+* Differing behaviour based on port list declaration is broadly removed.
+* Ordering constraints across multiple port lists is no longer a concern.
+* Unnecessary nesting of fields within the API is minimised.
+
+### Implementation approach
+
+The implementation will add the CCLRP CRD, permissions, and agent reconciliation required to translate policy intent into the existing load-balancer frontend and backend state.
+
+The implementation should keep the following boundaries clear:
+
+1. The Kubernetes-facing layer validates and reflects CCLRP intent.
+2. A reconciliation layer resolves Services, ports, and node-local backend endpoints.
+3. The existing load-balancer integration applies concrete local redirect entries.
+
+The internal tables, Go structures, and controller decomposition may evolve during implementation. They should not become additional user-facing API commitments in this CFP.
+
+A prototype implementation will be used to validate the API and reconciliation behaviour with tests covering address matching, Service matching, namespace-restricted selectors, explicit port translation, invalid configuration, backend churn, nodes without local backends preserving the original frontend behaviour, and kernel capability handling.
+
+The initial CRD will be implemented with the `cilium.io/v2alpha1` API version. During the alpha phase, CLRP will remain supported but feature-frozen, except for critical fixes and changes required to enable migration to CCLRP.
I've introduced a bit of a better schedule as requested.
I've suggested that foundational work may land in 1.21 just because it looks like it's half way through the development cycle. Assuming a feature freeze at the end of the year doesn't give much time to get everything implemented. I've therefore put forward that the actual functionality and API should land in 1.22 in its alpha form.
Assuming we get to a better maturity and mark CCLRP as stable (as well as CLRP deprecated) in 1.23, I'd propose removal of CLRP in 1.25. That gives administrators two releases within which they can test and migrate. I'd hope this gives us some contingency for any unexpected consequences before full removal of CLRP.
Hi @borkmann @joamaki could you take a look at this CFP and share your feedback when you have a chance?
@@ -0,0 +1,504 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** TBD
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, it is believed issues have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource should be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP should restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case \- node-local or host-provided services such as a metadata endpoint \- without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in 3 key touch points.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `port[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and cases where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP should express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names should not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes an implementation detail of the socket load balancer and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention should be an agent-level behaviour, enabled when the required kernel capability is available and reported when it is not.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key questions below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+CCLRP does not expose `skipRedirectFromBackend` within the API.
+
+Instead, the agent should determine whether the host kernel supports the mechanism required to identify backend-originated traffic at runtime, and enable it for all CCLRPs if available. Otherwise, the agent should log a warning to report that loop prevention is not available.
+
+*Note: `skipRedirectFromBackend` field will still remain opt-in for CLRP.*
+
+The safety of this change is not guaranteed. The original implementation of CLRP was augmented with loop prevention via socket lookups (`bpf_sk_lookup_*` helpers) in October 2020. This appears to have suffered from incorrect behaviour under certain scenarios and was replaced with the current skip-map implementation in April 2024.
+
+At the time of the original augmentation, queries were raised about any known use cases that may require a request from an LRP backend to be sent back to that same backend. The original contributor confirmed there were no known use cases.
+
+At the time of writing, when reviewing this feature within the context of the aforementioned use cases above, it is believed there are still no known use cases that would require a request from an LRP backend to be sent back to that same backend.
+
+Original socket lookup implementation: [https://github.com/cilium/cilium/pull/13287](https://github.com/cilium/cilium/pull/13287)
+Revised "skip-map" implementation: [https://github.com/cilium/cilium/pull/26144](https://github.com/cilium/cilium/pull/26144)
It's clear now. Thanks!
Interestingly, I've noticed that the skip LB map is actually protocol agnostic. I wonder if this is just a left-over from before Cilium introduced protocol differentiation.
This may indeed have been overlooked when protocol differentiation was introduced.
@@ -0,0 +1,645 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** 1.22
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, these issues are believed to have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource will be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP will restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case—node-local or host-provided services such as a metadata endpoint—without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in three key touchpoints.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `ports[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and configurations where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP will express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names will not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes a datapath implementation detail and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention will be mandatory for CCLRP and implemented as an agent-level behaviour. During the alpha phase, an agent without the required kernel capability will report an error and leave CCLRP unavailable without preventing existing CLRP use. Once CLRP is removed, the capability will be required whenever local redirects are enabled.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+* Preserve an active local redirect while a CCLRP takes over a frontend from a CLRP to facilitate zero-downtime migration.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath beyond any skip map changes selected by this CFP.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key question below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
+ app: node-local-dns
+ io.kubernetes.pod.namespace: kube-system
+```
+
+The policy must not redirect traffic to a backend pod on another node. If no eligible local backend exists on a node, Cilium must not install a local redirect entry on that node. Traffic should be processed as if the policy were absent; it must not be redirected to a remote backend or blackholed. This preserves the existing fail-open behaviour introduced by [PR #41463](https://github.com/cilium/cilium/pull/41463).
+
+### Port mapping
+
+Each entry in `ports` represents one frontend-to-backend mapping:
+
+| Field | Meaning | Required |
+| :---- | :---- | :---- |
+| `port` | Destination port on the matched frontend | Yes |
+| `targetPort` | Port on the selected local backend pod | Yes |
+| `protocol` | Transport protocol used by both sides | No; defaults to `TCP` |
+| `name` | Optional descriptive port name | No; not used for matching |
+
+The frontend and backend port relationship is determined by the numeric `port` and `targetPort` fields. CCLRP must not require the two ports to have the same name, and it must not require a matching `containerPort` declaration solely to establish the mapping.
+
+For an `addressMatcher`, at least one `ports` entry is required because the `addressMatcher` alone does not identify a complete load-balancer frontend.
+
+For a `serviceMatcher`, `ports` is currently optional; the implications of inheriting the Service mapping when it is omitted are discussed below.
+
+### Loop prevention
+
+[PR #13287](https://github.com/cilium/cilium/pull/13287) introduced the original implementation of CLRP loop prevention to the datapath using socket lookups (`bpf_sk_lookup_*` helpers). The PR discussion noted that this depended on the relevant `sk_lookup` helpers being available, but did not expose a per-policy opt-out. Listening sockets that happened to match the destination port could cause translation to be skipped incorrectly, as reported in [issue #15195](https://github.com/cilium/cilium/issues/15195) and [issue #20164](https://github.com/cilium/cilium/issues/20164).
+
+[PR #26144](https://github.com/cilium/cilium/pull/26144) replaced the socket-lookup implementation with netns-cookie-based skip maps and introduced `skipRedirectFromBackend` into the CLRP as an opt-in field. The linked history does not document why that behaviour changed. One possible contributing reason is kernel compatibility: [`bpf_get_netns_cookie`](https://github.com/torvalds/linux/commit/f318903c0bf4) was introduced in Linux 5.7, while the userspace access through [`SO_NETNS_COOKIE`](https://github.com/torvalds/linux/commit/e8b9eab99232c4e62ada9d7976c80fd5e8118289) required by Cilium landed upstream in Linux 5.14 and was [backported to Linux 5.12.18](https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.12.18). The additional kernel-version requirement may have influenced the decision to make the revised behaviour opt-in, but this remains an inference rather than a documented rationale.
+
+During the review of [PR #13287](https://github.com/cilium/cilium/pull/13287), the possibility of redirecting traffic from a CLRP backend back to that same backend was considered, but no current use case was identified. The available history to date does not identify a subsequent use case.
+
+Based on the above history, CCLRP must always enable loop prevention and must not expose a per-policy opt-out.
+
+During the `v2alpha1` phase, the agent must check for `SO_NETNS_COOKIE` support at startup. If the capability is unavailable, the agent must log an actionable error and continue to start so that existing CLRP use is not disrupted. CCLRP reconciliation must fail on that node, no CCLRP redirect should be installed, and traffic must behave as if the CCLRP were absent.
+
+*Note: This CFP does not change CLRP: `skipRedirectFromBackend` remains opt-in and existing capability handling remains unchanged.*
+
+#### Existing CLRP skip map behaviour
+
+The existing netns-cookie implementation uses two BPF skip maps: one per address family. The existing maps and their key structures are provided below for reference. Only key presence matters; the stored map value is not interpreted.
+
+```
+// IPv4
+
+struct skip_lb4_key {
+ __u64 netns_cookie; /* Source pod netns cookie */
+ __u32 address; /* Destination service virtual IPv4 address */
+ __u16 port; /* Destination service virtual layer4 port */
+ __u16 pad;
+};
+
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __type(key, struct skip_lb4_key);
+ __type(value, __u8);
+ __uint(pinning, LIBBPF_PIN_BY_NAME);
+ __uint(max_entries, CILIUM_LB_SKIP_MAP_MAX_ENTRIES);
+ __uint(map_flags, BPF_F_NO_PREALLOC | BPF_F_RDONLY_PROG_COND);
+} cilium_skip_lb4 __section_maps_btf;
+
+// IPv6
+
+struct skip_lb6_key {
+ __u64 netns_cookie; /* Source pod netns cookie */
+ union v6addr address; /* Destination service virtual IPv6 address */
+ __u32 pad;
+ __u16 port; /* Destination service virtual layer4 port */
+ __u16 pad2;
+};
+
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __type(key, struct skip_lb6_key);
+ __type(value, __u8);
+ __uint(pinning, LIBBPF_PIN_BY_NAME);
+ __uint(max_entries, CILIUM_LB_SKIP_MAP_MAX_ENTRIES);
+ __uint(map_flags, BPF_F_NO_PREALLOC | BPF_F_RDONLY_PROG_COND);
+} cilium_skip_lb6 __section_maps_btf;
+```
+
+Only a CLRP with `skipRedirectFromBackend=true` creates skip map entries. The control plane adds entries for the selected backend pods and redirected frontends.
+
+When the datapath processes traffic from an endpoint, it looks up the source network namespace cookie and destination frontend in the skip map for that address family. This check is implemented in both the [socket LB](https://github.com/cilium/cilium/blob/v1.21.0-pre.2/bpf/bpf_sock.c#L365-L369) and [per-packet LB](https://github.com/cilium/cilium/blob/v1.21.0-pre.2/bpf/bpf_lxc.c#L250-L257) paths. If an entry exists, the datapath skips the redirect translation, preventing traffic from a backend pod from being redirected back to itself.
+
+The control plane reconciles a frontend as an `L3n4Addr`, but the skip map key contains only the backend network namespace cookie, frontend IP address, and frontend port. It does not contain the L4 protocol. Consequently, TCP and UDP frontends with the same IP address and port share skip map state.
+
+*Note: This proposal does not change the field or the existing protocol-neutral key semantics for CLRP.*
+
+#### CCLRP skip map behaviour
+
+CCLRP represents a frontend as an `L3n4Addr`, including the L4 protocol. Reusing the existing skip map unchanged would mean that TCP and UDP frontends with the same IP address and port continue to share skip map state. Whether the skip map should be extended to differentiate between L4 protocols is discussed as a key question below.
+
+To facilitate migration, a CCLRP should take precedence over a CLRP that claims the same concrete frontend. Only the effective policy should contribute skip map entries for the overlap. If the CCLRP is removed, the CLRP should become effective and its entries should be reconciled again.
+
+#### Skip map capacity
+
+The existing IPv4 and IPv6 skip maps are sized independently, and each is currently limited to [100 entries](https://github.com/cilium/cilium/blob/v1.21.0-pre.2/pkg/loadbalancer/maps/types.go#L1267-L1276). Existing CLRP entries count towards this limit; CCLRP entries would count towards the same limit.
+
+The following illustrative projection assumes one backend pod per use case and that the resulting keys do not overlap. It uses the current protocol-neutral key and applies per node and per address family.
+
+* `NF` is the number of distinct redirected frontend `L3n4Addr` tuples.
+* `NK` is the number of distinct frontend keys produced for the skip map.
+ * The current key uses `(IP, port)`
+ * A protocol-differentiated key would use `(IP, port, protocol)`.
+* `NB` is the number of distinct backend network namespaces.
+* The number of skip map entries is `NK × NB`.
+
+| Use case | Redirected frontends | `NF` | `NK` | `NB` | Current skip map entries (`NK × NB`) |
+| :--- | :--- | ---: | ---: | ---: | ---: |
+| Cloud-managed service | `169.254.169.254:80/TCP`, `169.254.169.254:443/TCP` | 2 | 2 | 1 | 2 |
+| Node-local DNS | `<DNS-IP>:53/TCP`, `<DNS-IP>:53/UDP` | 2 | 1 | 1 | 1 |
+| **Total** | | | | | **3** |
+
+If CCLRP retains the current protocol-neutral key, equivalent CLRPs and CCLRPs selecting the same frontends and backend network namespaces should require the same skip map capacity. If protocol differentiation is selected, `NK` becomes equal to `NF` and the projected usage increases from 3 to 4 IPv4 entries per node. Both projections remain small relative to the current limit of 100. The initial implementation should therefore retain the existing limit, subject to prototype validation of the expected usage for supported deployment shapes. If a supported configuration can exceed the limit, the map size or configurability must be revisited before release.
+
+Frontend and skip map state are reconciled by separate reconciliation loops and may be programmed at different times. This proposal does not change that model or introduce activation ordering between them. Failure to install a required CCLRP skip map entry, including because the map is full, must be reported by the skip map reconciler.
+
+### Validation and conflicts
+
+The CCLRP controller should reject a policy that has:
+
+* neither or both of `addressMatcher` and `serviceMatcher`
+* an address outside the link-local ranges
+* an invalid port, protocol, or port mapping
+* a `serviceMatcher` that resolves to an unsupported Service
+* a selector or mapping that cannot produce a valid local redirect frontend
+
+If the referenced Service does not currently exist or cannot yet be resolved, the policy should remain inactive and report an observable reconciliation condition until the dependency becomes available.
+
+Policies that attempt to claim the same concrete frontend must have deterministic behaviour. The initial implementation should allow only one active owner for a frontend within the same policy type and should report conflicts as errors.
+
+CCLRP should take precedence over CLRP when both resources identify the same frontend, so that an explicitly migrated CCLRP is not shadowed by the legacy policy while both resources coexist.
+
+Validation and reconciliation failures must be visible through CCLRP status, agent diagnostics, logs, and events or equivalent Kubernetes-facing feedback.
We probably want nodes to only write to CCLRP status on failure? Would make sense to think through the 10k cluster case and implementing this in a way that a faulty CCLRP doesn't release a thundering hurd onto CCLRP.Status.
@@ -0,0 +1,645 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** 1.22
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, these issues are believed to have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource will be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP will restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case—node-local or host-provided services such as a metadata endpoint—without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in three key touchpoints.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `ports[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and configurations where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP will express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names will not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes a datapath implementation detail and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention will be mandatory for CCLRP and implemented as an agent-level behaviour. During the alpha phase, an agent without the required kernel capability will report an error and leave CCLRP unavailable without preventing existing CLRP use. Once CLRP is removed, the capability will be required whenever local redirects are enabled.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+* Preserve an active local redirect while a CCLRP takes over a frontend from a CLRP to facilitate zero-downtime migration.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath beyond any skip map changes selected by this CFP.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key question below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
Would it ever make sense to have multiple endpoint selectors?
e.g. something like this:
localEndpointSelectors:
- matchLabels:
app: foo
io.kubernetes.pod.namespace: foo
- matchLabels:
app: bar
io.kubernetes.pod.namespace: bar
We could also consider explicit namespace but supporting multiple selectors to allow selecting backends from multiple namespaces:
localEndpointSelectors:
- namespace: foo
matchLabels:
app: quux
- namespace: bar
matchLabels:
app: quux
Approved these changes.
Thanks for the updates! LGTM, assuming that the concrete migration procedure and implementation approach will be documented in a follow-up.
@@ -0,0 +1,645 @@
+# CFP-44138: Cilium Clusterwide Local Redirect Policy
+
+**SIG:** SIG-LB
+
+**Begin Design Discussion:** 2026-02-03
+
+**Cilium Release:** 1.22
+
+**Authors:** Yusuke Suzuki, Alasdair McWilliam
+
+**Status:** Draft
+
+**Issue:** [https://github.com/cilium/cilium/issues/44138](https://github.com/cilium/cilium/issues/44138)
+
+## Summary
+
+This CFP proposes a new cluster-scoped `CiliumClusterwideLocalRedirectPolicy` (CCLRP) custom resource for configuring local traffic redirection.
+
+CCLRP makes the cluster-wide effect of a local redirect explicit, restricts address-based redirects to link-local addresses, replaces implicit named-port joins with explicit port mappings, and removes datapath loop-prevention details from the policy API.
+
+The existing namespace-scoped `CiliumLocalRedirectPolicy` (CLRP) will remain available while CCLRP matures. Deprecation and eventual removal of CLRP are future milestones and are not required for the initial CCLRP release.
+
+## Motivation
+
+CLRP redirects traffic destined for a frontend to node-local backend pods.
+
+It is currently configured through a namespaced resource, even though the redirect affects traffic originating from workloads throughout the cluster.
+
+The current [API](https://docs.cilium.io/en/stable/network/kubernetes/local-redirect-policy/) also combines Kubernetes service references, arbitrary addresses, backend pod selection, and port matching rules with several implicit behaviours. These behaviours are difficult to reason about for the reasons that are discussed in the following sections.
+
+Overall, these issues are believed to have contributed to a fragile implementation that incurs an ongoing technical burden to the project. Recent examples include:
+
+* CiliumLocalRedirectPolicy: panic if redirectBackend.toPorts is defined but empty
+ * [https://github.com/cilium/cilium/issues/48482](https://github.com/cilium/cilium/issues/48482)
+* LRP shows invalid IP for NodeLocal DNS when applying the example manifest
+ * [https://github.com/cilium/cilium/issues/43944](https://github.com/cilium/cilium/issues/43944)
+* LRP backend is not selected when Pod container ports are not specified
+ * [https://github.com/cilium/cilium/issues/43929](https://github.com/cilium/cilium/issues/43929)
+* LRP does not use the right port number
+ * [https://github.com/cilium/cilium/issues/41589](https://github.com/cilium/cilium/issues/41589)
+* CiliumLocalRedirectPolicy doesn’t work with skipRedirectFromBackend
+ * [https://github.com/cilium/cilium/issues/40450](https://github.com/cilium/cilium/issues/40450)
+
+### Resource scope does not match traffic scope
+
+`CiliumLocalRedirectPolicy` is a namespaced resource and its Service and backend references are namespaced. However, the resulting redirect is not limited to traffic from that namespace. This makes it possible for a policy created in one namespace to change traffic from workloads in other namespaces without the resource scope making that impact obvious.
+
+The new resource will be cluster-scoped so that its scope is visible to administrators and so that cluster-wide use cases are represented by a cluster-wide object.
+
+### Address-based redirects are too broad by default
+
+An address-based CLRP can match an arbitrary IP address. Historically, this could include ClusterIPs and Pod IPs, allowing a misconfigured policy to interfere with unrelated services or workloads.
+
+Cilium provides an `addressMatchCIDRs` configuration option, but the safe scope is not part of the resource API and is not enforced by default.
+
+CCLRP will restrict address-based redirects to link-local address ranges. This preserves the primary address-based use case—node-local or host-provided services such as a metadata endpoint—without allowing a policy to override arbitrary in-cluster destinations.
+
+### Multi-port matching depends on implicit names
+
+The current API leans on port declarations in three key touchpoints.
+
+* CLRP `redirectFrontend.(addressMatcher|serviceMatcher).toPorts[]` provides a list of target frontend ports.
+* CLRP `redirectBackend.toPorts[]` provides a list of target backend ports.
+* Pod `ports[]` provides a list of ports a container is intended to listen on as informational metadata.
+
+The API may or may not use port names as a join key between these touch points depending on the CLRP declaration.
+
+When a **single** frontend port is specified:
+
+* Port names in the CLRP declaration are ignored.
+* The first entry in the frontend `toPorts[]` is mapped directly to the first entry in the backend `toPorts[]`.
+* Pod `ports[]` metadata is ignored.
+
+When **multiple** frontend ports are specified:
+
+* Port names in the CLRP declaration are mandatory.
+* The port name is used as a join key to map frontend `toPorts[]` to backend `toPorts[]`.
+* A corresponding named entry in the Pod `ports[]` list must also exist and match.
+
+When frontend ports are **omitted**:
+
+* An `addressMatcher` CLRP will not apply.
+* A `serviceMatcher` CLRP will redirect all service ports.
+
+Problems:
+
+* The numeric port mapping cannot be determined directly from the manifests.
+* The pod `ports[]` list is informational in Kubernetes, yet it affects CLRP backend selection.
+* Multi-port mapping does not work unless the pod has a matching `ports[]` entry, even if an application is listening on the expected port.
+* The port mapping logic differs between single-port and multi-port configurations, and configurations where `serviceMatcher.toPorts[]` is omitted.
+* There are special cases that depend on port list ordering. Incorrect ordering between frontend, backend and pod spec can lead to mapping failures.
+
+CCLRP will express the relationship directly as `port` to `targetPort`, following the general Kubernetes Service model. Port names will not be required to connect the frontend and backend sides of a redirect.
+
+### Loop prevention exposes datapath details
+
+The `skipRedirectFromBackend` field exposes a datapath implementation detail and requires users to make the same runtime decision independently for every policy. However, there is no known useful purpose for redirecting a backend's traffic back to itself.
+
+Loop prevention will be mandatory for CCLRP and implemented as an agent-level behaviour. During the alpha phase, an agent without the required kernel capability will report an error and leave CCLRP unavailable without preventing existing CLRP use. Once CLRP is removed, the capability will be required whenever local redirects are enabled.
+
+## Goals
+
+* Make the cluster-wide impact of local redirects explicit in the API.
+* Provide a safe default scope for address-based redirects.
+* Replace implicit port-name joins with explicit frontend-to-backend port mappings.
+* Remove datapath loop-prevention configuration from individual policies.
+* Reduce silent failure modes through validation and observable reconciliation errors.
+* Preserve the existing local redirect use cases, especially node-local DNS and host-provided link-local services.
+* Allow CCLRP and CLRP to coexist during adoption of the new resource.
+* Preserve an active local redirect while a CCLRP takes over a frontend from a CLRP to facilitate zero-downtime migration.
+
+## Non-Goals
+
+* Redesign the eBPF local redirect datapath beyond any skip map changes selected by this CFP.
+* Change the fundamental local redirect behaviour: traffic is still redirected only to node-local backend pods selected by the policy.
+* Provide an automatic conversion of existing CLRP objects into CCLRP objects.
+* Deprecate or remove CLRP as part of the initial CCLRP implementation.
+* Support arbitrary address ranges through CCLRP.
+* Generalise the API to express an arbitrary set of frontend types or routing behaviours.
+
+## Use Cases
+
+### Cloud-provider-managed service
+
+Cloud providers may expose infrastructure services to workloads through a well-known DNS name and link-local IP address. The service may be managed outside the tenant's Kubernetes namespace and may have a node-local implementation on each host.
+
+Workloads should be able to use the provider's normal endpoint while Cilium redirects traffic to the local implementation on the node.
+
+This use case is represented by an `addressMatcher` for the link-local address and a backend selector for the local service pods.
+
+CCLRP provides a cluster-scoped mechanism for expressing this class of redirect; the mechanism used to reach a backend listening on an address different from its Pod IP is outside the scope of this CFP.
+
+The cluster-wide scope is important because the endpoint is a shared cluster facility rather than an application-owned namespaced Service.
+
+### Node-local DNS
+
+In large clusters, a centralised CoreDNS or kube-dns deployment may become a scalability bottleneck for DNS request volume. Running a DNS cache on each node reduces traffic to the centralised DNS service and distributes request processing across the cluster.
+
+Workloads should continue to query the cluster DNS Service, while Cilium redirects DNS traffic to the node-local cache on the same node.
+
+This use case is represented by a `serviceMatcher` for the cluster DNS Service and explicit mappings for both UDP and TCP port 53.
+
+## Proposal
+
+### Overview
+
+Introduce the following cluster-scoped resource:
+
+```
+apiVersion: cilium.io/v2alpha1
+kind: CiliumClusterwideLocalRedirectPolicy
+metadata:
+ name: <name>
+spec:
+ # Exactly one of addressMatcher and serviceMatcher must be specified.
+ addressMatcher:
+ ip: <link-local-ip>
+ # serviceMatcher:
+ # namespace: <service-namespace>
+ # service: <service-name>
+
+ localEndpointSelector:
+ matchLabels:
+ app: <local-backend>
+ io.kubernetes.pod.namespace: <backend-namespace>
+
+ ports:
+ - port: <frontend-port>
+ targetPort: <backend-port>
+ protocol: <TCP, UDP>
+```
+
+`addressMatcher` and `serviceMatcher` are mutually exclusive.
+
+The policy is cluster-scoped, so it has no Kubernetes namespace. The backend selector is evaluated against pods in all namespaces.
+
+The current proposal expresses namespace restriction in the selector, using the same namespace-label convention used by `CiliumClusterwideNetworkPolicy`. The safety of this choice is questioned below.
+
+The API describes policy intent. The implementation may resolve a service into one or more concrete ClusterIP frontends and may resolve a selector into the node-local backend endpoints available on each node. Those internal representations are implementation details and are not part of the CCLRP API contract.
+
+### Address matching
+
+An `addressMatcher` contains one IP address. The address must be within a link-local range:
+
+* IPv4 link-local: `169.254.0.0/16`
+* IPv6 link-local: `fe80::/10`
+
+The `addressMatcher` is intended for destinations that are not represented by a Kubernetes Service, such as a host-provided metadata endpoint. It must not be used to override a Kubernetes Service ClusterIP or a Pod IP.
+
+The initial API intentionally supports one IP per `addressMatcher`. An administrator that needs both IPv4 and IPv6 can create separate policies. This keeps conflict handling, validation, updates, and deletion semantics straightforward while leaving room for a future multi-address extension.
+
+### Service matching
+
+A `serviceMatcher` identifies a Kubernetes Service by namespace and name. The Service must have a ClusterIP that Cilium represents as a concrete frontend within the load-balancer implementation. Services without a ClusterIP are not supported by `serviceMatcher`.
+
+When `ports` is present, it selects the Service ports to redirect and explicitly maps each frontend port to a backend `targetPort`.
+
+When `ports` is omitted, frontend-to-backend port mappings are derived from the Service and all ports are redirected. This preserves the existing `serviceMatcher` convention, while facilitating an explicit list when a subset of Service ports should be redirected, or when the local backend uses different ports. However, maintaining this behaviour is raised in a key question below.
+
+The controller must validate that every selected Service port can be represented by the requested mapping. Invalid or ambiguous mappings must be reported as reconciliation errors; they must not be silently skipped.
+
+### Backend selection
+
+`localEndpointSelector` selects the pods that can receive redirected traffic. Only backend pods on the node where the traffic is processed are eligible for the corresponding local redirect entry.
+
+Because CCLRP is cluster-scoped, selectors are evaluated across namespaces. The current proposal follows the cluster-wide policy convention of restricting a selector with the `io.kubernetes.pod.namespace` label. The safety of relying on that convention is discussed in a key question below.
+
+Example:
+
+```
+localEndpointSelector:
+ matchLabels:
I'm curious: do you have a specific scenario in mind that would benefit from multiple endpoint selectors?
The only thing I could immediately think of - and I think this assumes a namespace is explicit and mandatory - would be if a local backend pod needs to be migrated to another namespace.
Consider an application that can't spawn multiple instances -- perhaps it has some exclusive resource claim. If that application needed to be relocated from namespace A to namespace B, a redirection policy (with its explicit and mandatory namespace field) would require the administrator to also include the redirection policy in a migration.
With CLRP as-is, a policy can't be modified in place, so it would mean deleting the redirection policy and re-applying it - meaning traffic might momentarily be served across nodes.
Perhaps that means multiple endpoint selectors is the right thing to facilitate such a migration, with traffic effectively dropping while the application pod is deleted from namespace A and re-spawned in namespace B.
For what it's worth, I am personally in favour of making namespace an explicit, mandatory field in the backend selection. I think it's dangerous and too-easy to do the wrong thing otherwise.
ajmmm
Residual = Change × (1 − Confidence)
joamaki
CFP-44138: Cilium Clusterwide Local Redirect Policy
https://github.com/cilium/cilium/issues/44138