Skip to content

docs: 添加 Cilium eBPF L4 负载均衡方案文档#131

Closed
changluyi wants to merge 3 commits intoalauda:mainfrom
changluyi:feature/cilium-ebpf-doc-alauda
Closed

docs: 添加 Cilium eBPF L4 负载均衡方案文档#131
changluyi wants to merge 3 commits intoalauda:mainfrom
changluyi:feature/cilium-ebpf-doc-alauda

Conversation

@changluyi
Copy link
Contributor

@changluyi changluyi commented Mar 25, 2026

Cilium eBPF L4 负载均衡方案文档

Summary by CodeRabbit

  • Documentation
    • Added comprehensive English and Chinese guides for deploying an eBPF-based L4 load balancer with source IP preservation on ACP 4.2+ clusters. Covers prerequisites, compatibility, installation via the cluster marketplace, temporary RBAC workflow, kube-proxy removal/cleanup, required load-balancer objects, and verification steps for LB IP assignment and source-IP validation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

Warning

Rate limit exceeded

@changluyi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ff8d32ea-e18c-49db-8ead-0d5dc5e9dc14

📥 Commits

Reviewing files that changed from the base of the PR and between 24a1131 and f364e9d.

📒 Files selected for processing (2)
  • docs/en/solutions/How_to_Deploy_Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
  • docs/zh/solutions/How_to_Deploy_Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md

Walkthrough

Added two new solution docs (English and Chinese) describing how to deploy Cilium eBPF L4 load balancing with source IP preservation on ACP 4.2+ clusters, including prerequisites, installation steps, kube-proxy cleanup, Cilium configuration objects, and verification procedures.

Changes

Cohort / File(s) Summary
Cilium L4 Load Balancer Documentation
docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md, docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
Added step-by-step guides (EN/ZH) covering prerequisites (ACP version, architecture, kernel config), installation in Custom network mode, temporary RBAC for install, uploading Cilium image, kube-proxy backup/removal and BroadcastJob cleanup, CiliumLoadBalancerIPPool and CiliumL2AnnouncementPolicy manifests, and verification steps for LB IP assignment and source-IP preservation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through docs both near and far,

A VIP, an ARP, and a shining star.
Kube-proxy cleared, the packets roam free,
Source IPs kept — hop, that’s the key! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Cilium eBPF L4 load balancer solution documentation in Chinese.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (4)
docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md (2)

275-279: Consider adding language specifier to output example.

The fenced code block showing expected output lacks a language identifier. Adding text or console improves syntax highlighting and satisfies markdown linters.

