This project is a fully automated DevOps pipeline for deploying a fun summer-themed "Coconut Website" using a combination of Docker, GitHub Actions, Ansible, and Kubernetes (Minikube). It showcases the power of Infrastructure as Code (IaC), CI/CD pipelines, and container orchestration in a clean and reusable structure.
graph LR
A[Frontend Code] -->|Docker Build| B(Docker Image)
B -->|Pushed via CI| C(Docker Hub)
C -->|Pulled via Ansible| D(Minikube Cluster)
D --> E[Kubernetes Deployments & Services]
subgraph CI/CD
A -->|Commit| F[GitHub Actions Workflow]
F -->|Docker Login & Push| C
end
| Tool | Purpose |
|---|---|
| Docker | Containerizes the Coconut frontend app. |
| GitHub Actions | Automatically builds & pushes Docker image to DockerHub on commit. |
| Ansible | Pulls the Docker image and applies Kubernetes manifests. |
| Minikube | Hosts the Kubernetes cluster locally. |
| Kubernetes | Manages the pods, services, and deployment of the app. |
- Code is pushed to GitHub
- GitHub Actions workflow triggers:
- Logs into DockerHub
- Builds the Docker image
- Pushes the image to DockerHub with tag
v1
- You run a single command:
ansible-playbook -i ansible/inventory/hosts.ini ansible/playbook.yaml
- Ansible does the following:
- Pulls the Docker image from DockerHub
- Applies Kubernetes manifests (deployment & service)
- Kubernetes on Minikube starts the pods and exposes your app
- Access the app using:
minikube service coco-frontend-service
- Minikube installed and running.
- DockerHub account with your Docker credentials stored in GitHub Secrets.
- kubectl and Ansible set up locally.
- GitHub Actions workflows set up for continuous deployment.
- CI/CD: Automated end-to-end Docker build and push
- IaC: Everything from Kubernetes manifests to Ansible roles is code-defined
- Real-time deployable: Run one command to bring the cluster to life
- Reusable: Easily reset and redeploy anytime
