-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathcommands.txt
250 lines (250 loc) · 8.99 KB
/
commands.txt
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
410 git commit -am"adding installation cmds"
411 git clone [email protected]:manikcloud/k8s.git
412 cd k8s/
413 ll
414 cp /opt/k8s/history.txt .
415 ll
416 git status
417 git- version
418 git -version
419 git --version
420 ll
421 echo "hi" >test.txt
422 ll
423 git status
424 mv history.txt commands.tx
425 ll
426 rm test.txt
427 ll
428 git status
429 git add .
430 git commit -am"adding commands"
431 git push
432 kubectl get pods --namespace kube-system
433 cat /etc/os-release
434 ll
435 cd installation/
436 sh cleanup.sh
437 sh installation.sh
438 kubectl get pods --namespace kube-system
439 kubectl get pods --namespace
440 kubectl get pods --namespace kube-system
441 kubectl get pods --namespace kube-system -o
442 kubectl get pods -o --namespace kube-system
443 kubectl get pods --namespace kube-system
444 ll
445 exit
446 cd /opt/
447 git clone [email protected]:manikcloud/k8s.git
448 ssh-keygen
449 cat ~/.ssh/id_rsa.pub
450 git clone [email protected]:manikcloud/k8s.git
451 ll
452 cd k8s/
453 ll
454 cd installation/
455 ll
456 sh installation.sh
457 kubectl get pods
458 sh cleanup.sh
459 kubectl get pods
460 sudo su
461 exit
462 ll
463 cd k8s/
464 ll
465 cd installation/
466 ll
467 sudo kubectl get nodes
468 kubectl get pods --all-namespaces
469 kubeadm join 172.31.18.86:6443 --token xyyfpn.swsr7ozzk2g6jst2 --discovery-token-ca-cert-hash sha256:420cc20fd45f073a42f395fdbe9b3e642a26db1cb675406a8f4374db5a650f95kubeadm join 172.31.18.86:6443 --token xyyfpn.swsr7ozzk2g6jst2 \
470 kubeadm join 172.31.18.86:6443 --token xyyfpn.swsr7ozzk2g6jst2 --discovery-token-ca-cert-hash sha256:420cc20fd45f073a42f395fdbe9b3e642a26db1cb675406a8f4374db5a650f95
471 kubectl get pods --all-namespaces
472 free -m
473 ll
474 cd $HOME/.kube/
475 ll
476 les config
477 less config
478 ll
479 kubectl get node
480 cd -
481 kubeadm join 172.31.64.38:6443 --token 425qb8.51rbrxc5h862g202 \
482 kubeadm join 172.31.64.38:6443 --token 425qb8.51rbrxc5h862g202 --discovery-token-ca-cert-hash sha256:a502867d97b05820f186e3ee748afddd9142aae4104aee804d30662148138bae
483 kubectl run nginx --image=nginx
484 kubectl get pods
485 kubectl get pods --all-namespaces
486 kubectl get namespaces
487 kubectl get pods --all-namespaces
488 kubectl get pods
489 kubectl run nginx --image=httpd
490 kubectl run httpd --image=httpd
491 kubectl get pods
492 kubectl get nodes
493 kubeadm join 172.31.64.38:6443 --token 425qb8.51rbrxc5h862g202 --discovery-token-ca-cert-hash sha256:a502867d97b05820f186e3ee748afddd9142aae4104aee804d30662148138bae
494 kubectl get nodes
495 kubectl get pods
496 kubectl taint nodes --all node-role.kubernetes.io/master-
497 kubectl get pods
498 ll
499 cd ..
500 git pull
501 kubeadm token list
502 ll
503 cd pods
504 ll
505 vim pod-def.yaml
506 kubectl create -f pod-def.yaml
507 kubectl get pods
508 history
509 kubectl get pods
510 kubectl get pods -o
511 kubectl get pods -O
512 kubectl get pods
513 kubectl get pods -o wide
514 kubectl create -f pod-def.yaml
515 kubectl run nginx --image=nginx
516 kubectl run nginx1 --image=nginx
517 kubectl get pods -o wide
518 kubectl get replicationcontrolle
519 kubectl get replicationcontroller
520 kubectl get replicationcontroller --all-namespace
521 kubectl get replicationcontroller --all-namespaces
522 kubectl get services
523 kubectl get pods --all-namespaces
524 ll
525 vim multi-container.yaml
526 kubectl create -f multi-container.yaml
527 kubectl get pods
528 vim web-container.yaml
529 cd ..
530 ll
531 cd ReplicaSet/
532 ll
533 vim ReplicaSet.yaml
534 kubectl create -f ReplicaSet.yaml
535 kubectl get pod
536 kubectl get pod -o wide
537 vim ReplicaSet.yaml
538 kubectl get replicaset
539 kubectl get replicaset -o wide
540 ll
541 cd ..
542 ll
543 127.0.0.1:8001
544 kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | awk '/^deployment-controller-token-/{print $1}') | awk '$1=="token:"{print $2}'
545 kubectl -n kube-system describe secret
546 kubectl config set-context --current --namespace=NAMESPACE
547 kubectl config set-context --current --namespace=kube-system
548 kubectl config set-context --current --namespace=kubernetes-dashboard
549 kubectl get pods
550 kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | awk '/^deployment-controller-token-/{print $1}') | awk '$1=="token:"{print $2}'
551 cd k8s/
552 cd ReplicaSet/
553 ll
554 kubectl create -f ReplicaSet.yaml
555 kubectl config set-context --current --namespace=DEFAULT
556 kubectl get name-space
557 kubectl get name-spaces
558 kubectl get namespaces
559 kubectl config set-context --current --namespace=default
560 kubectl get pods
561 kubectl create -f ReplicaSet.yaml
562 kubectl get pods
563 pwd
564 cd ..
565 ll
566 vim ReplicaSet/ReplicaSet.yaml
567 cd ReplicaSet/
568 vim ReplicaSet-sl-ex.yaml
569 kubectl create -f ReplicaSet-sl-ex.yaml
570 kubectl get pods
571 kubectl get pods -o wide
572 kubectl get node
573 kubectl get pods -o wide
574 kubectl get node -o wide
575 kubectl get replicaset -o wide
576 kubectl delete replicaset sl-replicaset
577 kubectl get replicaset -o wide
578 kubectl get pods -o wide
579 cd ..
580 ll
581 cd deployment/
582 ll
583 vim deployment.yaml
584 kubectl create -f deployment.yaml
585 kubectl get deployment -o wide
586 kubectl describe deployment web-app-deployment
587 kubectl get pods -o wide
588 ll
589 vim bg-deployment.yaml
590 kubectl rollout history deployment/web-app-deployment
591 kubectl delete deployment web-app-deployment
592 kubectl get pods -o wide
593 kubectl delete pod --all
594 kubectl get pods -o wide
595 kubectl create -f deployment/deployment.yaml --record
596 cd ..
597 cd -
598 kubectl create -f deployment/deployment.yaml --record
599 kubectl rollout history deployment/web-app-deployment
600 ll
601 kubectl edit deployment web-app-deployment --record
602 kubectl rollout history deployment/web-app-deployment
603 kubectl rollout status deployment/web-app-deployment
604 kubectl get pods -o wide
605 vim deployment/
606 vim deployment/deployment.yaml
607 kubectl set image deployment web-app-deployment blue=varunmanik/httpd:v1-green --record
608 kubectl get pods -o wide
609 kubectl set image deployment web-app-deployment blue=varunmanik/httpd:green --record
610 kubectl get pods -o wide
611 kubectl rollout history deployment web-app-deployment
612 kubectl scale deployment web-app-deployment --replicas=16
613 kubectl get pods -o wide
614 kubectl scale deployment web-app-deployment --replicas=2
615 kubectl get pods -o wide
616 ll
617 sudo apt install software-properties-common apt-transport-https wget
618 du -sh
619 lsblk
620 df -h
621 docker ps -a
622 kubectl get pods -o wide --all-namespaces
623 kubectl delete replicaset sl-replicaset --namesapce kubernetes-dashboard
624 kubectl delete replicaset sl-replicaset --namespace kubernetes-dashboard
625 kubectl get pods -o wide --all-namespaces
626 sudo apt install software-properties-common apt-transport-https wget
627 wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
628 sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
629 sudo apt install code
630 code
631 kubectl get pods -o wide
632 kubectl scale deployment web-app-deployment --replicas=4
633 kubectl get pods -o wide
634 kubectl get services/
635 kubectl get services
636 kubectl get services -o wide
637 kubectl describe web-app-service
638 kubectl describe service web-app-service
639 kubectl scale deployment web-app-deployment --replicas=8
640 kubectl get services -o wide
641 kubectl get services, pods -o wide
642 kubectl get services,pods -o wide
643 kubectl scale deployment web-app-deployment --replicas=1
644 kubectl get services,pods -o wide
645 kubectl rollout undo deployment/web-app-deployment --to-revision=1
646 kubectl get services,pods -o wide
647 kubectl get deployment
648 kubectl rollout history deployment/web-app-deployment
649 kubectl rollout undo deployment/web-app-deployment --to-revision=3
650 kubectl rollout history deployment/web-app-deployment
651 kubectl get namespaces
652 kubectl get pods --namespace kube-system
653 kubectl get pods --namespace kube-system -o wid
654 kubectl get pods --namespace kube-system -o wide
655 kubectl get pods --namespace --all-namespace
656 kubectl get pods --all-namespace
657 kubectl get pods --all-namespaces
658 ll
659 history >> commands.tx