kubectl rolling-update rc correspond to api?

10/17/2015

kubectl rolling-update foo new_image. What interface API for rolling-update? Give an example for update new image? thanks!

-- ttyyll
kubernetes

4 Answers

10/18/2015

If you run "kubectl help rollingupdate" you will get the answer to your question. (And new_image is a docker image.)

Additional documentation: https://github.com/kubernetes/kubernetes/tree/master/docs/user-guide/update-demo

-- DavidO
Source: StackOverflow

6/5/2018

If you check fabric8 rolling-update implementation (API mentioned below), they are creating a new replica set with a same deployed replica set spec and they increase the count in new replica set and wait for it to complete and then they decrease count from old deployed replica-set, thus maintaining availability.

    private static void updateRc(KubernetesClient client){
        System.out.println("updating rollinh");
       // client.replicationControllers().inNamespace("default").withName("my-nginx").rolling().updateImage("nginx:latest");
        client.extensions().replicaSets().inNamespace("default").withName("fgrg-73-nginxcontainer1-74-97775d4d8").rolling().updateImage("nginx:latest");
        System.out.println("done");
    }
-- Rishi Anand
Source: StackOverflow

6/5/2018

One way to do rolling update via api is to first check if deployment.spec.updateStrategy is RollingUpdate and if not then update it after this just edit the deployment with the new image tag.

-- Rishi Anand
Source: StackOverflow

10/19/2015

There is no API method for rolling-update, the CLI makes calls to the pod and replicationcontroller APIs behind the scenes to achieve a rolling update

-- csanchez
Source: StackOverflow