mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-15 23:16:36 +00:00
Add init sidecar mode for k8s operator (#622)
This commit is contained in:
@@ -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
|
||||
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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user