-
Notifications
You must be signed in to change notification settings - Fork 1
/
DemoCommands.sh
131 lines (88 loc) · 2.19 KB
/
DemoCommands.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
###
#Demo 1 - Pod
#Show K8s contexts
kubectl config get-contexts
#Show K8s nodes
kubectl get nodes
#Show K8s pods - none at this point
kubectl get pods
#Deploy pod
kubectl apply -f pod.yml
#Show K8s pods - one exists
kubectl get pods
#Congrats, you've deployed your first Kubernetes workload!
#Pod details
kubectl describe pod vmug-first-pod
###
#Demo 2 - Services
#VMUG local service
kubectl apply -f svc-vmug-local.yml
#Show K8s services
kubectl get service
#Only a NodePort, let's delete
kubectl delete svc svc-vmug-local
#Cloud (load balancer) service
kubectl apply -f svc-cloud.yml
#Show K8s services
kubectl get service
#Clean everything up
kubectl delete svc cloud-lb
kubectl delete pod vmug-first-pod
#All gone
kubectl get pods
###
#Demo 3 - Deployment
#No deployments yet
kubectl get deployments
#First deployment
kubectl apply -f deploy.yml
#New deployment
kubectl get
#Look at all those pods
kubectl get pods
###
#Demo 4 - Self-healing
#Delete a pod
kubectl delete pod vmug-deploy-#
#It's terminated
kubectl get pods
#Get our deployment
kubectl get deployment
###
#Demo 5 - Scaling
#Update the deployment - deploy.yml
#Check the details
cat deploy.yml
#Update the deployment
kubectl apply -f deploy.yml
#Check the deployment
kubectl get deployment vmug-deploy
#Look at pods
kubectl get pods
#Manual scaling
kubectl scale --replicas 6 deployment/vmug-deploy
#Watch the pods
kubectl get pods
#Update the deployment back to propet replicas - deploy.yml
#Check the details
cat deploy.yml
#Update the deployment
kubectl apply -f deploy.yml
#Look at pods decrease
kubectl get pods
#Check the deployment
kubectl get deployment vmug-deploy
###
#Demo 6 - Rolling Update
#Update deploy.yml with details from rolling-update.yml
#Start the upgrade
kubectl apply -f deploy.yml
#Check the rollout
kubectl rollout status deployment vmug-deploy
#Set load balanger service (forgot in video)
kubectl apply -f svc-cloud.yml
#Confirm the new version of web app is online via browser
# Success, thanks for following along.
# I hope you learned something, you can also reach out to me on
# Twitter (@jhoughes), or email me at [email protected]
#Thanks y'all, I want to see you present at the next VMUG Usercon!