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
20 changes: 20 additions & 0 deletions nginx-platform-app/README.md
Original file line number Diff line number Diff line change
@@ -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

43 changes: 43 additions & 0 deletions nginx-platform-app/deployment.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions nginx-platform-app/service.yml
Original file line number Diff line number Diff line change
@@ -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