Skip to content

Commit

Permalink
roll update
Browse files Browse the repository at this point in the history
  • Loading branch information
lerndevopss committed Apr 30, 2020
1 parent 0362e74 commit d34fcf0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
68 changes: 68 additions & 0 deletions controllers/rolling-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## Step1: Deploy Version 1

```
## Create a deployment with a record (for rollbacks):
kubectl create -f deployment-ex3.yml --record
## Check the status of the rollout:
kubectl rollout status deployments kubeserve
## validate deployment & Service
kubectl get deploy kubeserve -o wide
kubectl get pods -o wide
kubectl get svc kubeserve-svc -o wide
kubectl get ep kubeserve-svc
```

## Step2: edit the deployment yml file & Update the version 'v2' to perform rolling update

```
## before we apply v2, lets access the application & check the output
kubectl get svc kubeserve-svc ## copy service IP
Run this curl look while the update happens:
while true; do curl http://serviceIP; done # Run this on Node -- DO NOT ON MASTER
## Use kubectl apply to update a deployment:
kubectl apply -f deployment-ex3.yml --record
## validate: deployment to see the updated image
kubectl roullout status deploy kubeserve
kubectl get deploy kubeserve -o wide
```

## Step3: Now, edit the version of image back to ‘v1’ in yml file & apply

```
kubectl apply -f kubeserve-deployment.yaml --record
cotinue to watch the application output node
```


## Step4: Apply the rolling update to version 3 (buggy)

```
kubectl set image deployment kubeserve app=leaddevops/kubeserve:v3
continue to watch the output of application throwing errors with buggy app
undo the deployment
kubectl rollout undo deployment kubeserve
To Roll back to a certain revision:
check the rollout history to go back to version
kubectl rollout history deployment kubeserve
kubectl rollout undo deployment kubeserve --to-revision=2
```
2 changes: 1 addition & 1 deletion exam-prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kubectl create service nodeport nginx --tcp=80:80 --node-port=30080 --dry-run -o
kubectl create service clusterip nginx --tcp=80:80 --dry-run -o yaml ## generate a service yaml with type: ClusterIP
```

## `Generate Service yaml for run pods/deployment`
## `Generate Service yaml for to expose/access running pods/deployment`

```
## Note: to use below commands, the pod/deployment must be created first
Expand Down

0 comments on commit d34fcf0

Please sign in to comment.