Skip to content

Add basic e-commerce kpt example#4440

Open
JarvisX-Z wants to merge 7 commits intokptdev:mainfrom
JarvisX-Z:main
Open

Add basic e-commerce kpt example#4440
JarvisX-Z wants to merge 7 commits intokptdev:mainfrom
JarvisX-Z:main

Conversation

@JarvisX-Z
Copy link

Hi, I created a simple e-commerce example to demonstrate how kpt can be used to manage Kubernetes packages.

This includes a basic deployment, service, and Kptfile to define the package.

I would appreciate feedback and suggestions for improvement.

Copilot AI review requested due to automatic review settings March 21, 2026 08:13
@netlify
Copy link

netlify bot commented Mar 21, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit bb3e90d
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69be573318c9d80008fd06c3
😎 Deploy Preview https://deploy-preview-4440--kptdocs.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.

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a basic e-commerce example to demonstrate how kpt can be used to manage Kubernetes packages. The example includes a simple Kubernetes deployment using nginx, a service to expose the application, a Kptfile to define the package metadata, and comprehensive documentation.

Changes:

  • Added a simple Kubernetes Deployment for an nginx-based e-commerce application with a pinned image version
  • Added a Kubernetes Service to expose the application internally
  • Added Kptfile with package metadata
  • Added README with overview, features, structure, and deployment instructions

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
ecommerce-example/deployment.yaml Kubernetes Deployment manifest for the e-commerce application using nginx:1.18.0
ecommerce-example/service.yaml Kubernetes Service manifest to expose the deployment
ecommerce-example/Kptfile kpt package metadata definition
ecommerce-example/README.md Documentation for the example package
Comments suppressed due to low confidence (1)

ecommerce-example/README.md:39

  • The README appears to be incomplete. It ends with an unclosed code block at line 38 ("```bash"). The documentation should include the complete instructions for deploying the application, as other examples like package-examples/guestbook provide comprehensive deployment instructions.
### 1. Deploy the application

**Option A: Using kubectl only**
```bash
kubectl apply -f deployment.yaml -f service.yaml


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,19 @@
apiVersion: apps/v1
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

YAML files in this repository follow a convention of including Apache 2.0 copyright headers (as seen in package-examples/nginx and other examples). This file is missing the copyright notice that is present in all other package example files.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,13 @@
apiVersion: v1
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

YAML files in this repository follow a convention of including Apache 2.0 copyright headers (as seen in package-examples/nginx and other examples). This file is missing the copyright notice that is present in all other package example files.

Copilot uses AI. Check for mistakes.
metadata:
name: ecommerce-example
info:
description: A simple e-commerce example using kpt
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

Kptfile is missing the emails field that is present in all other package examples (e.g., package-examples/nginx/Kptfile and package-examples/guestbook/Kptfile). This field should be added to the info section to follow the repository convention.

Suggested change
description: A simple e-commerce example using kpt
description: A simple e-commerce example using kpt
emails:
- ecommerce-maintainers@example.com

Copilot uses AI. Check for mistakes.
Updated README to provide a clearer overview and structure of the e-commerce application. Removed redundant sections and improved formatting.
Updated README to enhance project overview and features.
Copilot AI review requested due to automatic review settings March 21, 2026 08:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +6
name: ecommerce-example
info:
description: A simple e-commerce example using kpt
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The example package is placed at the repository root level (ecommerce-example/) rather than in the package-examples/ directory where all other example packages are located. This breaks the established codebase convention. Consider moving this to package-examples/ecommerce to maintain consistency with the existing package organization (e.g., package-examples/nginx, package-examples/guestbook, etc.).

Suggested change
name: ecommerce-example
info:
description: A simple e-commerce example using kpt
name: ecommerce
info:
description: A simple e-commerce package using kpt

Copilot uses AI. Check for mistakes.
metadata:
name: ecommerce-example
info:
description: A simple e-commerce example using kpt
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The Kptfile is missing the pipeline section with validators, which is a standard part of all other example packages in the repository (see package-examples/nginx/Kptfile and package-examples/guestbook/Kptfile). Adding a kubeconform validator would be consistent with existing examples and help users learn about kpt's validation capabilities.

Suggested change
description: A simple e-commerce example using kpt
description: A simple e-commerce example using kpt
pipeline:
validators:
- image: ghcr.io/GoogleContainerTools/kpt-functions/kubeconform:v0.0.1
configMap:
strict: "true"

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +38
**Option A: Using kubectl only**
```bash
kubectl apply -f deployment.yaml -f service.yaml
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The README.md file appears to be incomplete. The diff shows the file ends at line 38 with an unclosed bash code block, but line 39 exists (total of 39 lines). The documentation cuts off mid-sentence and does not include the complete "How to Use" section. Please complete the README with instructions for deploying with kpt.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants