Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]OSPP Support Kubernetes ConfigMap for Apollo java, golang client #5233

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dyx1234
Copy link

@dyx1234 dyx1234 commented Sep 20, 2024

What's the purpose of this PR

docs for pr apolloconfig/apollo-java#79
discussion #5210

Brief changelog

Follow this checklist to help us incorporate your contribution quickly and easily:

[✅] Read the Contributing Guide before making this pull request.
[✅] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[✅] Write necessary unit tests to verify the code.
[❌] Run mvn clean test to make sure this pull request doesn't break anything.
[❌] Update the CHANGES log.

Summary by CodeRabbit

  • New Features

    • Updated Java SDK user guide to include ConfigMap caching information for Kubernetes environments (versions 2.4.0 and above).
    • Introduced new configuration properties for managing ConfigMap caching.
  • Documentation

    • Enhanced documentation detailing the structure of cached configuration data and necessary permissions for client pods.
    • Added a new section "ConfigMap缓存设置" outlining how to cache configuration information in ConfigMaps.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 20, 2024
Copy link
Contributor

coderabbitai bot commented Sep 20, 2024

Walkthrough

The documentation for the Java SDK user guide has been updated to include new information about ConfigMap caching in Kubernetes environments for versions 2.4.0 and above. It details how clients can cache configuration data in ConfigMaps, enhancing availability during service outages and network issues. New configuration properties are introduced, specifying the structure of cached data, and comprehensive instructions for granting necessary permissions to client pods are provided.

Changes

Files Change Summary
docs/en/client/java-sdk-user-guide.md Updated to include details on ConfigMap caching, configuration properties, and permissions for Service Accounts.
docs/zh/client/java-sdk-user-guide.md Added a new section "ConfigMap缓存设置" detailing ConfigMap caching settings, required configuration properties, and permissions for Service Accounts.

Poem

In the fields where rabbits play,
A new guide has come our way!
With ConfigMaps to help us thrive,
Caching secrets, we’ll survive!
Hop along, let’s cheer and sing,
For better configs, joy they bring! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

Outside diff range and nitpick comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

430-430: TODO: Add the guide for setting read/write permissions.

Please remember to add the guide for setting the necessary read/write permissions for the client pod to access the ConfigMap, as mentioned in the placeholder comment.

Do you want me to open a GitHub issue to track this task?

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 31e6486 and 315e7f9.

Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (2 hunks)
Additional context used
Markdownlint
docs/zh/client/java-sdk-user-guide.md

409-409: null
No empty links

(MD042, no-empty-links)

Additional comments not posted (4)
docs/zh/client/java-sdk-user-guide.md (4)

403-431: Great addition to enhance availability in Kubernetes environments!

The new feature to cache configurations in a ConfigMap is a valuable addition to enhance the availability of the Apollo client in Kubernetes environments. The documentation clearly explains the purpose, configuration properties, and structure of the cached data.

Tools
Markdownlint

409-409: null
No empty links

(MD042, no-empty-links)


403-403: Useful new configuration property for flexibility!

The new apollo.override-system-properties configuration property in version 2.1.0+ is a helpful addition to provide flexibility in controlling whether Apollo's remote properties should override Java's system properties. The documentation clearly explains its purpose and the order of precedence for configuration.


407-407: Helpful new configuration property for gray releases!

The new apollo.label configuration property is a useful addition to allow specifying the label information for the application, which is important for configuring gray release rules. The documentation clearly explains its purpose and the order of precedence for configuration.


Line range hint 453-453: Excellent support for Spring Boot 2.4+ and WebClient extension!

The addition of Config Data Loader support for Spring Boot 2.4+ and Apollo Client 1.9.0+, along with the ability to extend the HTTP client using WebClient, is a great enhancement. The documentation provides clear instructions on the required dependencies, configuration properties, and the extensibility point for customizing the WebClient through an SPI implementation.

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: 0

🧹 Outside diff range and nitpick comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

403-489: Comprehensive guide on ConfigMap caching in Kubernetes.

This new section provides detailed information about ConfigMap caching for Apollo clients in Kubernetes environments. It covers:

  1. Version compatibility
  2. Configuration properties
  3. Naming conventions for ConfigMaps
  4. Steps to grant necessary permissions to the Pod's Service Account

The content is well-structured and informative. However, there are a few minor improvements that could be made:

  1. The code blocks for Kubernetes resources (ServiceAccount, Role, RoleBinding, Pod) are not specified with a language. Adding yaml as the language would improve syntax highlighting.

  2. The numbered list for granting permissions is not properly formatted in Markdown, which may affect rendering.

Consider applying the following changes to improve formatting:

  1. Add yaml to the code blocks. For example:
-   ```
+   ```yaml
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: my-service-account
      namespace: my-namespace
    ```

2. Fix the numbered list formatting by adding a blank line after each item. For example:

```diff
1. 创建Service Account: 如果还没有Service Account,你需要创建一个。
+
2. 创建Role或ClusterRole: 定义一个Role或ClusterRole,授予对特定ConfigMap的读写权限。如果ConfigMap是跨多个Namespace使用的,应该使用ClusterRole。
+
3. 绑定Service Account到Role或ClusterRole: 使用RoleBinding或ClusterRoleBinding将Service Account绑定到上面创建的Role或ClusterRole。

