Add network egress resource (#357)

This change adds a new import resource which enables exposing Netbird
resources as Kubernetes services. This remove the need to add sidecars
to every pod.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a new `NetworkEgress` custom resource (`netbird.io/v1alpha1`)
with CRD, schema validation, and status/conditions.
* Extended controller functionality to create egress services and
translate egress rules into import `EndpointSlice` resources; egress
pods now include a kube-egress-forwarder sidecar.
* **Bug Fixes**
* Added missing deep-copy and declarative apply support for the new
`NetworkEgress` API types.
* **Documentation**
* Updated README/API reference and added example manifests for
`NetworkEgress` (including IP/FQDN target usage).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine
2026-07-17 08:06:53 +02:00
committed by GitHub
parent 3c1c6675d9
commit ea2dafd5a3
31 changed files with 2220 additions and 83 deletions
+14
View File
@@ -38,6 +38,20 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &apiv1alpha1.GroupSpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("GroupStatus"):
return &apiv1alpha1.GroupStatusApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgress"):
return &apiv1alpha1.NetworkEgressApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgressFQDNTarget"):
return &apiv1alpha1.NetworkEgressFQDNTargetApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgressIPTarget"):
return &apiv1alpha1.NetworkEgressIPTargetApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgressPort"):
return &apiv1alpha1.NetworkEgressPortApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgressSpec"):
return &apiv1alpha1.NetworkEgressSpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgressStatus"):
return &apiv1alpha1.NetworkEgressStatusApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkEgressTarget"):
return &apiv1alpha1.NetworkEgressTargetApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkResource"):
return &apiv1alpha1.NetworkResourceApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkResourceSpec"):