Top Ten Challenges - Part 2: Pod Granularity

 (This is part 2 of a series about challenges and considerations that I have come across with customers when deploying software into Kubernetes. You can find the intro post here.)

Modern applications are expected to be developed in a 'cloud native' way. And as part of that, they should contain microservices. These microservices should be independently scalable, only have loose associations with other microservices, support strict separation of state (or be stateless altogether), and can be developed independently, all of which lends itself well to a deployment in the cloud.

And when using Kubernetes, each microservice becomes a container, right? That also means, each microservice will have its own image, of course, with only the code that is needed to run that specific service.

I have come across cases where the 'cloud nativeness' of a solution was gauged by the number of microservices/containers it contains: the more microservices there are, the more cloud ready is the solution. I'm exaggerating here, of course, but a very fine grained structure of code, which translates into many images and pods, can create operational challenges. For starters, there are more moving parts, of course. More images means they all need to be pulled down to the worker nodes and will use up storage. More pods means they all carry their own attributes for things like CPU and memory, file system and secret mounts, number of replicas, annotations, affinity and anti-affinity rules, just to name a few examples. In a typical microservice deployment, each pod will also have a Service resource that goes along with it and controls access from other pods. 

It's not all black and white, of course, it is about finding the right balance between creating monolithic applications and those that are too fine grained and hard to manage. 
 
By the way, I also recommend you check out a blog post from Roland Barcia, the title really says it all: It’s time to stop making “Microservices” the goal of modernization.

(Photo by Ankush Minda on Unsplash )

Comments

Post a Comment

Popular Posts