A DevOps assignment
The assignment is divided into five major tasks with each task containing sub-tasks worth bonus points, all tasks are optional.
- Create a simple HTTP API
- Dockerize the application
- Create a helm chart
- Deploy to Kubernetes
- Documentation
- Clone or download the repository
git clone https://github.com/rustyxlol/Technicorn.git
cd Technicorn
- Build using the provided Dockerfile
docker build --tag technicorn-docked .
- Run the image on port 8000
docker run -p 8000:8000 technicorn-docked
- Navigate to http://127.0.0.1:8000/ to check if the API works
A very simple API to demonstrate SQL connections and CRUD operations.
The API provides the following functionalities:
- Get all users from the database
- Get user with specific ID from the database
- Insert user into the database
- Delete user from the database
- Update user in the database
- Build the image using
docker build --tag technicorn-docked .
- Run the image using
docker run -p 8000:8000 technicorn-docked
NOTE: For simplicity, the image has been made for DEVELOPMENT MODE. If one wants to aim to deploy this into production environment, GUNICORN is required.
Before Helm, we need to orchestrate.
After task 4
- Create helm app using
helm create helm-charts
- Copy flask template, modify values
- Run
helm install web helm-charts
- Check if it is running using
helm list
Using minikube
- Start minikube using
minikube start
- Run
docker-compose build
anddocker-compose up -d
- Apply K8s manifests using
kubectl apply -f deployment.yml
andkubectl apply -f service.yml
- Check if it's working by going to the ip provided by
minikube ip
and the port fromkubectl get po,svc