Skip to content

Conversation

zrggw
Copy link
Contributor

@zrggw zrggw commented Aug 25, 2025

modified ipsec user guide according to the review of PR #105

The PR submitted earlier (#210) was based on an outdated main branch. Therefore, it has been resubmitted on the new main branch.

Copy link

netlify bot commented Aug 25, 2025

Deploy Preview for kmesh-net ready!

Name Link
🔨 Latest commit 3a595d6
🔍 Latest deploy log https://app.netlify.com/projects/kmesh-net/deploys/68ac2d30d02d4900089bc9ea
😎 Deploy Preview https://deploy-preview-226--kmesh-net.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @zrggw, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the IPsec user guide within the Kmesh documentation, specifically revamping the kmeshctl-secret.md file. The changes aim to provide a comprehensive guide on enabling and managing IPsec for inter-node communication in a Kmesh cluster, addressing feedback from a previous review and resubmitting content that was initially based on an outdated branch.

Highlights

  • Comprehensive IPsec Guide: The kmeshctl-secret.md file has been transformed into a detailed user guide for implementing IPsec in Kmesh clusters.
  • Step-by-Step Configuration: New sections outline the process of generating IPsec pre-shared keys, configuring Kmesh YAML, and labeling namespaces for Kmesh management.
  • Verification and Key Rotation: Instructions are provided for testing IPsec encryption using tcpdump and for replacing pre-shared keys.
  • Important Considerations: Added notes highlight potential conflicts with IPsec marks and issues with address MASQ when using IPsec.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the IPsec user guide, replacing the old kmeshctl secret documentation with a more comprehensive guide on enabling IPsec in a Kmesh cluster. The new guide is well-structured and provides step-by-step instructions. I've provided a few suggestions to improve clarity, fix a misleading example, and correct some minor formatting and wording issues to make the documentation even more helpful for users.

-h, --help help for secret
-k, --key string key of the encryption
``` bash
kmeshctl secret --key=$(echo -n "{36-bytes user-defined key here}" | xxd -p -c 64)

Choose a reason for hiding this comment

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

high

The example command for using a custom key is misleading. The placeholder string "{36-bytes user-defined key here}" is not 36 bytes long, which is the required length for the key. This could cause users to generate an invalid key. Please provide an example with a string that is exactly 36 bytes long to avoid confusion.

Suggested change
kmeshctl secret --key=$(echo -n "{36-bytes user-defined key here}" | xxd -p -c 64)
kmeshctl secret --key=$(echo -n 'a-36-byte-long-secret-key-for-ipsec' | xxd -p -c 64)

Comment on lines +41 to +47
kmesh.yaml
...
args:
[
"./start_kmesh.sh --mode=dual-engine --enable-bypass=false --enable-ipsec=true",
]
...

Choose a reason for hiding this comment

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

medium

The YAML example has unusual formatting for the list under args. The indentation of the brackets [ and ] is incorrect, which could confuse users. Using the standard block-style sequence for YAML lists is more common and readable.

Suggested change
kmesh.yaml
...
args:
[
"./start_kmesh.sh --mode=dual-engine --enable-bypass=false --enable-ipsec=true",
]
...
kmesh.yaml
...
args:
- "./start_kmesh.sh --mode=dual-engine --enable-bypass=false --enable-ipsec=true"
...

...
```

#### Step 5: Replace pre shared key

Choose a reason for hiding this comment

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

medium

For better readability and convention, "pre shared key" should be hyphenated.

Suggested change
#### Step 5: Replace pre shared key
#### Step 5: Replace pre-shared key


#### Step 5: Replace pre shared key

After a period of time, the pre-shared key of the cluster can be changed. After changing the pre-shared key, the ESP SPI number of the IPsec used for communication between nodes will be increased by 1 compared to the previous version. This can be observed again through using tcpdump. The initial IPSec SPI version number is 1

Choose a reason for hiding this comment

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

medium

This sentence can be made more concise and consistent with the casing of "IPsec" used elsewhere in the document.

Suggested change
After a period of time, the pre-shared key of the cluster can be changed. After changing the pre-shared key, the ESP SPI number of the IPsec used for communication between nodes will be increased by 1 compared to the previous version. This can be observed again through using tcpdump. The initial IPSec SPI version number is 1
After a period of time, the pre-shared key of the cluster can be changed. After changing the pre-shared key, the ESP SPI number of the IPsec used for communication between nodes will be increased by 1 compared to the previous version. This can be observed again through using tcpdump. The initial IPsec SPI is 1.


### Note

1. IPsec encryption uses mark `0xe0` and `0xd0` as markers for IPsec encryption and decryption. Please ensure that no conflicting Mark is used on the host network, otherwise unknown behavior may occur

Choose a reason for hiding this comment

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

medium

Minor wording improvements for clarity: "Mark" should be lowercase, and the phrasing about "unknown behavior" can be more direct.

Suggested change
1. IPsec encryption uses mark `0xe0` and `0xd0` as markers for IPsec encryption and decryption. Please ensure that no conflicting Mark is used on the host network, otherwise unknown behavior may occur
1. IPsec encryption uses mark `0xe0` and `0xd0` as markers for IPsec encryption and decryption. Please ensure that no conflicting mark is used on the host network, as this may cause unexpected behavior.


1. IPsec encryption uses mark `0xe0` and `0xd0` as markers for IPsec encryption and decryption. Please ensure that no conflicting Mark is used on the host network, otherwise unknown behavior may occur

2. Please ensure that `address MASQ` is not used on packets encrypted with IPsec. After address MASQ, IPsec cannot accurately match encryption and decryption rules, which can result in packet loss

Choose a reason for hiding this comment

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

medium

The term address MASQ might be unclear to some users. It would be helpful to clarify that this refers to address masquerading (like SNAT). Also, the sentence can be rephrased for better flow.

Suggested change
2. Please ensure that `address MASQ` is not used on packets encrypted with IPsec. After address MASQ, IPsec cannot accurately match encryption and decryption rules, which can result in packet loss
2. Please ensure that address masquerading (e.g., SNAT) is not used on packets encrypted with IPsec. If address masquerading is applied, IPsec cannot accurately match encryption and decryption rules, which can result in packet loss.

@hzxuzhonghu
Copy link
Member

/approve

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hzxuzhonghu
Copy link
Member

/lgtm

@kmesh-bot kmesh-bot added the lgtm label Aug 25, 2025
@kmesh-bot kmesh-bot merged commit bca8bc0 into kmesh-net:main Aug 25, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants