Skip to content
Open
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
53 changes: 48 additions & 5 deletions kube-manifests/01-Webserver-Apps/01-NginxApp1-Deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app: app1-nginx
spec:
replicas: 1
replicas: 2 # Increased for high availability
selector:
matchLabels:
app: app1-nginx
Expand All @@ -14,14 +14,57 @@ spec:
labels:
app: app1-nginx
spec:
nodeSelector:
app: system-apps # Scheduling on specific nodes

containers:
- name: app1-nginx
image: stacksimplify/kube-nginxapp1:1.0.0
imagePullPolicy: IfNotPresent

ports:
- containerPort: 80
# To schedule pods on based on NodeSelectors
nodeSelector:
app: system-apps

resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "250m"
memory: "256Mi"

livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 15

readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 10

env:
- name: ENV
value: "production"

restartPolicy: Always

### Summary
Improved Kubernetes deployment configuration to make it more production-ready.

### Changes Made

- Increased replicas from 1 to 2 for better availability
- Added resource requests and limits for efficient resource management
- Introduced liveness and readiness probes for health monitoring
- Added imagePullPolicy to optimize image usage
- Included environment variable configuration
- Improved YAML structure and readability

### Impact

These changes improve application reliability, scalability, and overall deployment stability in a Kubernetes environment.