This guide outlines the deployment process for the Nginx service using AWS Blue-Green deployment strategy. Nginx acts as the front-facing server directing traffic to the backend Phalcon service. We utilize AWS services such as ECS Fargate, CodePipeline for CI/CD, AWS App Mesh, AWS Cloud Map, ALB (Application Load Balancer), and NLB (Network Load Balancer) for effective deployment and service orchestration.
- AWS ECS Fargate
- AWS CodePipeline
- AWS App Mesh
- AWS Cloud Map
- AWS ECR (Elastic Container Registry)
- ALB (Application Load Balancer)
- NLB (Network Load Balancer)
- Dockerfile: Defines the Nginx container setup.
- appspec.yaml: Specifies the ECS service and its configurations.
- taskdef.json: Defines the ECS task configuration for Nginx.
- nginx.conf: Nginx server configuration handling routing and PHP requests.
- Blue-Green deployment ensures zero-downtime deployment and rollback capabilities by creating a separate set of resources for the new version (Green) while keeping the old version (Blue) intact.
- ALB: Routes traffic to Nginx.
- NLB: Routes traffic to Phalcon backend (PHP).
- Proxy Configuration: Manages traffic routing and service discovery between Nginx and Phalcon containers using AWS App Mesh.
- CodePipeline: Initiates deployment upon code changes.
- Build & Test (CI): Code changes are built and tested.
- Blue-Green Deployment:
- Blue Environment: Existing stable environment.
- Green Environment: New environment with updates.
- Traffic Routing:
- ALB: Routes traffic to the Nginx container in the Blue or Green environment.
- NLB: Routes traffic to the Phalcon backend (PHP).
- AWS App Mesh:
- Facilitates seamless communication between Nginx and Phalcon containers.
- Provides service discovery and routing capabilities.
- Rollback:
- If issues arise, rollback to the stable Blue environment is seamless.
This deployment strategy ensures reliable and scalable deployment of the Nginx service with minimal downtime and risk. By leveraging AWS services like ECS, CodePipeline, ALB, NLB, and AWS App Mesh, the deployment process is streamlined, offering flexibility and efficiency in managing containerized applications.