Part3: Deploy a CQRS microservice with Kubernetes

Alireza Moosavi
2 min readJul 3, 2020

--

After deploying some web apps in part1 and part2, in this story the whole process of developing and deploying a microservice with Nameko is going to be illustrated. Also the codes are existed in this github repository.

Nameko is a microservice framework in python that uses RabbitMQ for communicate with services. In this project we have two services: first one is a web http application and second one stores and retrieves data from Redis.

As it can be seen each service has its own dockerfile and configurations, so they need to be tagged and pushed to docker-registery as it described in part1.

Deployment

This project easilly can be deployed with docker-compose up — build; but in this report we create deployment and services for Redis, RabbitMQ and for each Nameko services; that could be found here. Just like part2, the hosts for redis and rabbitmq is going to be like this:

Environment variables

For deployment:

> kubectl apply -f k8s/nameko/

> kubectl apply -f k8s/rmq-redis/

> kubecl get all

We wait for creating…

After all are running, checking out Rabbitmq UI (get minikube ip first):

http://(minikube ip):30072

As it can be seen the RMQ is up an running.

For testing Redis and Nameko services a get request with a username is sent and will store with a uuid and after creation, it will return as message:

http://(minikube ip):30080/hi/alireza-moosavi

So they work together very Well! :))

--

--

Alireza Moosavi
Alireza Moosavi

No responses yet