Module 8 - Microservices & Containerization

Lab 1: Create a Simple Microservice

  1. How do you build a basic microservice using Python Flask, Node.js Express, or Java Spring Boot that returns a JSON response?

  2. How do you create and test a /health endpoint?


Lab 2: Run the Microservice in a Docker Container

  1. How do you write a Dockerfile for the microservice?

  2. How do you build the Docker image?

  3. How do you run the container?

  4. How do you test the service using a browser, curl, or Postman?


Lab 3: Create and Use Docker Volumes

  1. How do you update the microservice to generate logs or store data?

  2. How do you attach a persistent Docker volume to the container?

  3. How do you verify that data persists after container restart?


Lab 4: Multi-Container Deployment Using Docker Compose

  1. How do you create two microservices or an API + database (MongoDB/Postgres)?

  2. How do you orchestrate them using a docker-compose.yml file?

  3. How do you verify connectivity between the services?


Lab 5: Implement Microservice-to-Microservice Communication

  1. How do you create two microservices (Service-A and Service-B)?

  2. How do you make Service-A call Service-B using REST over Docker Compose DNS names?

  3. How do you test and verify this communication?


Lab 6: Apply Microservices Design Pattern — API Gateway

  1. How do you set up an NGINX or Express-based API Gateway?

  2. How do you configure routes such as /serviceA → Service-A and /serviceB → Service-B?

  3. How do you test routing via the gateway?


Lab 7: Add Service Discovery (Consul or Eureka)

  1. How do you deploy Consul or Eureka using Docker or Docker Compose?

  2. How do you register microservices with the discovery server?

  3. How do you verify automatic service discovery?


Lab 8: Implement Centralized Logging

  1. How do you deploy the ELK stack (Elasticsearch, Logstash, Kibana) using Docker Compose?

  2. How do you configure microservices to send logs to Logstash?

  3. How do you visualize logs in Kibana?


Lab 9: Container Optimization & Multi-Stage Docker Builds

  1. How do you convert an existing Dockerfile to a multi-stage build?

  2. How do you compare image size before and after optimization?

  3. How do you evaluate improvements in build time and runtime efficiency?


Lab 10: Deploy Microservices to Kubernetes

  1. How do you write Kubernetes Deployment and Service YAML files for two microservices?

  2. How do you deploy them to a cluster?

  3. How do you test communication via ClusterIP or NodePort services?

Last updated