Add init sidecar mode for k8s operator (#622)

This commit is contained in:
Bethuel Mmbaga
2026-02-18 12:46:29 +01:00
committed by GitHub
parent 5a899c55c4
commit c8f1dbd027

View File

@@ -325,6 +325,35 @@ spec:
... ...
``` ```
### Init Sidecar Mode
By default, the NetBird container is injected as a regular sidecar container. For workloads like Jobs and CronJobs where the pod
should terminate after the main container completes, you can use init sidecar mode. This injects NetBird as an init container
with `restartPolicy: Always`.
To enable init sidecar mode, add the following annotation:
```yaml
netbird.io/init-sidecar: "true"
```
Below is an example of a Job using init sidecar mode:
```yaml
kind: Job
...
spec:
...
template:
metadata:
annotations:
netbird.io/setup-key: app-setup-key # Must match the name of an NBSetupKey object in the same namespace
netbird.io/init-sidecar: "true"
...
spec:
containers:
...
```
### Using Extra Labels to Access Multiple Pods Using the Same Name ### Using Extra Labels to Access Multiple Pods Using the Same Name
Starting with `v0.27.0`, NetBird supports extra DNS labels, allowing you to define extended DNS names for peers. This enables grouping peers under a shared DNS name and distributing traffic using DNS round-robin load balancing. Starting with `v0.27.0`, NetBird supports extra DNS labels, allowing you to define extended DNS names for peers. This enables grouping peers under a shared DNS name and distributing traffic using DNS round-robin load balancing.