Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

My simple web application. Deployment using containerization for DevOps learning purpose

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