github.com/googlecloudplatform/kubernetes-workshops@v0.0.0-20180501174420-d8199445b2c3/bundles/kubernetes-101/workshop/labs/rolling-out-updates.md (about)

     1  # Rolling out Updates
     2  
     3  Kubernetes makes it easy to rollout updates to your applications using the builtin rolling update mechanism. In this lab you will learn how to:
     4  
     5  * Modify deployments to trigger rolling updates
     6  * Pause and resume an active rolling update
     7  * Rollback a deployment to a previous revision
     8  
     9  
    10  ## Tutorial: Rollout a new version of the Auth service
    11  
    12  ```
    13  kubectl rollout history deployment auth
    14  ```
    15  
    16  Modify the auth deployment image:
    17  
    18  ```
    19  vim deployments/auth.yaml
    20  ```
    21  
    22  ```
    23  image: "askcarter/auth:2.0.0"
    24  ```
    25  
    26  ```
    27  kubectl apply -f deployments/auth.yaml --record
    28  ```
    29  
    30  ```
    31  kubectl describe deployments auth
    32  ```
    33  
    34  ```
    35  kubectl get replicasets
    36  ```
    37  
    38  ```
    39  kubectl rollout history deployment auth
    40  ```
    41  
    42  ## Tutorial: Pause and Resume an Active Rollout
    43  
    44  ```
    45  kubectl rollout history deployment hello
    46  ```
    47  
    48  Modify the hello deployment image:
    49  
    50  ```
    51  vim deployments/hello.yaml
    52  ```
    53  
    54  ```
    55  image: "askcarter/hello:2.0.0"
    56  ```
    57  
    58  ```
    59  kubectl apply -f deployments/hello.yaml --record
    60  ```
    61  
    62  ```
    63  kubectl describe deployments hello
    64  ```
    65  
    66  ```
    67  kubectl rollout pause deployment hello
    68  ```
    69  
    70  ```
    71  kubectl rollout resume deployment hello
    72  ```
    73  
    74  ## Exercise: Rollback the Hello service
    75  
    76  Use the `kubectl rollout undo` command to rollback to a previous deployment of the Hello service.
    77  
    78  ## Summary
    79  
    80  In this lab you learned how to rollout updates to your applications by modifying deployment objects to trigger rolling updates. You also learned how to pause and resume an active rolling update and rollback it back using the `kubectl rollout` command.