Skip to content

Conversation

@oilbeater
Copy link
Member

@oilbeater oilbeater commented Nov 6, 2025

Summary by CodeRabbit

  • Documentation
    • Added comprehensive API reference documentation for Kubernetes networking resources, including HTTPRoute, Service, VpcEgressGateway, and Vpc.
    • Included CustomResourceDefinition specifications for VpcEgressGateway and Vpc resources with detailed schema validation and configuration options.
    • Added networking APIs index page for improved API documentation organization.

Signed-off-by: oilbeater <liumengxinfly@gmail.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

This PR adds comprehensive documentation and Kubernetes CustomResourceDefinition (CRD) files for networking APIs. It introduces new MDX documentation pages for HTTPRoute, Service, Vpc, and VpcEgressGateway resources, alongside two YAML CRD definitions for Vpc and VpcEgressGateway under the kubeovn.io API group.

Changes

Cohort / File(s) Summary
Networking API Documentation
docs/en/apis/kubernetes_apis/networking/index.mdx, docs/en/apis/kubernetes_apis/networking/service.mdx, docs/en/apis/kubernetes_apis/networking/httproute.mdx
New MDX documentation pages for Kubernetes networking APIs (HTTPRoute, Service) with index page and API reference metadata.
VPC Documentation
docs/en/apis/kubernetes_apis/networking/vpc.mdx, docs/en/apis/kubernetes_apis/networking/vpc-egress-gateway.mdx
New MDX pages documenting Vpc and VpcEgressGateway CRDs with K8sCrd references.
CRD Definitions
docs/shared/crds/kubeovn.io_vpc-egress-gateways.yaml, docs/shared/crds/kubeovn.io_vpcs.yaml
New Kubernetes CustomResourceDefinition YAML files defining VpcEgressGateway and Vpc resources with comprehensive OpenAPI schemas, validation rules, and status subresources.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~20 minutes

  • CRD schema complexity: The Vpc CRD (kubeovn.io_vpcs.yaml) contains extensive schema definitions with nested objects, validation patterns (IPv4/IPv6/CIDR), and x-kubernetes-validations rules that require careful verification.
  • VpcEgressGateway CRD: Similar complexity with IP address validation arrays, BFD settings, policies, and scale subresource mappings.
  • Documentation accuracy: Verify that CRD references in MDX files correctly match the corresponding YAML definitions.

Possibly related PRs

Suggested reviewers

  • fanzy618

Poem

🐰 Through Kubernetes networks, new paths we trace,
Vpc gateways find their rightful place,
With CRDs carved in YAML so fine,
Documentation blooms—a networking design!
Let the bytes flow freely, oh what delight! 🚀

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'add networking api' is vague and doesn't specify which networking APIs are being added or what changes are included in the changeset. Consider a more descriptive title such as 'Add Kubernetes networking API documentation (HTTPRoute, Service, VPC, VpcEgressGateway)' that clearly identifies the specific APIs and resources being documented.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch network-api-master

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 6, 2025

Deploying alauda-container-platform with  Cloudflare Pages  Cloudflare Pages

Latest commit: f25898e
Status: ✅  Deploy successful!
Preview URL: https://e08439b6.alauda-container-platform.pages.dev
Branch Preview URL: https://network-api-master.alauda-container-platform.pages.dev

View logs

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

🧹 Nitpick comments (5)
docs/en/apis/kubernetes_apis/networking/httproute.mdx (1)

1-5: Minimal scaffolding—consider adding documentation content.

The page is currently empty except for a component reference. While this may be intentional scaffolding, consider populating it with a brief description of the HTTPRoute API, key fields, or a "Coming Soon" note to set expectations.

docs/en/apis/kubernetes_apis/networking/vpc.mdx (1)

1-5: Minimal scaffolding—consistent with HTTPRoute but incomplete.

Like httproute.mdx, this page contains only a component reference with no documentation content. Consider adding descriptive content to guide users on the Vpc resource and its usage.

