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
  • restart a pod kubernetes
  • pod upgrade
  • kubernetes get deployments
  • change cluster kubectl
  • kubectl create
  • kubectl config kubernetes dashboard
  • upgrade kubectl
  • kubectl patch annotation
  • kubectl restart recreate pod
  • kubectl run create service
  • restart deployment kubernetes
  • kubectl patch kubernetes
  • change pv from released to available kubernetes
  • kubectl patch annotation on pods
  • How to deploy a Kubernetes app
  • Creating a kubernetes service cluster
  • install kubernetes cluster with kubeadm
  • kubernetes config context change environment/cluster
  • kubectl update field
  • kubectl patch annotation
  • how to chnage kubectl to k
  • kuberetes config
  • kubectl run create service
  • kubernetes setup
  • how to upgrade a kubeone cluster
  • Use Kubespray to deploy a Production Ready Kubernetes Cluster
  • get the kubernetics command to update the node partially
  • Kubernetes configuration
  • kubernetes kustomize kubectl

  • 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.