1

Kubernetes rolling updates will be creating new pods with updates and gradually change old pods by new, and as soon as new pod is ready it will get traffic by round-robin with the old ones.

But what to do in case that I have 2 services one is using another and I need to make updates in them simultaneously? I don't want the situation that old service 1 will make calls to new service 2.

ogbofjnr
  • 161
  • 1
  • 7
  • This is not normally a problem. Do you have circular dependencies in your microservices? Besides, it would not be possible to do a _rolling_ update if it was simultaneous. – Michael Hampton Apr 15 '19 at 14:14
  • @MichaelHampton, now I'm just studying it, I don't have particular project. What I mean lets say service A uses service B and both have multiple replicas. I want to add new functionality that changes both of them, and not backward compatible with old versions. How do I deploy these two services to the cluster without downtime? – ogbofjnr Apr 15 '19 at 14:29
  • 1
    You change your API version number. Questions about your software architecture should go to [programmers.se] though. – Michael Hampton Apr 15 '19 at 14:49

1 Answers1

1

The easy and clean way to do something like that is to create 2 new services, let's call them 1b and 2b (1a talks with 2a and 1b talks with 2b). Then, use a load balancer to direct traffic either to 1a or 1b. When you are certain that 1b is working as intended, you shut down 1a and 2a.

It would require a bit of configuration juggling and some more resources, but it's possible to be done. Obviously, this gets much more complicated with every service you want to update like that.

Maciek
  • 151
  • 3