diff --git a/kube-manifests/01-Webserver-Apps/01-NginxApp1-Deployment.yml b/kube-manifests/01-Webserver-Apps/01-NginxApp1-Deployment.yml index 8cea3f9..c63f281 100644 --- a/kube-manifests/01-Webserver-Apps/01-NginxApp1-Deployment.yml +++ b/kube-manifests/01-Webserver-Apps/01-NginxApp1-Deployment.yml @@ -5,7 +5,7 @@ metadata: labels: app: app1-nginx spec: - replicas: 1 + replicas: 2 # Increased for high availability selector: matchLabels: app: app1-nginx @@ -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 - \ No newline at end of file +These changes improve application reliability, scalability, and overall deployment stability in a Kubernetes environment.