1- # Flask Bookshelf
1+ # Running Flask on Kubernetes
22
3- Flask + Vue + Postgres + Docker + Kubernetes
3+ ## Want to learn how to build this?
44
5- ## Docker
5+ Check out the [ post] ( https://testdriven.io/running-flask-on-kubernetes ) .
6+
7+ ## Want to use this project?
8+
9+ ### Docker
10+
11+ Build the images and spin up the containers:
612
713``` sh
814$ docker-compose up -d --build
915```
1016
11- [ http://localhost:8080/ ] ( http://localhost:8080/ )
17+ Run the migrations and seed the database:
18+
19+ ``` sh
20+ $ docker-compose exec server python manage.py recreate_db
21+ $ docker-compose exec server python manage.py seed_db
22+ ```
23+
24+ Test it out at:
25+
26+ 1 . [ http://localhost:8080/ ] ( http://localhost:8080/ )
27+ 1 . [ http://localhost:5001/books/ping ] ( http://localhost:5001/books/ping )
28+ 1 . [ http://localhost:5001/books ] ( http://localhost:5001/books )
1229
13- ## Kubernetes
30+ ### Kubernetes
1431
15- ### Minikube
32+ #### Minikube
1633
1734Install and run [ Minikube] ( https://kubernetes.io/docs/setup/minikube/ ) :
1835
@@ -27,7 +44,7 @@ $ minikube start --vm-driver=virtualbox
2744$ minikube dashboard
2845```
2946
30- ### Volume
47+ #### Volume
3148
3249Create the volume:
3350
@@ -41,15 +58,15 @@ Create the volume claim:
4158$ kubectl apply -f ./kubernetes/persistent-volume-claim.yml
4259```
4360
44- ### Secrets
61+ #### Secrets
4562
4663Create the secret object:
4764
4865``` sh
4966$ kubectl apply -f ./kubernetes/secret.yml
5067```
5168
52- ### Postgres
69+ #### Postgres
5370
5471Create deployment:
5572
@@ -70,7 +87,7 @@ $ kubectl get pods
7087$ kubectl exec postgres-< POD_IDENTIFIER> --stdin --tty -- createdb -U postgres books
7188```
7289
73- ### Flask
90+ #### Flask
7491
7592Build and push the image to Docker Hub:
7693
@@ -101,7 +118,7 @@ $ kubectl exec flask-<POD_IDENTIFIER> --stdin --tty -- python manage.py recreate
101118$ kubectl exec flask-< POD_IDENTIFIER> --stdin --tty -- python manage.py seed_db
102119```
103120
104- ### Ingress
121+ #### Ingress
105122
106123Enable and apply:
107124
@@ -122,7 +139,7 @@ Try it out:
1221391 . [ http://hello.world/books ] ( http://hello.world/books )
123140
124141
125- ### Vue
142+ #### Vue
126143
127144Build and push the image to Docker Hub:
128145
0 commit comments