docs/en/apis/kubernetes_apis/networking/index.mdx (1)

1-6: Add frontmatter metadata and populate overviewHeaders.

The index page has empty frontmatter and an empty overviewHeaders array. For a hub page, consider adding metadata (title, description) and populating the headers array with relevant networking API sections.

docs/en/apis/kubernetes_apis/networking/vpc-egress-gateway.mdx (1)

1-5: Minimal scaffolding—add documentation content.

Like the other API pages, this contains only a component reference. Add descriptive content explaining VpcEgressGateway's purpose, configuration options, and usage patterns.

docs/shared/crds/kubeovn.io_vpcs.yaml (1)

89-130: BFD port structure includes complex nested selector but lacks description.

The bfdPort object nests an IP field with complex validation patterns and a full nodeSelector structure. While the schema is correct, consider adding descriptions to the properties (especially the IP format constraints) to help operators understand the valid formats. This is optional but would improve usability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99a8e01 and f25898e.

📒 Files selected for processing (7)
  • docs/en/apis/kubernetes_apis/networking/httproute.mdx (1 hunks)
  • docs/en/apis/kubernetes_apis/networking/index.mdx (1 hunks)
  • docs/en/apis/kubernetes_apis/networking/service.mdx (1 hunks)
  • docs/en/apis/kubernetes_apis/networking/vpc-egress-gateway.mdx (1 hunks)
  • docs/en/apis/kubernetes_apis/networking/vpc.mdx (1 hunks)
  • docs/shared/crds/kubeovn.io_vpc-egress-gateways.yaml (1 hunks)
  • docs/shared/crds/kubeovn.io_vpcs.yaml (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/en/apis/kubernetes_apis/networking/service.mdx

[grammar] ~1-~1: Il y a peut-être une erreur ici
Context: # Service [v1]

(QB_NEW_FR)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
docs/en/apis/kubernetes_apis/networking/service.mdx (1)

1-5: Content looks good—documenting standard Kubernetes Service endpoints.

The file correctly documents the two primary Kubernetes Service API operations (list and get) with appropriate path prefixes for cluster-scoped routing. Static analysis flagged a false positive French grammar check which can be ignored.

docs/shared/crds/kubeovn.io_vpc-egress-gateways.yaml (3)

156-164: IP size validations assume non-empty array—verify intent.

Lines 157-158 and 160-161 use conditions like !has(self.internalIPs) || size(self.internalIPs) == 0 || size(self.internalIPs) >= self.replicas. This allows either unset/empty IPs or IPs >= replicas. Confirm this permits valid use cases where IPs are intentionally omitted or empty in certain scenarios.


256-284: Validation for selectors is sound but verbose.

The namespace and pod selector validations (lines 256-258 and 282-284) correctly enforce that each selector must have at least one of matchLabels or matchExpressions. This is consistent and correct.


51-62: Scale subresource configuration looks correct.

The scale subresource properly maps spec.replicas (write), status.replicas, and status.labelSelector (read). This enables kubectl scale and Horizontal Pod Autoscaler integration correctly.

docs/shared/crds/kubeovn.io_vpcs.yaml (2)

131-133: BFD port IP validation correctly enforces enablement constraint.

The validation rule "self.enabled == false || self.ip != ''" correctly ensures that when BFD Port is enabled, an IP must be set. This constraint is logically sound and appropriately enforced.


1-5: CRD structure and metadata are correct.

The CRD uses proper apiVersion (apiextensions.k8s.io/v1), kind, metadata, and defines a cluster-scoped resource with v1 as the served and storage version. The names (Vpc, vpcs, vpc, VpcList) follow Kubernetes naming conventions.

@oilbeater oilbeater merged commit e394055 into master Nov 6, 2025
4 checks passed
@oilbeater oilbeater deleted the network-api-master branch November 6, 2025 06:20
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.

2 participants