Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

How to update a Kubernetes app

Sumit Rawal answered on May 14, 2023 Popularity 8/10 Helpfulness 1/10

Contents


More Related Answers

  • change default kube editor
  • pod upgrade
  • restart a pod kubernetes
  • kubernetes deployment
  • change cluster kubectl
  • kubectl create
  • restart deployment kubernetes
  • kubectl config kubernetes dashboard
  • upgrade kubectl
  • kubectl patch annotation
  • kubectl run create service
  • kubectl restart recreate pod
  • kubectl patch kubernetes
  • kubectl update field
  • change pv from released to available kubernetes
  • kubectl patch annotation on pods
  • Creating a kubernetes service cluster
  • change kuber cluster
  • install kubernetes cluster with kubeadm
  • kubernetes config context change environment/cluster
  • kubernetes kustomize kubectl
  • How to deploy a Kubernetes app
  • kubectl patch annotation
  • how to chnage kubectl to k
  • kuberetes config
  • kubectl run create service
  • kubectl create deploy
  • kubernetes setup
  • how to upgrade a kubeone cluster
  • Use Kubespray to deploy a Production Ready Kubernetes Cluster

  • How to update a Kubernetes app

    0

    Finally, we know that no app rules forever; eventually, a new version will replace the old. In our case, say a new version of our hello-node pod is created and we want to use it to replace all of our old pods. Well as we discussed previously, Kubernetes has us covered as we can make this upgrade with no downtime using a rolling update.

    As there is no new version of hello-node, this would give an error message if entered.

    However, if there were an updated version, you would apply it by entering:

    kubectl set image deployments/hello-node hello-node=myContainers/hello-node:v2

    To break this down, we first mark that we’d like to set a new image, then specify the type we’re going to adapt, deployments, then which deployment, hello-node. After the first mention of our deployment, we’ve told the command what we’d like to edit, at which point we then provide the new image, myContainers/hello-node:v2.

    Kubernetes will then take each of our old pods down one by one and replace them with our upgraded version. This takes a moment and does get longer depending on the number of pods which must be upgraded. To check if the upgrade rollout is successful, we would enter:

    kubectl rollout status deployments/hello-node

    Which, if completed, would return:

    deployment "hello-node" successfully rolled out

    With that, we’ve finished our creation and exploration of a Kubernetes basic program. To conclude your masterpiece, now simply enter the two lines:

    kubectl delete service hello-node

    kubectl delete deployment hello-node

    This will clean up your system and leave your system ready for your next Kubernetes project!

    Popularity 8/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 14 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.