Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Designing Helm charts for microservices based application

Tags:

I'm currently building an application that is composed of 4 microservices (a, b, c, d). We would like to make Kubernetes Helm part of our CI/CD pipeline.

We are at the point where we're discussing how best to define the charts and was wondering was the advice from the community.

Our current options appear to be:

  1. a chart per microservice (so 4 charts)
  2. a chart per "application flow" (service a calls b, service c calls d, so 2 charts in total)
  3. a single chart that deploys all 4 microservices
  4. some combination of 1. and 3. where we leverage the dependencies feature of Helm

It might be worth calling out that:

  • we currently don't have a requirement to deploy any microservice in isolation e.g. make it available to a separate application.
  • it is likely that we will need to have the ability to scale any microservice independently i.e. not simply replicate all 4 services.

I'm mentioning these requirements because I feel that they may be relevant to the chart design.

like image 308
CPH Avatar asked Jan 04 '18 16:01

CPH


People also ask

Should each microservice have its own Helm chart?

It would be possible to write a Helm chart for each microservice, each completely unrelated. We are taking a different approach. We are providing shared Helm templates that (approximately) create the same Kubernetes resources that the Cloudify plugin created when it processed a blueprint.

What is Helm Microservices?

Helm is a tool for managing Kubernetes charts. Charts are packages of pre-configured Kubernetes resources. Helm is an open source project maintained by the Kubernetes organization. It makes it easy to pack, ship and update Kubernetes resources together as a single package.


2 Answers

Might be a late answer, but FWIW, it depends on how and where you develop your microservices app. If each microservice has it's own repo and CI pipeline, then it makes sense to separate the charts as well (one per service). However, if all services are in the same repo and deployed with a single ci pipeline, then a single chart is a better fit.

All your 4 options will work. And whether you deploy your app with separate charts or with one won't make any difference as long as eventually all your services will be deployed.

As for scaling services independently, if you use separate deployments for your services in one big chart, you can scale them separately by using input values for each deployment in your values.yaml ... so it's not something which forces you to split your charts.

And for your image changing question in the comments, it only needs an upgrade for your installed release with the new image tag.

By the way, We use helmsman for deploying (and managing) helm charts from code in our CI/CD pipelines. Might be useful for you ;)

like image 163
Sami Avatar answered Oct 21 '22 14:10

Sami


We have a similar problem, and we choose the lean way: first simple and functional, then evolve.

We started with a simple chart deploying all services because our main requirement it's to have one installer. But we know that in short time we are gonna to refactor to use 3rd party charts and even our own charts in our own repo to handle different deployment strategies and independent evolution of services.

like image 22
Gabriel Miretti aka gmiretti Avatar answered Oct 21 '22 16:10

Gabriel Miretti aka gmiretti