https://github.com/aliartiza75/flask-backend-application
Back-end application build in flask, its frontend application exists in aliartiza75/ht-fe repository.
https://github.com/aliartiza75/flask-backend-application
docker flask-restapi flask-restful helm kubernetes microservice
Last synced: 18 days ago
JSON representation
Back-end application build in flask, its frontend application exists in aliartiza75/ht-fe repository.
- Host: GitHub
- URL: https://github.com/aliartiza75/flask-backend-application
- Owner: aliartiza75
- Created: 2019-02-09T06:57:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T11:50:20.000Z (8 months ago)
- Last Synced: 2025-01-19T11:19:57.118Z (6 months ago)
- Topics: docker, flask-restapi, flask-restful, helm, kubernetes, microservice
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)
[](https://sonarcloud.io/summary/new_code?id=aliartiza75_flask-backend-application)# Flask Backend Application
This repository contains backend logic and kubernetes manifests. I have used `minikube` for this project. Installation steps is given in this [gist](https://gist.github.com/aliartiza75/3a34f059de62c7de04727dae6a363ea8)
# Guidelines for containerizing backend
* To build image
```bash
sudo docker run -t ht-be:0.0.1 -f Dockerfile .
```* To run docker container on host machine
```bash
sudo docker run -e FLASK_ENV=development -e FLASK_HOST_IP=0.0.0.0 -e=FLASK_HOST_PORT=5001 -e Name=Irtiza -p 1001:5001 ht-be:0.0.1
```# Guidelines for kubernetes deployment
* Deployment creation
```bash
sudo kubectl apply -f deployment.yaml
```* Service creation
```bash
sudo kubectl apply -f htbe_service.yaml
```* Validating whether application is running or not. Use the command given below from host machine on which kubernetes is running
```
curl -X GET "http://:/datetime"
```# Guidelines for helm charts deployment
* Helm installation guidelines [link](https://helm.sh/docs/install/#installing-the-helm-client)* Once the helm is installed, use the command given below to install tiller in kubernetes cluster:
```bash
helm init
```* To create a helm chart folder:
```bash
helm create
```* To dry run the helm chart for debugging:
```bash
sudo helm install --dry-run --debug
```* To purge a release
```bash
sudo helm del --purge
```* To check the status of a release
```bash
sudo helm ls --all
```* To search a helm package name
```bash
sudo helm search
```* To create a package from the helm charts folder
```bash
sudo helm package
```# Important Notes
* Start the minikube cluster in the virtual machine drive in none mode [--vm-driver=none], otherwise services will not be accessible.
* Minikube will pull images from the dockerhub.
* In some cases minikube cluster doesn't work properly, one quick fix is to delete the cluster and restart the minikube cluster.