These changes will improve the readability and rendering of the documentation.

🧰 Tools
🪛 Markdownlint

440-440: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


452-452: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


468-468: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


481-481: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 315e7f9 and 9a1e7e2.

📒 Files selected for processing (1)
  • docs/zh/client/java-sdk-user-guide.md (2 hunks)
🧰 Additional context used
🪛 Markdownlint
docs/zh/client/java-sdk-user-guide.md

440-440: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


452-452: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


468-468: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


481-481: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/zh/client/java-sdk-user-guide.md (1)

166-167: Informative addition about local file caching.

This note provides valuable information about the dual caching mechanism when using ConfigMap in Kubernetes environments. It enhances the user's understanding of the caching strategy.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 29, 2024
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: 0

🧹 Outside diff range and nitpick comments (5)
docs/zh/client/java-sdk-user-guide.md (1)

403-490: Comprehensive addition of ConfigMap caching information.

This new section provides detailed information about ConfigMap caching in Kubernetes environments for Apollo client version 2.4.0 and above. The content is well-structured and informative, covering:

  1. Version applicability
  2. Purpose and benefits of ConfigMap caching
  3. Configuration properties
  4. Structure of cached data
  5. Detailed instructions for granting necessary permissions

The information appears to be complete and valuable for users implementing Apollo in Kubernetes environments.

However, there are a few minor improvements that could be made:

  1. Consider adding a brief introduction explaining why ConfigMap caching is beneficial in Kubernetes environments.
  2. The code blocks for Kubernetes configurations (ServiceAccount, Role, RoleBinding, Pod) should have a language specifier for proper syntax highlighting.

To improve readability and syntax highlighting, add language specifiers to the code blocks. For example:

-   ```
+   ```yaml
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: my-service-account
      namespace: my-namespace
    ```

Apply similar changes to the other code blocks in this section.

🧰 Tools
🪛 Markdownlint

440-440: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


452-452: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


468-468: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


481-481: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/en/client/java-sdk-user-guide.md (4)

457-460: Add language specification to the code block

To improve readability and enable proper syntax highlighting, please add a language specification to this code block. For YAML content, you can add yaml after the opening triple backticks.

Example:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-service-account
  namespace: my-namespace
🧰 Tools
🪛 Markdownlint

457-457: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


469-482: Add language specification to the code block

To improve readability and enable proper syntax highlighting, please add a language specification to this code block. For YAML content, you can add yaml after the opening triple backticks.

Example:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: my-namespace
  name: configmap-reader
rules:
- apiGroups: [""]
  resources: ["configmaps"]
  verbs: ["get", "watch", "list", "update", "patch"]
🧰 Tools
🪛 Markdownlint

469-469: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


485-496: Add language specification to the code block

To improve readability and enable proper syntax highlighting, please add a language specification to this code block. For YAML content, you can add yaml after the opening triple backticks.

Example:

apiVersion: v1
kind: Pod
metadata:
  name: my-pod
  namespace: my-namespace
spec:
  serviceAccountName: my-service-account
  containers:
  - name: my-container
    image: my-image
🧰 Tools
🪛 Markdownlint

485-485: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


498-503: Add language specification to the code block

To improve readability and enable proper syntax highlighting, please add a language specification to this code block. For shell commands, you can add bash after the opening triple backticks.

Example:

kubectl apply -f service-account.yaml
kubectl apply -f role.yaml
kubectl apply -f role-binding.yaml
kubectl apply -f pod.yaml
🧰 Tools
🪛 Markdownlint

498-498: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 9a1e7e2 and 811b6e2.

📒 Files selected for processing (2)
  • docs/en/client/java-sdk-user-guide.md (2 hunks)
  • docs/zh/client/java-sdk-user-guide.md (2 hunks)
🧰 Additional context used
🪛 Markdownlint
docs/en/client/java-sdk-user-guide.md

457-457: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


469-469: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


485-485: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


498-498: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

docs/zh/client/java-sdk-user-guide.md

440-440: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


452-452: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


468-468: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


481-481: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
docs/zh/client/java-sdk-user-guide.md (1)

166-167: Approved: Clear note about local file caching.

This note provides important information about the behavior of caching in Kubernetes environments. It's clear and concise.

docs/en/client/java-sdk-user-guide.md (1)

418-506: Excellent addition of ConfigMap caching documentation!

The new section on ConfigMap caching for Kubernetes environments is a valuable addition to the documentation. It provides clear instructions and examples for setting up this feature. Here are a few suggestions to further improve the content:

  1. Consider adding a brief explanation of the benefits of using ConfigMap caching in Kubernetes environments.
  2. It might be helpful to mention any potential drawbacks or considerations when using this feature.
  3. The permissions setup instructions are comprehensive, but consider adding a note about security best practices when granting these permissions.

Overall, this is a well-written and informative addition to the documentation.

🧰 Tools
🪛 Markdownlint

457-457: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


469-469: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


485-485: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


498-498: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

@nobodyiam nobodyiam added this to the 2.4.0 milestone Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants