๐Ÿš€ DevOps Training Wheels

๐ŸŒ Project Domains & Endpoints

GitHub: devops_tw

๐ŸŒ API Endpoints

Endpoint Description Method Response
/ Home Endpoint GET Welcome message
/status Application Status GET JSON status
/pic Random Image Retrieval GET Static image
/health Health Check GET Health status
/joke Joke Endpoint GET A random joke
/echo Echo Endpoint POST Echoes the input JSON
/weather Weather Information GET Weather info from wttr.in

๐Ÿงช Testing the Application


# API Endpoint Tests
curl -kL https://devops-tw.up.railway.app/
curl -kL https://devops-tw.up.railway.app/status
curl -kL https://devops-tw.up.railway.app/pic
curl -kL https://devops-tw.up.railway.app/health
curl -kL https://devops-tw.up.railway.app/joke
curl -kL -X POST https://devops-tw.up.railway.app/echo -d '{"key":"value"}'
curl -kL https://devops-tw.up.railway.app/weather
            

๐Ÿ›  How I Did It: A Personal Journey

When I first approached this DevOps assignment, I initially went with railway.app as my PaaS in order to develop an MVP as soon as possible and learn the concepts of DevOps. Once I gained the knowledge of basic DevOps, I moved to AWS. It was rough in the beginning stages of development since I had never used AWS before. Understanding the components of AWS was the biggest hurdle. But in the end, I created this MVP. The only thing left to do is moving from self-signed to CA-signed SSL certificate.

Step-by-Step Development Process

  1. Cloud Provider Selection
    • Chose AWS for its comprehensive services and wide recognition
    • Created an AWS account
    • Generated IAM user credentials
  2. Local Development
    • Developed a simple Flask application
    • Created basic API endpoints
    • Structured the application for containerization
  3. Containerization
    
          # Dockerfile creation
          docker build -t devops_tw-flask-api .
          
          # Local testing
          docker run -p 3000:3000 devops_tw-flask-api
                      
  4. Infrastructure as Code
    • Used Terraform to define infrastructure
    • Created security groups
    • Provisioned an EC2 instance
    • Set up an Elastic IP
    • Created an ECR repository
  5. Deployment Strategy
    • Used Docker Compose for container orchestration
    • Configured Nginx as a reverse proxy
    • Implemented SSL termination

Security Considerations

๐Ÿ” Technical Architecture

Infrastructure Components:

๐Ÿ“Š Project Diagram

Development Workflow Development Workflow

๐Ÿ”’ Security Highlights

๐Ÿšข Previous Iteration: Railway.app

Initial Project: Domain: shavok.up.railway.app

Approach:Developing on Railway was super simple, since it took care of most of things, ranging from default secure environment variable to auto-detecting Dockerfile and deploying it.

๐Ÿ” Comparative Analysis

Aspect Railway.app AWS Solution
Deployment Complexity Low High
Infrastructure Control Limited Comprehensive
Scalability Basic Advanced
Cost Free Tier Flexible, Pay-as-you-go
Security Configuration Basic Extensive

๐Ÿš€ Lessons Learned