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

    Minikube 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

You can also load local images into Minikube with

minikube image load {image-name}
  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

Alternatively, you can access the qunicorn service with the following command.

minikube service qunicorn
  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

A tutorial on how to deploy the helm charts

  • helm installation

Helm must be installed to use the charts. Please refer to Helm’s documentation to get started.

Once Helm has been set up correctly, then we need:

  1. To install the <chart-name> chart:

cd <helm-chart-folder>
helm install <my-chart-name> .
  1. To uninstall the chart:

helm delete <my-chart-name>
  • Converting YAML files into helm charts

Using helmify

  1. Installation of helmify

  2. Convert YAML files to Helm chart

  1. For single yaml file:

cat <your-yamlfile-name>.yaml | helmify <chart-name>
  1. From directory with yamls:

`awk 'FNR==1 && NR!=1  {print "---"}{print}' /<my_directory>/*.yaml | helmify <helmchart-folder-name>`