46 Commits
Author SHA1 Message Date
Philip LaineandGitHub 0ffcaca94b Make network router read only file system by default (#213)
This changes the router and sidecar to run with read only file system by
default. This is good practice in Kubernetes and often required in most
clusters.

Fixes #144
Fixes #114

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

## Summary by CodeRabbit

* **Chores**
* Enhanced DNS configuration handling in containerized deployments with
stricter filesystem access controls and improved security measures.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/kubernetes-operator/pull/213?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-05-18 11:21:35 +02:00
Philip LaineandGitHub ae34898735 Rename Helm chart and Docker image and move to GHCR (#233)
This change does a few things, none of these are breaking.

It changes the registry from Docker Hub to GHCR, as we dont have the
same rate limiting issues with unauthenticated pulls.

It changes the release process to push the Helm chart as an OCI artifact
removing the need for GH pages.

It renames both the image and chart from kubernetes-operator to
netbird-operator. This name is cleaner and easier for people to
understand in a sea of Helm charts. Funnily enough this is not a
breaking change as the release name is used and not the chart name. So
in place upgrades just work.

Fixes #207

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-05-06 12:26:32 +02:00
Philip LaineandGitHub ea9f1cb081 Modernize for Go 1.26 (#232)
This change replaces all uses of pointer utils with the new `new`
function which does the same job.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-05-05 13:53:44 +02:00
Philip LaineandGitHub 69afe3aade Fix SPDX license header (#231)
This change adds SPDX license headers to all files and eforces it with
the linter.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-05-05 12:59:36 +02:00
Philip LaineandGitHub 0c542db9d7 Fix group reconcile removing peers (#226)
This changes the group reconcile to get the existing group first and
then update it in place. If not done like this peers will be removed
from the group on the next reconcile.

Fixes #221
2026-05-05 11:12:50 +02:00
Philip LaineandGitHub 74012deb27 Enforce import ordering and aliases (#216)
This change ensures import ordering and aliases is standardized.
Something that is extra important when working with Kuberentes apis that
have "standard" import aliases.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-30 13:39:11 +02:00
Philip LaineandGitHub 37d48b5ca8 Set best practice defaults for network router deployment (#214)
This change sets some Kubernetes best practices as defaults. Such as
topology spread and pod disruption budget.

It also exposes log level and image settings in the root struct to make
it easier to override commonly configured settings.

Fixes #77 
Fixes #162

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-28 15:18:15 +02:00
Philip LaineandGitHub 91036022c0 Add path component to finalizer (#202)
The Kubernetes client warns about not having a path component in the
finalizer. This change adds a unqiue path component for each reconciler
kind.
2026-04-23 19:18:06 +02:00
Philip LaineandGitHub 876a0e1eb3 Update Gateway API to use new resources (#201)
We dont want to promote the use of the "old" resources with NB prefix so
the Gateway API integration should only support the new ones.

---------

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-23 16:11:15 +02:00
Philip LaineandGitHub 99ef70603f Allow references to groups by name (#195)
Group names are unique so we can safely use the name as a reference
method to groups. This makes assigning resources created in the cluster
to groups that already exist a lot easier.
2026-04-23 13:12:09 +02:00
Philip LaineandGitHub 1daeb670ba Make network resource names unique (#196)
Network resource names are unique per Netbird account. This change moves
the existing name to the description and uses the UID for the name of
the resource instead.
2026-04-23 11:59:07 +02:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Philip Laine
b77bcd74ab Bump github.com/netbirdio/netbird from 0.66.4 to 0.69.0 (#187)
Bumps
[github.com/netbirdio/netbird](https://github.com/netbirdio/netbird)
from 0.66.4 to 0.69.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/netbirdio/netbird/releases">github.com/netbirdio/netbird's
releases</a>.</em></p>
<blockquote>
<h2>v0.69.0</h2>
<h2>Release Notes for v0.69.0</h2>
<h3>What's New</h3>
<p><strong>Reverse Proxy IP Reputation Integration</strong>
Now you can use CrowdSec to block malicious traffic based on IP
reputation on your exposed service in the reverse proxy.</p>
<p>This feature requires self-hosted installations to add another
container to their deployment. See instructions in the <a
href="https://docs.netbird.io/selfhosted/migration/enable-reverse-proxy#step-7-optional-enable-crowd-sec-ip-reputation">reverse
proxy migration documentation</a>.</p>
<blockquote>
<p>For Cloud users, support is coming soon.</p>
</blockquote>
<p>Learn more about <a
href="https://docs.netbird.io/manage/reverse-proxy">here</a>.</p>
<p><strong>macOS p2p connectivity improvements</strong>
We've improved macOS p2p connectivity with a better routing exclusion
mechanism to avoid loops. Now the client doesn't add /32 routes per
remote candidate addresses avoiding limitations on accessing remote
peer's local addresses via tunnel connections. Learn more about <a
href="https://redirect.github.com/netbirdio/netbird/pull/5918">this
change</a>.</p>
<blockquote>
<p>To use the old behavior run:</p>
<p><code>sudo netbird service reconfigure --service-env
&quot;NB_USE_LEGACY_ROUTING=true&quot;</code></p>
</blockquote>
<h4>Client Improvements</h4>
<ul>
<li>Added <strong>PCP support</strong>. This change adds support for the
PCP protocol to the client to improve the rate of P2P connectivity.
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5219">netbirdio/netbird#5219</a></li>
<li>Added <strong>--disable-networks flag</strong> to block network
selection for users.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5896">netbirdio/netbird#5896</a></li>
<li>Fixed <strong>clearing service env vars with --service-env
&quot;&quot;</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5893">netbirdio/netbird#5893</a></li>
<li>Guarded against <strong>container DNAT bypass of ACL rules in
iptables</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5697">netbirdio/netbird#5697</a></li>
<li>Populated <strong>NetworkAddresses on iOS for posture
checks</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5900">netbirdio/netbird#5900</a></li>
<li>Reconnected <strong>conntrack netlink listener on error</strong>.<br
/>
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5885">netbirdio/netbird#5885</a></li>
<li>Replaced <strong>exclusion routes with scoped default + IP_BOUND_IF
on macOS</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5918">netbirdio/netbird#5918</a></li>
<li>Fixed <strong>incorrect SSH client config combining Host and Match
directives</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5903">netbirdio/netbird#5903</a></li>
<li>Fixed <strong>WGIface.Close deadlock when DNS filter hook re-enters
GetDevice</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5916">netbirdio/netbird#5916</a></li>
</ul>
<h4>Management Improvements</h4>
<ul>
<li>Enforced <strong>peer or peer groups requirement for network
routers</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5894">netbirdio/netbird#5894</a></li>
<li>Reused <strong>single cache store across all management server
consumers</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5889">netbirdio/netbird#5889</a></li>
<li>Fixed <strong>lint error on Google Workspace
integration</strong>.<br />
<a
href="https://redirect.github.com/netbirdio/netbird/pull/5907">netbirdio/netbird#5907</a></li>
</ul>
<h4>Proxy Enhancements</h4>
<ul>
<li>Added <strong>CrowdSec IP reputation integration for reverse
proxy</strong>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/netbirdio/netbird/commit/3098f48b25e2a613d8f70466243d992c498e0fd2"><code>3098f48</code></a>
[client] fix ios network addresses mac filter (<a
href="https://redirect.github.com/netbirdio/netbird/issues/5906">#5906</a>)</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/7f023ce8014084385e677e67c541677336e25431"><code>7f023ce</code></a>
[client] Android debug bundle support (<a
href="https://redirect.github.com/netbirdio/netbird/issues/5888">#5888</a>)</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/e3611265159bd372f77ca404d32c86127e036525"><code>e361126</code></a>
[client] Fix WGIface.Close deadlock when DNS filter hook re-enters
GetDevice ...</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/95213f715714177b7c9672b3f264f84c9a31cf04"><code>95213f7</code></a>
[client] Use Match host+exec instead of Host+Match in SSH client config
(<a
href="https://redirect.github.com/netbirdio/netbird/issues/5903">#5903</a>)</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/2e0e3a3601d90a5d7a6b39dc16ebde2522fdf580"><code>2e0e3a3</code></a>
[client] Replace exclusion routes with scoped default + IP_BOUND_IF on
macOS ...</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/8ae8f2098fb4bb7a9177b3f2d8d908a413b8fc49"><code>8ae8f20</code></a>
[management] chores: fix lint error on google workspace (<a
href="https://redirect.github.com/netbirdio/netbird/issues/5907">#5907</a>)</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/a39787d6796ee26e1f6ad9c67ea33a9da7bf8d66"><code>a39787d</code></a>
[infrastructure] Add CrowdSec LAPI container to self-hosted setup script
(<a
href="https://redirect.github.com/netbirdio/netbird/issues/5880">#5880</a>)</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/53b04e512af0d94f619e870467115c43d200830b"><code>53b04e5</code></a>
[management] Reuse a single cache store across all management server
consumer...</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/633dde8d1f5985afc52071462c42857cb844b9ac"><code>633dde8</code></a>
[client] Reconnect conntrack netlink listener on error (<a
href="https://redirect.github.com/netbirdio/netbird/issues/5885">#5885</a>)</li>
<li><a
href="https://github.com/netbirdio/netbird/commit/7e4542adde54ebe71a3a47f5228c5915c9c1052a"><code>7e4542a</code></a>
fix(client): populate NetworkAddresses on iOS for posture checks (<a
href="https://redirect.github.com/netbirdio/netbird/issues/5900">#5900</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/netbirdio/netbird/compare/v0.66.4...v0.69.0">compare
view</a></li>
</ul>
</details>
<br />

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Philip Laine <philip.laine@gmail.com>
2026-04-23 09:50:41 +02:00
Philip LaineandGitHub 6768a76c9c Add network router and resource (#189)
This change adds two new resources, NetworkRouter and NetworkResource,
which enable clusters to expose Kubernetes services to Netbird.

The NetworkRouter is responsible for creating the network, group, setup
key and routing peer all of which are unique to the isntance. Along with
the deployment of the client in the cluster.

The NetworkResource exposes a service by linking to the specific router
it wants to expose to. This makes coupling between the resource and
network easy to understand.

Routers also set a DNS zone which is used to give names to resources
based on the name and namespace of the service being exposed.

Part of #172

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-23 08:55:49 +02:00
Philip LaineandGitHub af11e31b28 Add ready conditon and cleanup finalizer and status patching (#186)
This change adds a ready condition. It also sets a standard for status
fields and documentation. It makes use of helper functions from FluxCD
to better manage patching of finalizers and status.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-21 15:42:11 +02:00
Philip LaineandGitHub 1bcd58a7cd Implement mock for Netbird API and client (#184)
This makes testing of the operator a lot simpler by enabling a quick way
to implement the crud endpoints for all the resources used.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-15 10:25:45 +02:00
Philip LaineandGitHub 9c4ca73712 Implement group resource (#181)
This change implements a new group resource. 

It also sets the standard for a resource reference will be done through
out the controller. A resource reference can either be done by ID or as
a local named reference to the actual resource. This allows end users to
chose if they want to manage things completely in the cluster or not.

Part of #172

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-15 10:16:10 +02:00
Philip LaineandGitHub 26479a19c0 Implement new setup key resource (#178)
This change implements a new resource called SetupKey that manages the
lifecycle of setup keys and stores them in secrets.

A major change here is that we are also switching to using SSA for
resource management.

Part of #172

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-04-13 12:20:35 +02:00
Philip LaineandGitHub f1c382e6f2 Revert "Cleanup routing peer deployment creation" (#159)
Reverts netbirdio/kubernetes-operator#155
2026-03-23 17:56:43 +01:00
Philip LaineandGitHub a20570b692 Cleanup resource delete reconcile (#158)
This fixes resource delete to always run even when there are no
finalizers.
2026-03-23 15:52:14 +01:00
Philip LaineandGitHub 3a36cb6961 Cleanup routing peer deployment creation (#155)
This refactors the deployment creation for the routing peer to use the
create or update method. Keeping this a lot cleaner. It also changes to
set controller reference using the util method.
2026-03-23 11:44:09 +01:00
Philip LaineandGitHub 8adc8855e5 Add support for private gateway (#154)
This change adds support for TCPRoutes when using a private gateway
class. This is similar to annotating services today. It also moves the
gateway classes to the Helm chart as it makes things a lot simpler for
the end user as they no longer have to define them.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-03-23 09:59:48 +01:00
Philip LaineandGitHub 54b2ab8efc Use Gateway listener to reference routing peer (#150)
This just changes how a routing peer is referenced. In my head this
model makes more sense, especially as we need at least one listener
right now.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-03-20 10:01:06 +01:00
Philip LaineandGitHub 39ab189fae Share NBResource between different routes (#149)
This changes the behavior of the Netbird resource so that they can be
shared between routes rather than having one unique created per route.
This is important as we may want to have different route types pointing
to the same service.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-03-19 18:28:35 +01:00
Philip LaineandGitHub 7acd175882 Gateway API support (#117)
This change adds support for the new proxy service to the operator
through Gateway API. This change attempts to standardize concepts around
the Gateway API to allow for compatibility with other projects.

Fixes #111
Fixes #44

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-03-19 13:01:58 +01:00
Philip LaineandGitHub 9313fef43d Share Netbird client between all reconcilers (#122)
This changes the reconcilers to take a netbird client rather than
creating their own on setup.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-03-16 11:23:26 +01:00