Versioning for deployments of microservices in lagom on kubernetes

7/19/2019

Question is related to deployment of micro services .

Framework used -- Lagom .

Suppose i Have two microservices Say M1,M2 which is in same git repository . So we have only one build.sbt and both microservices are define in that build.sbt .

Now when we deploy these microsevices on kubernetes we have to make docker images with some tag . I will give the Tag name of docker image , the version of microservices .

Now , i have two options for defining versions of microservices .

     1. One is for every commit i will update versions of both microservices say 1.1 , 1.2 and so on .... , (here i have to increase version of both microservices as i do not know that for which microservice commit is done as repo is same for two microservices . ) 

I am using single repo as recommended by lagom doc Build Philosophy as we have very small team .

     2. developer has to increase version in build.sbt  every time he commit a feature or bug fix . 

Now My question/Doubt is as follows

     1.How should generally people manage version in this case . 
     2.There may be many bug fixes daily , so i do not want to update version on every small bug fix . 
     3.How to manage compatibility between microservices version .     

What lagom suggest what are the best practices for all above problems.

-- Sahil Aggarwal
docker
kubernetes
lagom
microservices
sbt

1 Answer

7/22/2019

It is recommend to replace image version tag with an actual version number, one that gets updated each time you deploy. There are a lot of sbt plugins for generating a version number from a git hash, one of them is sbt-dynver. You can check how to configure your build to base its version number off the current git commit hash, which is great especially for continuous deployment.

From Lagom build pilosophy, as you don't want to increase version of both microservices (as you won't know for which service commit is done) the better way is to use multiple builds so each service can be changed independently.

-- muscat
Source: StackOverflow