Files
netbird-kubernetes-operator/docs/api-reference.md
T
Philip LaineandGitHub ea2dafd5a3 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>
2026-07-17 08:06:53 +02:00

24 KiB

API Reference

Packages

netbird.io/v1alpha1

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.

Resource Types

ClusterProxy

ClusterProxy is the Schema for the clusterproxies API

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string ClusterProxy
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec ClusterProxySpec Required: {}
status ClusterProxyStatus { observedGeneration:-1 }

ClusterProxySpec

ClusterProxySpec defines the desired state of ClusterProxy.

Appears in:

Field Description Default Validation
clusterName string ClusterName is the name of the Kubernetes cluster. Required: {}
apiServer string APIServer is the URL of the Kubernetes API server to proxy requests to. https://kubernetes.default.svc.cluster.local/ Required: {}
serviceAccountName string ServiceAccountName is a reference to the service account used for impersonation. Required: {}
groups GroupReference array Groups are references to groups that the peer will be a part of. Optional: {}

ClusterProxyStatus

ClusterProxyStatus defines the observed state of ClusterProxy.

Appears in:

Field Description Default Validation
observedGeneration integer ObservedGeneration is the last reconciled generation. Optional: {}
conditions Condition array Conditions holds the conditions for the ClusterProxy. Optional: {}

ContainerOverride

Appears in:

Field Description Default Validation
image string Image overrides the image used by the client. Optional: {}
env EnvVar array Optional: {}
securityContext SecurityContext Optional: {}
startupProbe Probe StartupProbe overrides the startup probe for the sidecar container. Optional: {}
livenessProbe Probe LivenessProbe overrides the liveness probe for the sidecar container. Optional: {}
readinessProbe Probe ReadinessProbe overrides the readiness probe for the sidecar container. Optional: {}

CrossNamespaceReference

Appears in:

Field Description Default Validation
name string Name of the referent. Required: {}
namespace string Namespace of the referent. Required: {}

DNSZoneReference

DNSZoneReference references a Netbird DNS zone by domain name.

Appears in:

Field Description Default Validation
name string Name is the domain name of an existing Netbird DNS zone, e.g. "example.com". Required: {}

Group

Group is the Schema for the groups API.

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string Group
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec GroupSpec Required: {}
status GroupStatus { observedGeneration:-1 }

GroupReference

Appears in:

Field Description Default Validation
name string Name is the name of the group. Optional: {}
id string ID is the id of the group. Optional: {}
localRef LocalObjectReference LocalReference is a reference to a group in the same namespace. Optional: {}

GroupSpec

GroupSpec defines the desired state of Group.

Appears in:

Field Description Default Validation
name string Name of the group. MinLength: 1

GroupStatus

GroupStatus defines the observed state of Group.

Appears in:

Field Description Default Validation
observedGeneration integer ObservedGeneration is the last reconciled generation. Optional: {}
conditions Condition array Conditions holds the conditions for the Group. Optional: {}
groupID string GroupID is the id of the created group. Optional: {}

InjectionMode

Underlying type: string

InjectionMode defines how the sidecar is injected into the pod.

Validation:

  • Enum: [Sidecar Container]

Appears in:

Field Description
Sidecar InjectionModeSidecar injects the client as a sidecar container.
Container InjectionModeContainer injects the client as a regular container.

NetworkEgress

NetworkEgress is the Schema for the networkegresses API.

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string NetworkEgress
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec NetworkEgressSpec Required: {}
status NetworkEgressStatus { observedGeneration:-1 }

NetworkEgressFQDNTarget

NetworkEgressFQDNTarget matches traffic by an exact domain name (no wildcards).

Appears in:

Field Description Default Validation
hostname string Hostname is a fully qualified domain name to match exactly. Pattern: ^([a-zA-Z0-9]([a-zA-Z0-9-]\{0,61\}[a-zA-Z0-9])?\.)+[a-zA-Z]\{2,\}$
Required: {}

NetworkEgressIPTarget

NetworkEgressIPTarget is a single IPv4 or IPv6 address.

Appears in:

Field Description Default Validation
address string Address is a single IP address. Required: {}

NetworkEgressPort

Appears in:

Field Description Default Validation
name string Name of the port. MaxLength: 15
MinLength: 1
Pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
Required: {}
port integer The port that will be exposed by this service. Maximum: 65535
Minimum: 1
Required: {}

NetworkEgressSpec

NetworkEgressSpec defines the desired state of NetworkEgress.

Appears in:

Field Description Default Validation
networkRouterRef CrossNamespaceReference NetworkRouterRef is a reference to the network and router where the resource will be created.
target NetworkEgressTarget Target for egress traffic.
ports NetworkEgressPort array Ports to the resource to route. MinItems: 1
Required: {}

NetworkEgressStatus

NetworkEgressStatus defines the observed state of NetworkEgress.

Appears in:

Field Description Default Validation
observedGeneration integer ObservedGeneration is the last reconciled generation. Optional: {}
conditions Condition array Conditions holds the conditions for the NetworkEgress. Optional: {}

NetworkEgressTarget

NetworkEgressTarget describes a single allowed egress destination. Exactly one of IP or FQDN must be set.

Appears in:

Field Description Default Validation
ip NetworkEgressIPTarget IP targets a single specific IP address (not a CIDR range). Optional: {}
fqdn NetworkEgressFQDNTarget FQDN targets an exact domain name (no wildcards). Optional: {}

