Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ffb40e2

Browse files
Kalyan Reddy DaidaKalyan Reddy Daida
Kalyan Reddy Daida
authored and
Kalyan Reddy Daida
committed
Welcome to Stack Simplify
1 parent f4ee013 commit ffb40e2

File tree

1 file changed

+64
-16
lines changed
  • 04-Deployments-with-kubectl/04-03-Rollback-Deployment

1 file changed

+64
-16
lines changed

‎04-Deployments-with-kubectl/04-03-Rollback-Deployment/README.md‎

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,96 @@
66
- Specific Version
77

88
## Step-01: Rollback a Deployment to previous version
9+
10+
### Check the Rollout History of a Deployment
911
```
10-
# Check the Rollout History of a Deployment
12+
# List Deployment Rollout History
1113
kubectl rollout history deployment/<Deployment-Name>
1214
kubectl rollout history deployment/my-first-deployment
15+
```
1316

14-
# Verify changes in each revision
17+
### Verify changes in each revision
18+
- **Observation:** Review the "Annotations" and "Image" tags for clear understanding about changes.
19+
```
20+
# List Deployment History with revision information
1521
kubectl rollout history deployment/my-first-deployment --revision=1
1622
kubectl rollout history deployment/my-first-deployment --revision=2
1723
kubectl rollout history deployment/my-first-deployment --revision=3
18-
Observation: Review the "Annotations" and "Image" tags for clear understanding about changes.
24+
```
1925

20-
# Rollback to previous version
26+
27+
### Rollback to previous version
28+
- **Observation:** If we rollback, it will go back to revision-2 and its number increases to revision-4
29+
```
30+
# Undo Deployment
2131
kubectl rollout undo deployment/my-first-deployment
22-
kubectl rollout history deployment/my-first-deployment
23-
Observation: If we rollback, it will go back to revision-2 and its number increases to revision-4
2432
25-
# Access the Application and Test if we are "Application Version: V2"
26-
http://<node1-public-ip>:<Node-Port>
33+
# List Deployment Rollout History
34+
kubectl rollout history deployment/my-first-deployment
35+
```
2736

28-
# Verify Deployment, Pods, ReplicaSets
37+
### Verify Deployment, Pods, ReplicaSets
38+
```
2939
kubectl get deploy
3040
kubectl get rs
3141
kubectl get po
3242
kubectl describe deploy my-first-deployment
3343
```
44+
45+
### Access the Application using Public IP
46+
- We should see `Application Version:V2` whenever we access the application in browser
47+
```
48+
# Get NodePort
49+
kubectl get svc
50+
Observation: Make a note of port which starts with 3 (Example: 80:3xxxx/TCP). Capture the port 3xxxx and use it in application URL below.
51+
52+
# Get Public IP of Worker Nodes
53+
kubectl get nodes -o wide
54+
Observation: Make a note of "EXTERNAL-IP" if your Kubernetes cluster is setup on AWS EKS.
55+
56+
# Application URL
57+
http://<worker-node-public-ip>:<Node-Port>
58+
```
59+
60+
3461
## Step-02: Rollback to specific revision
62+
### Check the Rollout History of a Deployment
3563
```
36-
# Check the Rollout History of a Deployment
64+
# List Deployment Rollout History
3765
kubectl rollout history deployment/<Deployment-Name>
3866
kubectl rollout history deployment/my-first-deployment
39-
40-
# Rollback to specific revision
67+
```
68+
### Rollback to specific revision
69+
```
70+
# Rollback Deployment to Specific Revision
4171
kubectl rollout undo deployment/my-first-deployment --to-revision=3
72+
```
73+
74+
### List Deployment History
75+
- **Observation:** If we rollback to revision 3, it will go back to revision-3 and its number increases to revision-5 in rollout history
76+
```
77+
# List Deployment Rollout History
4278
kubectl rollout history deployment/my-first-deployment
43-
Observation: If we rollback to revision 3, it will go back to revision-3 and its number increases to revision-5
79+
```
80+
81+
82+
### Access the Application using Public IP
83+
- We should see `Application Version:V3` whenever we access the application in browser
84+
```
85+
# Get NodePort
86+
kubectl get svc
87+
Observation: Make a note of port which starts with 3 (Example: 80:3xxxx/TCP). Capture the port 3xxxx and use it in application URL below.
88+
89+
# Get Public IP of Worker Nodes
90+
kubectl get nodes -o wide
91+
Observation: Make a note of "EXTERNAL-IP" if your Kubernetes cluster is setup on AWS EKS.
4492
45-
# Access the Application and Test if we are "Application Version: V3"
46-
http://<node1-public-ip>:<Node-Port>
93+
# Application URL
94+
http://<worker-node-public-ip>:<Node-Port>
4795
```
4896

4997
## Step-03: Rolling Restarts of Application
50-
- Rolling restarts will kill the existing pods and recreate new pods.
98+
- Rolling restarts will kill the existing pods and recreate new pods in a rolling fashion.
5199
```
52100
# Rolling Restarts
53101
kubectl rollout restart deployment/<Deployment-Name>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /