Avoid recreation of Kubernetes cluster when upgrading web api

79 views Asked by At

Maybe I am missing something but am I right in thinking that if I want to update a webapi that is hosted in my kubernetes cluster in Azure I have to delete and recreate it?

The instructions I am seeing online seem to show deleting the cluster rather than upgrading the api

Paul

1

There are 1 answers

0
Jakub On BEST ANSWER

If it's your web API application then it's only deployment image update, you don't need to delete the whole cluster.


There is an example of updating a nginx deployment with new image:

kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record

This way it will first create a new pods with newer version of image and once successfully deployed it will terminate old pods.

You can check status of the update by running

kubectl rollout status deployment.v1.apps/nginx-deployment

Additional resources: