Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ecommerce-example/Kptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kpt.dev/v1
kind: Kptfile
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.
Comment on lines +4 to +6
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.
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.
38 changes: 38 additions & 0 deletions ecommerce-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# E-commerce Example (kpt)

This is a simple e-commerce application example packaged using **kpt**.

---

## 📌 Overview

This project demonstrates how Kubernetes applications can be managed and customized using the **kpt toolchain**.

Instead of modifying code, users can change configuration using YAML files.

---

## 🚀 Features

- Simple Kubernetes Deployment using **nginx** (version pinned for reproducibility)
- Service to expose the application internally
- Easy-to-understand structure for beginners
- Ready to extend with custom configuration

---

## 📂 Structure

- `deployment.yaml` → Defines the application Deployment
- `service.yaml` → Exposes the application via a Service
- `Kptfile` → Defines the kpt package metadata

---

## ⚙️ How to Use

### 1. Deploy the application

**Option A: Using kubectl only**
```bash
kubectl apply -f deployment.yaml -f service.yaml
Comment on lines +36 to +38
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.
19 changes: 19 additions & 0 deletions ecommerce-example/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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.
kind: Deployment
metadata:
name: ecommerce-deployment
spec:
replicas: 1
selector:
matchLabels:
app: ecommerce
template:
metadata:
labels:
app: ecommerce
spec:
containers:
- name: ecommerce-container
image: nginx:1.18.0
ports:
- containerPort: 80
13 changes: 13 additions & 0 deletions ecommerce-example/service.yaml
Original file line number Diff line number Diff line change
@@ -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.
kind: Service
metadata:
name: ecommerce-service
labels:
app: ecommerce
spec:
selector:
app: ecommerce
ports:
- protocol: TCP
port: 80
targetPort: 80
Loading