✨ Proposed enhancement
-```
+```text
 cpaas-system      cilium-l2announce-cilium-123-1-test       192.168.141.196                                                                 24s

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
around lines 275 - 279, The fenced code block containing the "Expected output
example" lacks a language identifier; update that markdown block by adding a
language specifier such as "text" or "console" (i.e., change the opening totext or ```console) for the expected-output example line so linters and
syntax highlighting recognize it.


</details>

---

`262-267`: **Consider adding language specifier to output example.**

The fenced code block showing expected output lacks a language identifier. Adding `text` or `console` improves syntax highlighting and satisfies markdown linters.



<details>
<summary>✨ Proposed enhancement</summary>

```diff
-```
+```text
 NAMESPACE      NAME                      TYPE           CLUSTER-IP     EXTERNAL-IP       PORT(S)                     AGE
 cilium-123-1   test                      LoadBalancer   10.4.98.81     192.168.132.192   80:31447/TCP                35s
 ```
```

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
Verify each finding against the current code and only fix it if needed.

In `@docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md`
around lines 262 - 267, The fenced code block showing the "Expected output
example" is missing a language specifier; update the block containing the
example table (the lines starting with "NAMESPACE      NAME                     
TYPE..." and the following row "cilium-123-1   test ... 35s") to include a
language tag such as `text` or `console` after the opening triple backticks so
markdown linters and syntax highlighters recognize it.
```

</details>

</blockquote></details>
<details>
<summary>docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md (2)</summary><blockquote>

`262-265`: **建议为输出示例添加语言标识符。**

显示预期输出的代码块缺少语言标识符。添加 `text` 或 `console` 可以改善语法高亮并满足 markdown 检查工具的要求。



<details>
<summary>✨ 建议的改进</summary>

```diff
-```
+```text
 NAMESPACE      NAME                      TYPE           CLUSTER-IP     EXTERNAL-IP       PORT(S)                     AGE
 cilium-123-1   test                      LoadBalancer   10.4.98.81     192.168.132.192   80:31447/TCP                35s
 ```
```

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
around lines 262 - 265, The fenced code block showing the kubectl output lacks a
language identifier; update that block in
Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md to add a language tag
such as text or console (e.g., change the opening totext) so the sample
output is syntax-highlighted and passes markdown linters; locate the specific
output block that contains the "NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP
PORT(S) AGE" table and add the identifier there.


</details>

---

`275-277`: **建议为输出示例添加语言标识符。**

显示预期输出的代码块缺少语言标识符。添加 `text` 或 `console` 可以改善语法高亮并满足 markdown 检查工具的要求。



<details>
<summary>✨ 建议的改进</summary>

```diff
-```
+```text
 cpaas-system      cilium-l2announce-cilium-123-1-test       192.168.141.196                                                                 24s
 ```
```

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
around lines 275 - 277, The example output code block in the markdown lacks a
language identifier; update the fenced code block that contains the line
"cpaas-system cilium-l2announce-cilium-123-1-test 192.168.141.196
24s" to use a language tag such as "text" or "console" (e.g., change ``` to

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md`:
- Around line 68-75: The violet push command is passing the literal string
"CLUSTER_NAME" instead of the environment variable; update the command to
reference the env var (use $CLUSTER_NAME) in the --clusters argument so it
expands to the actual cluster name (i.e., change --clusters "CLUSTER_NAME" to
--clusters "$CLUSTER_NAME").
- Around line 148-210: Add the missing heredoc opener so the YAML can be written
to a file: insert a shell heredoc command (e.g., initiating a cat into
kube-proxy-cleanup.yaml with << 'EOF') immediately before the existing ```yaml
block for the BroadcastJob named kube-proxy-cleanup, keeping the ending EOF
already present; ensure you remove or adjust Markdown code fences if needed so
the heredoc writes the raw YAML (apiVersion: operator.alauda.io/v1alpha1, kind:
BroadcastJob, metadata.name: kube-proxy-cleanup) into the file.

In
`@docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md`:
- Around line 67-74: In the violet push command, the cluster argument is using
the literal string "CLUSTER_NAME" instead of the environment variable; update
the command invocation (violet push ...) to pass the variable by replacing
"CLUSTER_NAME" with $CLUSTER_NAME so it uses the exported CLUSTER_NAME value
(ensure the exports for PLATFORM_URL, USERNAME, PASSWORD, CLUSTER_NAME remain as
shown).
- Around line 147-208: The YAML snippet for the BroadcastJob (metadata.name:
kube-proxy-cleanup) is missing the heredoc wrapper to create a file; wrap the
YAML with a bash heredoc to write to kube-proxy-cleanup.yaml by adding a leading
line like cat > kube-proxy-cleanup.yaml << 'EOF' before the ```yaml block and a
closing EOF after the end of the YAML so the BroadcastJob manifest
(kube-proxy-cleanup) is correctly emitted to the file.

---

Nitpick comments:
In
`@docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md`:
- Around line 275-279: The fenced code block containing the "Expected output
example" lacks a language identifier; update that markdown block by adding a
language specifier such as "text" or "console" (i.e., change the opening ``` to
```text or ```console) for the expected-output example line so linters and
syntax highlighting recognize it.
- Around line 262-267: The fenced code block showing the "Expected output
example" is missing a language specifier; update the block containing the
example table (the lines starting with "NAMESPACE      NAME                     
TYPE..." and the following row "cilium-123-1   test ... 35s") to include a
language tag such as `text` or `console` after the opening triple backticks so
markdown linters and syntax highlighters recognize it.

In
`@docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md`:
- Around line 262-265: The fenced code block showing the kubectl output lacks a
language identifier; update that block in
Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md to add a language tag
such as text or console (e.g., change the opening ``` to ```text) so the sample
output is syntax-highlighted and passes markdown linters; locate the specific
output block that contains the "NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP
PORT(S) AGE" table and add the identifier there.
- Around line 275-277: The example output code block in the markdown lacks a
language identifier; update the fenced code block that contains the line
"cpaas-system      cilium-l2announce-cilium-123-1-test       192.168.141.196    
24s" to use a language tag such as "text" or "console" (e.g., change ``` to
```text) so the snippet is properly highlighted and passes markdown linters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d0638d1-a8cf-435a-b5ab-82c17c8e8156

📥 Commits

Reviewing files that changed from the base of the PR and between a867802 and c8bf0f2.

📒 Files selected for processing (2)
  • docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
  • docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md

Comment on lines +148 to +210
```yaml
apiVersion: operator.alauda.io/v1alpha1
kind: BroadcastJob
metadata:
name: kube-proxy-cleanup
namespace: kube-system
spec:
completionPolicy:
ttlSecondsAfterFinished: 300
type: Always
failurePolicy:
type: FailFast
template:
metadata:
labels:
k8s-app: kube-proxy-cleanup
spec:
serviceAccountName: kube-proxy
hostNetwork: true
restartPolicy: Never
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-node-critical
tolerations:
- operator: Exists
containers:
- name: kube-proxy-cleanup
image: registry.alauda.cn:60070/tkestack/kube-proxy:v1.33.5 ## Replace with the kube-proxy image from Step 1
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- "/usr/local/bin/kube-proxy --config=/var/lib/kube-proxy/config.conf --hostname-override=$(NODE_NAME) --cleanup || true"
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
securityContext:
privileged: true
volumeMounts:
- mountPath: /var/lib/kube-proxy
name: kube-proxy
- mountPath: /lib/modules
name: lib-modules
readOnly: true
- mountPath: /run/xtables.lock
name: xtables-lock
volumes:
- name: kube-proxy
configMap:
name: kube-proxy
- name: lib-modules
hostPath:
path: /lib/modules
type: ""
- name: xtables-lock
hostPath:
path: /run/xtables.lock
type: FileOrCreate
EOF
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add missing heredoc command for YAML configuration.

The YAML block ends with EOF at line 209, but the beginning heredoc command is missing. Users need to know how to create the file with this content.

📝 Proposed fix

Add the heredoc command before the YAML block:

 3. Create a BroadcastJob to clean up kube-proxy rules:
 
+```bash
+cat > kube-proxy-cleanup.yaml << 'EOF'
+```
+
 ```yaml
 apiVersion: operator.alauda.io/v1alpha1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/en/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md`
around lines 148 - 210, Add the missing heredoc opener so the YAML can be
written to a file: insert a shell heredoc command (e.g., initiating a cat into
kube-proxy-cleanup.yaml with << 'EOF') immediately before the existing ```yaml
block for the BroadcastJob named kube-proxy-cleanup, keeping the ending EOF
already present; ensure you remove or adjust Markdown code fences if needed so
the heredoc writes the raw YAML (apiVersion: operator.alauda.io/v1alpha1, kind:
BroadcastJob, metadata.name: kube-proxy-cleanup) into the file.

Comment on lines +147 to +208
```yaml
apiVersion: operator.alauda.io/v1alpha1
kind: BroadcastJob
metadata:
name: kube-proxy-cleanup
namespace: kube-system
spec:
completionPolicy:
ttlSecondsAfterFinished: 300
type: Always
failurePolicy:
type: FailFast
template:
metadata:
labels:
k8s-app: kube-proxy-cleanup
spec:
serviceAccountName: kube-proxy
hostNetwork: true
restartPolicy: Never
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-node-critical
tolerations:
- operator: Exists
containers:
- name: kube-proxy-cleanup
image: registry.alauda.cn:60070/tkestack/kube-proxy:v1.33.5 ## 替换成当前环境的 kube-proxy 镜像
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- "/usr/local/bin/kube-proxy --config=/var/lib/kube-proxy/config.conf --hostname-override=$(NODE_NAME) --cleanup || true"
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
securityContext:
privileged: true
volumeMounts:
- mountPath: /var/lib/kube-proxy
name: kube-proxy
- mountPath: /lib/modules
name: lib-modules
readOnly: true
- mountPath: /run/xtables.lock
name: xtables-lock
volumes:
- name: kube-proxy
configMap:
name: kube-proxy
- name: lib-modules
hostPath:
path: /lib/modules
type: ""
- name: xtables-lock
hostPath:
path: /run/xtables.lock
type: FileOrCreate
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

添加缺失的 heredoc 命令来创建 YAML 配置文件。

YAML 代码块缺少开头的 heredoc 命令。用户需要知道如何使用此内容创建文件。

📝 建议的修复

在 YAML 代码块之前添加 heredoc 命令:

 3. 创建清理的 BroadcastJob:
 
+```bash
+cat > kube-proxy-cleanup.yaml << 'EOF'
+```
+
 ```yaml
 apiVersion: operator.alauda.io/v1alpha1

并在 YAML 末尾添加:

           type: FileOrCreate
+EOF

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/zh/solutions/Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
around lines 147 - 208, The YAML snippet for the BroadcastJob (metadata.name:
kube-proxy-cleanup) is missing the heredoc wrapper to create a file; wrap the
YAML with a bash heredoc to write to kube-proxy-cleanup.yaml by adding a leading
line like cat > kube-proxy-cleanup.yaml << 'EOF' before the ```yaml block and a
closing EOF after the end of the YAML so the BroadcastJob manifest
(kube-proxy-cleanup) is correctly emitted to the file.


</details>

<!-- fingerprinting:phantom:triton:puma -->

<!-- This is an auto-generated comment by CodeRabbit -->

@changluyi changluyi force-pushed the feature/cilium-ebpf-doc-alauda branch from c8bf0f2 to f372acc Compare March 25, 2026 06:04
@changluyi changluyi requested a review from a team March 25, 2026 06:04
@changluyi changluyi force-pushed the feature/cilium-ebpf-doc-alauda branch from f372acc to 1cf3ef3 Compare March 25, 2026 06:06
@changluyi changluyi force-pushed the feature/cilium-ebpf-doc-alauda branch from 1cf3ef3 to 3ade6ab Compare March 25, 2026 06:08
@changluyi changluyi force-pushed the feature/cilium-ebpf-doc-alauda branch from 3ade6ab to 9aeba64 Compare March 25, 2026 06:12
- 添加 VIP 二层网络要求说明
- 添加 Custom(自定义)模式描述
- 生成英文版文档

(cherry picked from commit f823a0122ba89d5658d160588d5040b750d3c72c)
@changluyi changluyi force-pushed the feature/cilium-ebpf-doc-alauda branch from 9aeba64 to 3ee2bde Compare March 25, 2026 06:26
- 修复 violet push 命令中 CLUSTER_NAME 变量引用
- 移除英文版多余的 EOF
- 为输出示例添加 text 语言标识符
- Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
  -> How_to_Deploy_Cilium_eBPF_L4_LoadBalancer_with_Source_IP_Preservation.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant