Run using kubernetes / minikube

Installation / Starting Minikube (tested for windows)

  1. Install Chocolatey

  2. Install Minikube Minikube

choco install minikube
  1. Install kubectl kubectl

choco install kubernetes-cli
  1. Install kubernetes-kompose

choco install kubernetes-kompose
  1. Navigate to the location where the docker-compose file is. It should be under ‘C:...qunicorn-core’.

  2. Now check if a minikube folder has been created under ‘C:...qunicorn-core’.

    If not, create the kubernetes configuration files. This will generate a folder called minikube with all the kubernetes configuration files based on the docker-compose. However this might overwrite custom changes made to the files, if already existing. Proceed with caution.

kompose convert -f docker-compose.yaml --out minikube
  1. Start Docker (e.g. Docker Desktop)

  2. Start minikube

minikube start
  1. Set minikube as docker env

    Minkube needs to be set as docker environment to be able to build images for minikube. Otherwise Minikube would not be able to find the images. This needs to be done every time a new terminal is opened.

minikube docker-env | Invoke-Expression
  1. Build qunicorn image

docker build -t qunicorn:local .
  1. Start services and pods with configuration (Note that starting the whole cluster can take a while (up or more than 8min))

kubectl apply -f minikube
  1. Expose qunicorn through minikube (start in another terminal) Exposes the qunicorn service to the internet. This is needed to be able to access the service from outside the cluster.

minikube tunnel
  1. List service information using

kubectl get svc
  1. Get existing pos and fill database with data

kubectl get po --selector=io.kompose.service=server
  1. Now you can access qunicorn using [EXTERNAL-IP]:8080/swagger-ui of the server service (usually you can use localhost)

Other useful commands

  • Clear all kubectl pods and services

kubectl delete daemonsets,replicasets,services,deployments,pods,rc,ingress --all --all-namespaces
  • Expose service and create Tunnel

minikube service {service}
  • Visual dashboard to view cluster information

minikube dashboard