Skip to content

Commit c8f1dbd

Browse files
authored
Add init sidecar mode for k8s operator (#622)
1 parent 5a899c5 commit c8f1dbd

File tree

1 file changed

+29
-0
lines changed
  • src/pages/manage/integrations/kubernetes

1 file changed

+29
-0
lines changed

src/pages/manage/integrations/kubernetes/index.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,35 @@ spec:
325325
...
326326
```
327327

328+
### Init Sidecar Mode
329+
By default, the NetBird container is injected as a regular sidecar container. For workloads like Jobs and CronJobs where the pod
330+
should terminate after the main container completes, you can use init sidecar mode. This injects NetBird as an init container
331+
with `restartPolicy: Always`.
332+
333+
To enable init sidecar mode, add the following annotation:
334+
335+
```yaml
336+
netbird.io/init-sidecar: "true"
337+
```
338+
339+
Below is an example of a Job using init sidecar mode:
340+
341+
```yaml
342+
kind: Job
343+
...
344+
spec:
345+
...
346+
template:
347+
metadata:
348+
annotations:
349+
netbird.io/setup-key: app-setup-key # Must match the name of an NBSetupKey object in the same namespace
350+
netbird.io/init-sidecar: "true"
351+
...
352+
spec:
353+
containers:
354+
...
355+
```
356+
328357
### Using Extra Labels to Access Multiple Pods Using the Same Name
329358
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.
330359

0 commit comments

Comments
 (0)