Add documentation for NetworkEgress#861
Conversation
📝 WalkthroughWalkthroughThe Kubernetes routing peer documentation now includes NetworkEgress guidance, covering target configuration, destination port rewriting, service discovery, a YAML example, and expected HTTP behavior. ChangesKubernetes egress documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/use-cases/kubernetes/routing-peer.mdx`:
- Around line 90-92: Correct the spelling and grammar in the network egress
documentation paragraph: change “a IP” to “an IP,” “rotuer” to “router,” “a
accompanying” to “an accompanying,” and “he target” to “the target.”
- Around line 90-92: Replace every occurrence of the internal-looking
prod.company.internal hostname in the routing-peer MDX example, including the
referenced lines, with the fictional placeholder example.com. Keep the hostname
usage and example behavior unchanged.
- Around line 92-112: Update the NetworkEgress example metadata.name from nginx
to a distinct name such as nginx-egress, avoiding conflict with the existing
Service/nginx; also update the subsequent HTTP request hostname to use the
generated egress Service name while preserving the namespace and cluster-local
format.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d9034298-abb5-49cb-889d-5a9de7fbda97
📒 Files selected for processing (1)
src/pages/use-cases/kubernetes/routing-peer.mdx
| The network router can also be used for egress traffic to reach other peers within the NetBird network. The network egress resource defines the target and links it to a network router. The target can either be a FQDN hostname or a IP address. Generally using a hostname is preferable especially if the target resource is hosted in another Kubernetes cluster. Egress through the network router works by assigning a random destination port for each network egress resource. This way the destination address and port can be rewritten before reaching the tunnel. Native Kubernetes services are used for directing the traffic to the network rotuer, meaning normal service discovery can be used for external peers. | ||
|
|
||
| Create a network egress resource in the namespace where it will be consumed. The operator will create a accompanying service with the same name for the egress resource. In this example he target is the nginx deployment from the network resource example. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the spelling and grammar errors.
Please change a IP to an IP, rotuer to router, a accompanying to an accompanying, and he target to the target.
🧰 Tools
🪛 LanguageTool
[grammar] ~90-~90: Ensure spelling is correct
Context: ...or directing the traffic to the network rotuer, meaning normal service discovery can b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/use-cases/kubernetes/routing-peer.mdx` around lines 90 - 92,
Correct the spelling and grammar in the network egress documentation paragraph:
change “a IP” to “an IP,” “rotuer” to “router,” “a accompanying” to “an
accompanying,” and “he target” to “the target.”
Source: Linters/SAST tools
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Replace the internal-looking hostname with a placeholder.
prod.company.internal is an internal hostname pattern and is repeated in the new example. Use a clearly fictional placeholder domain consistently throughout the example, such as example.com.
As per coding guidelines, MDX content must not include internal hostnames; use placeholders instead.
Also applies to: 104-106
🧰 Tools
🪛 LanguageTool
[grammar] ~90-~90: Ensure spelling is correct
Context: ...or directing the traffic to the network rotuer, meaning normal service discovery can b...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/use-cases/kubernetes/routing-peer.mdx` around lines 90 - 92,
Replace every occurrence of the internal-looking prod.company.internal hostname
in the routing-peer MDX example, including the referenced lines, with the
fictional placeholder example.com. Keep the hostname usage and example behavior
unchanged.
Source: Coding guidelines
| Create a network egress resource in the namespace where it will be consumed. The operator will create a accompanying service with the same name for the egress resource. In this example he target is the nginx deployment from the network resource example. | ||
|
|
||
| ```yaml | ||
| apiVersion: netbird.io/v1alpha1 | ||
| kind: NetworkEgress | ||
| metadata: | ||
| name: nginx | ||
| namespace: default | ||
| spec: | ||
| networkRouterRef: | ||
| name: prod | ||
| namespace: netbird | ||
| target: | ||
| fqdn: | ||
| hostname: nginx.default.prod.company.internal | ||
| ports: | ||
| - name: http | ||
| port: 80 | ||
| ``` | ||
|
|
||
| Once the network egress resource has been reconciled an HTTP request to `nginx.default.svc.cluster.local.` should reach the external resource. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Avoid reusing the existing nginx Service name.
The preceding example already creates Service/nginx in the default namespace. Since this resource also instructs the operator to create an accompanying Service named nginx, reconciliation will conflict with the existing Service. Use a distinct egress name, such as nginx-egress, and update the request hostname accordingly.
Proposed fix
metadata:
- name: nginx
+ name: nginx-egress
...
-Once the network egress resource has been reconciled an HTTP request to `nginx.default.svc.cluster.local.` should reach the external resource.
+Once the network egress resource has been reconciled, an HTTP request to `nginx-egress.default.svc.cluster.local.` should reach the target resource.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Create a network egress resource in the namespace where it will be consumed. The operator will create a accompanying service with the same name for the egress resource. In this example he target is the nginx deployment from the network resource example. | |
| ```yaml | |
| apiVersion: netbird.io/v1alpha1 | |
| kind: NetworkEgress | |
| metadata: | |
| name: nginx | |
| namespace: default | |
| spec: | |
| networkRouterRef: | |
| name: prod | |
| namespace: netbird | |
| target: | |
| fqdn: | |
| hostname: nginx.default.prod.company.internal | |
| ports: | |
| - name: http | |
| port: 80 | |
| ``` | |
| Once the network egress resource has been reconciled an HTTP request to `nginx.default.svc.cluster.local.` should reach the external resource. | |
| Create a network egress resource in the namespace where it will be consumed. The operator will create a accompanying service with the same name for the egress resource. In this example he target is the nginx deployment from the network resource example. | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/use-cases/kubernetes/routing-peer.mdx` around lines 92 - 112,
Update the NetworkEgress example metadata.name from nginx to a distinct name
such as nginx-egress, avoiding conflict with the existing Service/nginx; also
update the subsequent HTTP request hostname to use the generated egress Service
name while preserving the namespace and cluster-local format.
This documents the basics for using the new egress feature implemented in the operator.
netbirdio/kubernetes-operator#357
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
NetworkEgressresources.