|
94 | 94 | containers: |
95 | 95 | - image: yourimage |
96 | 96 | name: container |
| 97 | +``` |
| 98 | + |
| 99 | +## Provisioning Networks (Ingress Functionality) |
| 100 | + |
| 101 | +### Granting controller access to NetBird Management |
| 102 | + |
| 103 | +#### Using Helm |
| 104 | + |
| 105 | +1. Create a Service User on your NetBird dashboard (Must be Admin). [Doc](https://docs.netbird.io/how-to/access-netbird-public-api#creating-a-service-user). |
| 106 | +1. Create access token for the Service User (Must be Admin). [Doc](https://docs.netbird.io/how-to/access-netbird-public-api#creating-a-service-user). |
| 107 | +1. Add access token to your helm values file under `netbirdAPI.key`. |
| 108 | + 1. Alternatively, provision secret in the same namespace as the operator and set the key `NB_API_KEY` to the access token generated. |
| 109 | + 1. Then set `netbirdAPI.keyFromSecret` to the name of the secret created. |
| 110 | +1. Set `ingress.enabled` to `true`. |
| 111 | + 1. Optionally, to provision network immediately, set `ingress.router.enabled` to `true`. |
| 112 | + 1. Optionally, to provision 1 network per kubernetes namespace, set `ingress.namespacedNetworks` to `true`. |
| 113 | +1. Run `helm install` or `helm upgrade`. |
| 114 | + |
| 115 | +#### Without Helm |
97 | 116 |
|
| 117 | +1. Create access token. |
| 118 | +1. Expose access token to controller deployment with flag `--netbird-api-key`. |
| 119 | + |
| 120 | +### Exposing a Service |
| 121 | + |
| 122 | +> [!IMPORTANT] |
| 123 | +> Ingress DNS Resolution requires DNS Wildcard Routing to be enabled, and at least one DNS Nameserver configured for clients. |
| 124 | + |
| 125 | +|Annotation|Description|Default| |
| 126 | +|---|---|---| |
| 127 | +|`netbird.io/expose`|Expose service using NetBird Network Resource|| |
| 128 | +|`netbird.io/groups`|Comma-separated list of group names to assign to Network Resource|`{ClusterName}-{Namespace}-{Service}`| |
| 129 | +|`netbird.io/resource-name`|Network Resource name|`{Namespace}-{Service}`| |
| 130 | +|`netbird.io/policy`|Name of NBPolicy to propagate service ports as destination.|| |
| 131 | +|`netbird.io/policy-ports`|Narrow down exposed ports in policy, leave empty for all ports.|| |
| 132 | +|`netbird.io/policy-protocol`|Narrow down protocol for use in policy, leave empty for all protocols.|| |
| 133 | + |
| 134 | +### Managing Policies |
| 135 | + |
| 136 | +1. Simply add policies under `ingress.policies`, for example. |
| 137 | +```yaml |
| 138 | +ingress: |
| 139 | + policies: |
| 140 | + default: |
| 141 | + name: Kubernetes Default Policy # Required |
| 142 | + description: Default # Optional |
| 143 | + sourceGroups: # Required |
| 144 | + - All |
| 145 | + ports: # Optional, resources annotated 'netbird.io/policy=default' will append to this |
| 146 | + - 443 |
| 147 | + protocols: # Optional, restricts protocols allowed to resources, defaults to ['tcp', 'udp'] |
| 148 | + - tcp |
| 149 | + - udp |
| 150 | + bidirectional: true # Optional, defaults to true |
98 | 151 | ``` |
| 152 | +2. Reference policy in Services using `netbird.io/policy=default`, this will add relevant ports and destination groups to Policy. |
99 | 153 |
|
100 | 154 | ## Contributing |
101 | 155 |
|
|
0 commit comments