This was built using the following versions
$ minikube version: v0.33.1
$ Docker version 18.09.1, build 4c52b90
$ docker-compose version 1.23.2, build 1110ad01Build the three images and create containers using docker compose:
$ docker-compose up -d --buildRun the migrations and seed the postgres database with titanic csv:
$ docker-compose exec server python manage.py recreate_db
$ docker-compose exec server python manage.py seed_dbIf you have errors in spinning any of the three containers to debug
$ docker events&
$ docker logs <copy the instance id from docker events messages on screen>API Endpoints
- http://localhost:5001/api/v1/people GET POST
- http://localhost:5001/api/v1/people/uuid GET POST DELETE
To view the crude crud app visit http://localhost:8080 should possess same functionality as API
Ensure virtualisation is enabled in your bios and run the following commands
$ minikube start
$ sh deploy.shAllow Pods To Start. Belowe commands add minikube ip to your host file under hello.world And seed the database.
$ echo "$(minikube ip) hello.world" | sudo tee -a /etc/hosts
$ POD_NAME=$(kubectl get pod -l service=postgres -o jsonpath="{.items[0].metadata.name}")
$ kubectl exec $POD_NAME --stdin --tty -- createdb -U sample people
$ FLASK_POD_NAME=$(kubectl get pod -l app=flask -o jsonpath="{.items[0].metadata.name}")
$ kubectl exec $FLASK_POD_NAME --stdin --tty -- python manage.py recreate_db
$ kubectl exec $FLASK_POD_NAME --stdin --tty -- python manage.py seed_dbTo view the app visit http://hello.world/