NetworkResource

NetworkResource is the Schema for the networkresources API.

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string NetworkResource
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec NetworkResourceSpec Required: {}
status NetworkResourceStatus { observedGeneration:-1 }

NetworkResourceSpec

NetworkResourceSpec defines the desired state of NetworkResource.

Appears in:

Field Description Default Validation
networkRouterRef CrossNamespaceReference NetworkRouterRef is a reference to the network and router where the resource will be created.
serviceRef LocalObjectReference ServiceRef is a reference to the service to expose in the Network.
groups GroupReference array Groups are references to groups that the resource will be a part of. Optional: {}

NetworkResourceStatus

NetworkResourceStatus defines the observed state of NetworkResource.

Appears in:

Field Description Default Validation
observedGeneration integer ObservedGeneration is the last reconciled generation. Optional: {}
conditions Condition array Conditions holds the conditions for the NetworkResource. Optional: {}
networkID string NetworkID is the id of the network the resource is created in. Optional: {}
resourceID string ResourceID is the id of the created resource. Optional: {}
dnsZoneID string DNSZoneID is the id of the zone the DNS record is created in. Optional: {}
dnsRecordID string DNSRecordID is the id of the created DNS record. Optional: {}

NetworkRouter

NetworkRouter is the Schema for the networkrouters API.

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string NetworkRouter
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec NetworkRouterSpec Required: {}
status NetworkRouterStatus { observedGeneration:-1 }

NetworkRouterSpec

NetworkRouterSpec defines the desired state of NetworkRouter.

Appears in:

Field Description Default Validation
dnsZoneRef DNSZoneReference DNSZoneRef is a reference to the DNS zone used to create records for resources. Required: {}
image string Netbird client image. Optional: {}
logLevel string Log level for Netbird client. Optional: {}
workloadOverride WorkloadOverride WorkloadOverride contains configuration that will override the default workload. Optional: {}

NetworkRouterStatus

NetworkRouterStatus defines the observed state of NetworkRouter.

Appears in:

Field Description Default Validation
observedGeneration integer ObservedGeneration is the last reconciled generation. Optional: {}
conditions Condition array Conditions holds the conditions for the NetworkRouter. Optional: {}
routingPeerID string RoutingPeerID is the id of the created routing peer. Optional: {}
networkID string NetworkID is the id of the network the routing peer was created in. Optional: {}

SetupKey

SetupKey is the Schema for the setupkeys API.

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string SetupKey
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec SetupKeySpec Required: {}
status SetupKeyStatus { observedGeneration:-1 }

SetupKeySpec

SetupKeySpec defines the desired state of SetupKey.

Appears in:

Field Description Default Validation
name string Name of the setup key. MinLength: 1
ephemeral boolean Ephemeral decides if peers added with the key are ephemeral or not.
allowExtraDnsLabels boolean AllowExtraDnsLabels decides if peers added with the key can have extra DNS labels. false
duration Duration Duration sets how long the setup key is valid for. Pattern: ^([0-9]+(\.[0-9]+)?(m|h))+$
Type: string
Optional: {}
autoGroups GroupReference array AutoGroups are groups that will be automatically assigned to peers using setup key. Optional: {}

SetupKeyStatus

SetupKeyStatus defines the observed state of SetupKey.

Appears in:

Field Description Default Validation
observedGeneration integer ObservedGeneration is the last reconciled generation. Optional: {}
conditions Condition array Conditions holds the conditions for the SetupKey. Optional: {}
setupKeyID string SetupKeyID is the id of the created setup key.

SidecarProfile

SidecarProfile is the Schema for the sidecarprofiles API.

Field Description Default Validation
apiVersion string netbird.io/v1alpha1
kind string SidecarProfile
kind string Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Optional: {}
apiVersion string APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Optional: {}
metadata ObjectMeta Refer to Kubernetes API documentation for fields of metadata.
spec SidecarProfileSpec Required: {}
status SidecarProfileStatus { }

SidecarProfileSpec

SidecarProfileSpec defines the desired state of SidecarProfile.

Appears in:

Field Description Default Validation
setupKeyRef LocalObjectReference SetupKeyRef is the reference to the setup key used in the client. Required: {}
podSelector LabelSelector PodSelector determines which pods the profile should apply to.
An empty slector means the profile will apply to all pods in the namespace.
Optional: {}
injectionMode InjectionMode InjectionMode defines whether the sidecar is injected as a native Kubernetes sidecar container or as a regular container. Sidecar Enum: [Sidecar Container]
Optional: {}
extraDNSLabels string array ExtraDNSLabels assigns additional DNS names to peers beyond their default hostname. Optional: {}
containerOverride ContainerOverride Optional: {}

SidecarProfileStatus

SidecarProfileStatus defines the observed state of SidecarProfile.

Appears in:

Field Description Default Validation
conditions Condition array Conditions holds the conditions for the SidecarProfile. Optional: {}

WorkloadOverride

Appears in:

Field Description Default Validation
labels object (keys:string, values:string) Labels that will be added. Optional: {}
annotations object (keys:string, values:string) Annotations that will be added. Optional: {}
replicas integer Replicas sets the amount of client replicas. 3 Minimum: 1
Optional: {}
podTemplate PodTemplateSpec PodTemplate overrides the pod template. Schemaless: {}
Optional: {}