0

I have a working Kubernetes single master cluster with 14 worker nodes.

4 of those nodes host the web application, and 10 host the backend application.

Because of the way our architecture is thought out, I would sometimes need to only update a few nodes with the latest image and keep the other nodes on the old deployment image for a few more hours. (this is because, with certain updates, the newer webapp can't talk to the old backend app, so I need to split the infrastructure, to keep some nodes alive on the old version, while updating the others). I have spent many hours searching for an option in the documentation, but there doesn't seem to be an easy way of doing this with Kubernetes.

To update the applications, I'm currently using rolling updates, configured in yaml files:

replicas: 3  
strategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 1
    maxUnavailable: 0

To apply the updates I basically run two commands:

kubectl apply -f webapp.yaml
kubectl apply -f backendapp.yaml

This all works well, but it becomes a real problem for the scenario that I described above. Anybody has a suggestion, a path that I could follow?

Thank you

0

If you want both old and new versions of the application to serve clients and talk to DB, and smoothly transition traffic to the new version you can achieve this with Istio and Virtual Services.

This allows you to use weighted HTTP Route Destination to direct traffic to subsets of pods.

More in-depth info about Istio traffic management can be found in the article here.

Maybe you've seen this already, but here is a pretty good article discussing different approaches to rolling out updates in K8s: link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.