How to orchestrate different version of apps in Docker or Kubernetes

9/28/2018

I have three versions of the app that I need to serve to the user based on selection (for now assume it's a drop-down)

I have 3 containers running v1, v2, v3 of the app.

How do we route the app to the right container in Kubernetes based on the selection? How do I separate my versions?

-- Samual krish
docker
kubernetes

2 Answers

10/2/2018

Actually, this is a classical problem. Imagine you created any application which is providing any service for clients. Imagine your clients communicate with your service via client app using your API. The first version of your application was having API with 1 supported method. Imagine, your application went viral and you decided to improve functionality of you application by adding 2 newly created methods to your API. So you had decided to upgrade you API and client app. New clients can use 3 methods and everything is ok, but what about clients, who use old version of the client app? That's why most part of the API's have got a versioning, e.g v1/v2/v3. Old clients communicate via APIv1 and new clients via APIv2 and so on.

Since you have got a different versions of the same app it is clear, that some newer versions of the app support more functionality. Maybe it will be better to handle request via web server like Nginx or something else (including Ingress) by redirecting them depending on URL. For example, if URL has got v1, then route it to the app's deployment with version 1 and so on.

I'm not sure this is your case, but I hope it turns out to be useful.

-- Konstantin Vustin
Source: StackOverflow

9/28/2018

Create 3 different Kubernetes deployments with pods using containers v1, v2, and v3 respectively. Also, create 3 Kubernetes services to forward traffic to those 3 deployments.

-- Rico
Source: StackOverflow