Phonebook Microservice Web Application aims to create a web application with MySQL Database using Docker and Kubernetes to have the understanding of Microservice architecture. In this application, we have a frontend service and a backend service to interact with database service. Each service will be managed by a Kubernetes deployment. The backend service will be a gateway for the application and it will serve the necessary web pages for create, delete and update operations while the frontend service will serve a search page in order to conduct read operations. To preserve the data in the database, persistent volume and persistent volume claim concepts should be adopted.
Your team has started working on a project to create a Phonebook
Application as Web Service.
Software Developers in your team have already developed first version of Phonebook
application. They have designed a database to keep phonebook records with following fields.
Field | Description |
---|---|
id |
Unique identifier for records, data type is integer and it will be auto increment |
name |
Name of record, data type is string |
number |
Phone number belonging to the recorded person |
HTTP Method | Action | Example |
---|---|---|
GET |
Read the records | http://[ec2-hostname]:30001/ |
POST |
Create a new record | http://[ec2-hostname]:30001/add |
POST |
Update an existing record | http://[ec2-hostname]:30001/update |
POST |
Delete an existing record | http://[ec2-hostname]:30001/delete |
POST |
Delete a resource | http://[ec2-hostname]:30002 |
As a DevOps engineer, you’re requested to deploy the app on an AWS EC2 Instance using Docker and Kubernetes to showcase your project. In order to achieve this goal, you need to;
Pull the application code from GitHub repo of your team.
Create two docker images for create/update/delete and search pages using Dockerfile
s.
Deploy the app using Kubernetes
. To do so;
Create a database service using MySQL.
Use a custom network for the services.
In the Kubernetes environment, you will configure three deployements with their services and a persistent volume for MySQL deployments. You can find the definitions below for the objects you should create:
port 80
.CREATE/DELETE/UPDATE Deployment
.port:30001
.80
.port 80
.SEARCH Deployment
.port:30002
.80
.port 3306
.DATABASE Deployment
.3306
.20Gi
.ReadWriteOnce
./mnt/data
.Assign two EC2 machines as the project’s infrastructure. One should be configured as the master and the other should be configured as the worker.
Minimum t2.medium
instance type should be selected.
The Web Application should be accessible via web browser from anywhere.
The Application files should be downloaded from Github repo and deployed on EC2 Instance using user data script within CloudFormation Template.
MySQL Database Configuration
Docker Images
Kubernetes architecture configuration
AWS EC2 Service
AWS Security Group Configuration
Git & GitHub for Version Control System
AWS CloudFormation Service
configure a connection to the MySQL
database.
build Docker images.
configure Kubernetes to run Python Flask app.
improve network skills using service
objects in Kubernetes
configure AWS EC2 Instance and Security Groups.
use git commands (push, pull, commit, add etc.) and Github as Version Control System.
run the web application on AWS EC2 instance using the GitHub repo as codebase.
build a Kubernetes infrastructure using CloudFormation.