Kubernetes Microservice Versioning

Simon

I'm fairly new to Kubernetes and only got started with an example project to learn everything. I'm currently running one .NET microservice which needs a MongoDB as a database. The microservice is packed into a Docker Image and I've created a single Helm chart to properly deploy my microservice and the required MongoDB.

Now I've thought about versioning and discovered one big problem with this approach: I can't just install multiple versions of that helm chart to support running multiple versions of the same microservice because that way each microservice gets its own database which is obviously not what I want.

Does this mean I have to create two helm charts for my microservice? So one api chart containing my .NET service and one db chart containing the MongoDB? That way I can deploy the MongoDB once and have multiple versions of my .NET service pointing to this single instance. However, that way I don't have a single Helm chart per microservice but multiple ones, which increases deployment overhead I'm guessing.

Is this how it's been done? Or is there something I'm missing? All clues that point me in the right direction are very welcome!

Malgorzata

I would recommend one chart per service. The place where helm dependencies work well is where you have a service that embeds/hides specific single other parts. And as @christopher said if your .NET service and MongoDB have different lifecycles, they shouldn't be packaged together in the same helm chart.

The most basic way to use Helm is by having a single chart that holds a single application. The single chart will contain all the resources needed by your application such as deployments, services etc.

Chart versions and appVersions

The version of the chart itself (version field in Chart.yaml). The version of the application contained in the chart (appVersion field in Chart.yaml). These are unrelated and can be bumped up in any manner that you see fit. You can sync them together or have them increase independently. There is no right or wrong practice here as long as you stick into one.

An important point here is that you need to adopt a policy in your team on what a “chart change” means.

Helm does not enforce chart version changes. You can deploy a different chart with the same version as the previous one. So, if this is something that you want to do, you need to make sure that all teams are on the same page for versioning practices.

On the plus side, this workflow allows you to individually version charts and applications and is very flexible for companies with teams that manage separately the charts from the application source code.

Umbrella charts

However, you can also create a chart with dependencies to other charts called umbrella chart.

They are completely external using the requirements.yaml file. Using this strategy is optional and can work well in several organizations. Again, there is no definitive answer on right and wrong here, it depends on your team process.

Take a look: umrella-charts-example.

In other words, a collection of software elements that each have their own individual charts but, for whatever reason (e.g. design choices, ease of deployability, versioning complexities), must be installed or upgraded as a since atomic unit

An umbrella chart references the version of the Helm chart itself and not the underlying version of the container image. This means that any change to the image version will result in chart modifications to the individual component charts.

What to take into account when deciding on an option

There are two dimensions to take into account:

  • Team structure: You have to ask yourself questions like: do you have small autonomous teams that are responsible for each service? Do you have developers who have knowledge of DevOps?
  • Dependencies and reproducibility: You have to ask yourself questions like: How different are the dependencies for each service? What is the risk that a change to one service will break another? How do you reproduce the conditions of a specific development?

Read more in useful article: helm-managing-microservices.

Speaking about versioning of microservices for backward compatibility, see Product Versioning Microservices, in general Semantic Versioning is generaly adviced.

In the broader sense - there should be an agreed phase-out roadmap for major versions, that is communicated to API consumers (together with SLAs). This is why tracking who uses your APIs is important. Take a look on this useful article about versioning management.

See example tool for tracking microservice versions- DeployHub.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Are there any versioning for kubernetes ingress?

Kubernetes resource versioning

Spring Boot Microservice API Versioning Implementation

Kubernetes - Using a particular ConfigMap versioning

kubernetes dns lookup of microservice

What is the best way to do microservice REST API versioning?

Microservice structure using helm and kubernetes

Kubernetes - Calling Microservice by Service Name

Problem with kubernetes dicovery client in gateway microservice

Microservice deloyed on kubernetes but not giving the desired result

Microservice instances (Dockerized) with slightly different parameters in Kubernetes

how to define the microservice self registry address to consul in kubernetes

Deploying Microservice in Kubernetes with swagger .net core using ingress controller

Is there a reccomended practice for how kubernetes service names are included in a microservice?

Extracting configmaps from services in kubernetes cluster using a spring microservice

docker microservice apps restart over and over again in kubernetes

Versioning of ViewModels

OpenJDK versioning

Versioning in Python

Interface Versioning

Versioning in the database

Package versioning with Semantic Versioning for Laravel

How to use next js image optimization when images are served from another microservice in a kubernetes cluster?

Do I need an "K8s service" for each microservice in Kubernetes for internal service communication?

Unable to access Spring Boot microservice exposed via nginx ingress controller on Kubernetes cluster running on AWS

Web API Versioning With Inheritance

redux, versioning preloadedState?

How to disable versioning in Jackrabbit?

About semantic versioning with Harpy