https://github.com/hieuung/simple-web-app
My simple web application. Deployment using containerization for DevOps learning purpose
https://github.com/hieuung/simple-web-app
containerization flask-sqlalchemy learning self-project webapp wsgi-server
Last synced: 10 months ago
JSON representation
My simple web application. Deployment using containerization for DevOps learning purpose
- Host: GitHub
- URL: https://github.com/hieuung/simple-web-app
- Owner: hieuung
- Created: 2024-02-14T08:16:25.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-06T15:32:06.000Z (over 1 year ago)
- Last Synced: 2025-02-21T20:23:53.209Z (over 1 year ago)
- Topics: containerization, flask-sqlalchemy, learning, self-project, webapp, wsgi-server
- Language: Python
- Homepage:
- Size: 176 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple-web-app
My simple web app, deploy using containerization for Dev-ops learning
## Tech stack
- Flask
- WGIS
- Containerization (Docker, Kubernetes, Minikube)
- SQL (Postgres)
## Description
This simple webapp provided user's interface for sign up and sign in. Using Flask (python). Containerized app with docker and deploy on Kubernetes.
## Deployment
- Install [docker](https://docs.docker.com/engine/install/ubuntu/), [kubernetes](https://kubernetes.io/docs/tasks/tools/), and [minikube](https://minikube.sigs.k8s.io/docs/start/)
- Create namespace
```
kubectl create namespace webapp
```
- Deploy Postgres server to Kubernetes
```
kubectl apply -f ./k8s/database-postgres -n webapp
```
> **_NOTE:_** Postgres server ClusterIP have to be hard coded.
- Create database following file
```./db/schema.sql``` using provided user name and password created in k8s secret.
- (Optional) Created docker image and push to registry. Add SQL_URI (AlchemySQL connection URI) to docker enviroment variable.
- Create deployment for webapp. using created docker image (Currently [my docker image](https://hub.docker.com/repository/docker/hieuung/bookstore/general))
```
kubectl apply -f ./k8s/web-app -n webapp
```
## Result
- Verify deployment, service
```
kubectl get depolyment -n webapp
```
![Deployment]()
```
kubectl get service -n webapp
```
![Service]()
> **_NOTE:_** Using ```minkibe tunnel``` if LoadBalancer not exposes External-IP