Skip to content

This project demonstrates a simple web application deployment using Ansible for automation, Docker for containerization, and Kubernetes for orchestration. It includes a Python backend, static frontend, and infrastructure scripts for easy setup and management.

Notifications You must be signed in to change notification settings

Divya15566/Infrastructure-Management-for-Microservices-with-Ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure Management for Microservices with Ansible (Internship project)

This repository contains a sample full-stack application deployment using Ansible, Docker, and Kubernetes. It demonstrates infrastructure automation and container orchestration for a simple web app.

Project Structure

IBM_project-master/
├── README.md
├── ansible/
│   ├── inventory.ini
│   └── playbook.yml
├── app/
│   ├── backend/
│   │   ├── app.py
│   │   ├── Dockerfile
│   │   └── requirements.txt
│   └── frontend/
│       ├── Dockerfile
│       └── index.html
├── k8s/
│   ├── backend-deployment.yaml
│   ├── frontend-deployment.yaml
│   └── service.yaml

Components

1. Ansible

  • inventory.ini: Defines target hosts for automation.
  • playbook.yml: Automates deployment tasks (e.g., Docker installation, app deployment).

2. App

  • backend/: Python Flask API with its own Dockerfile and requirements.
  • frontend/: Static HTML frontend with its own Dockerfile.

3. Kubernetes

  • backend-deployment.yaml: Deployment spec for backend service.
  • frontend-deployment.yaml: Deployment spec for frontend service.
  • service.yaml: Service definitions for exposing the app.

Quick Start

Prerequisites

  • Docker
  • Kubernetes (Minikube, k3s, or cloud provider)
  • Ansible
  • Python 3.x

1. Build Docker Images

# Backend
cd app/backend
docker build -t ibm-backend .

# Frontend
cd ../frontend
docker build -t ibm-frontend .

2. Run with Kubernetes

kubectl apply -f k8s/backend-deployment.yaml
kubectl apply -f k8s/frontend-deployment.yaml
kubectl apply -f k8s/service.yaml

3. Deploy with Ansible

ansible-playbook -i ansible/inventory.ini ansible/playbook.yml

Notes

  • Update image names in Kubernetes YAMLs if you push to a registry.
  • Customize Ansible playbook for your environment.

License

MIT

About

This project demonstrates a simple web application deployment using Ansible for automation, Docker for containerization, and Kubernetes for orchestration. It includes a Python backend, static frontend, and infrastructure scripts for easy setup and management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published