From 6227892d666343a741fe4db9ae0425fff0dd1e28 Mon Sep 17 00:00:00 2001 From: Shraddha Naik Date: Thu, 5 Feb 2026 15:27:20 +0530 Subject: [PATCH] add nginx platform application example with production-grade YAML --- nginx-platform-app/README.md | 20 ++++++++++++++ nginx-platform-app/deployment.yml | 43 +++++++++++++++++++++++++++++++ nginx-platform-app/service.yml | 12 +++++++++ 3 files changed, 75 insertions(+) create mode 100644 nginx-platform-app/README.md create mode 100644 nginx-platform-app/deployment.yml create mode 100644 nginx-platform-app/service.yml diff --git a/nginx-platform-app/README.md b/nginx-platform-app/README.md new file mode 100644 index 000000000..22feb3bc4 --- /dev/null +++ b/nginx-platform-app/README.md @@ -0,0 +1,20 @@ +# Nginx Platform Application Example + +This example demonstrates a production-style Kubernetes deployment using Nginx with: + +- Resource requests and limits +- Readiness and liveness probes +- Service exposure using ClusterIP +- Clean label/selector architecture +- Separation of concerns (deployment + service) + +## Files +- `deployment.yaml` – Application deployment configuration +- `service.yaml` – Internal service exposure + +## How to deploy + +```bash +kubectl apply -f deployment.yaml +kubectl apply -f service.yaml + diff --git a/nginx-platform-app/deployment.yml b/nginx-platform-app/deployment.yml new file mode 100644 index 000000000..0a70cca0f --- /dev/null +++ b/nginx-platform-app/deployment.yml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-platform-app + labels: + app: nginx-platform-app +spec: + replicas: 2 + selector: + matchLabels: + app: nginx-platform-app + template: + metadata: + labels: + app: nginx-platform-app + spec: + containers: + - name: nginx + image: nginx:stable + ports: + - containerPort: 80 + + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "300m" + memory: "256Mi" + + readinessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 5 + periodSeconds: 10 + + livenessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 15 + periodSeconds: 20 diff --git a/nginx-platform-app/service.yml b/nginx-platform-app/service.yml new file mode 100644 index 000000000..5c6ec4bf4 --- /dev/null +++ b/nginx-platform-app/service.yml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx-platform-service +spec: + type: ClusterIP + selector: + app: nginx-platform-app + ports: + - protocol: TCP + port: 80 + targetPort: 80