Skip to content

Commit 0b52ebc

Browse files
committed
updates deploy.sh and readme
1 parent 54adfe7 commit 0b52ebc

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
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

1734
Install 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

3249
Create 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

4663
Create the secret object:
4764

4865
```sh
4966
$ kubectl apply -f ./kubernetes/secret.yml
5067
```
5168

52-
### Postgres
69+
#### Postgres
5370

5471
Create 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

7592
Build 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

106123
Enable and apply:
107124

@@ -122,7 +139,7 @@ Try it out:
122139
1. [http://hello.world/books](http://hello.world/books)
123140

124141

125-
### Vue
142+
#### Vue
126143

127144
Build and push the image to Docker Hub:
128145

deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo "Creating the database credentials..."
1212
kubectl apply -f ./kubernetes/secret.yml
1313

1414

15-
echo "Creating the Postgres deployment and service..."
15+
echo "Creating the postgres deployment and service..."
1616

1717
kubectl create -f ./kubernetes/postgres-deployment.yml
1818
kubectl create -f ./kubernetes/postgres-service.yml

0 commit comments

Comments
 (0)