Advertisement
sandervanvugt

CKA day1 june22

Jun 21st, 2022
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.27 KB | None | 0 0
  1. USER StuDENT
  2. student@control:~/cka$ history
  3. 1 sudo -i
  4. 2 ls -l .kube/config
  5. 3 kubectl get all
  6. 4 kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
  7. 5 kubectl get ns
  8. 6 kubectl get all -n kube-system
  9. 7 kubectl get nodes
  10. 8 kubectl create deploy testginx --image=nginx --replicas=3
  11. 9 kubectl get pods -o wide
  12. 10 sudo -i
  13. 11 history
  14. 12 kubectl get pods -n kube-system
  15. 13 kubectl describe etcd-control
  16. 14 kubectl describe etcd-control -n kube-system
  17. 15*
  18. 16 kubectl -n kube-system describe deploy
  19. 17 cd cka
  20. 18 git clone https://github.com/sandervanvugt/cka
  21. 19 cd cka/
  22. 20 vim kubeadm-config.yaml
  23. 21 kubectl version
  24. 22 vim kubeadm-config.yaml
  25. 23 source <(kubectl completion bash)
  26. 24 kubectl create ns mynamespace
  27. 25 kubectl run mypod --image=alpine -n mynamespace -- sleep 3600
  28. 26 kubectl get pods -n mynamespace
  29. 27 kubectl get pods -n mynamespace -o yaml
  30. 28 sudo -i
  31. 29 kubectl get pods -n kube-system
  32. 30 kubectl get pods -n kube-system -o wide
  33. 31 kubectl get nodes
  34. 32 kubectl get all -n kube-system
  35. 33 kubectl describe daemonsets.apps calico-node
  36. 34 kubectl describe daemonsets.apps calico-node -n kube-system
  37. 35 kubectl get pods -n kube-system
  38. 36 kubectl describe -n kube-system pod calico-node-8kxht
  39. 37 kubectl logs -n kube-system calico-node-m4mj5
  40. 38 history
  41. 39 ./counter.sh 12
  42. 40 ./counter.sh 5
  43. 41 vim multi.yaml
  44. 42 kubectl create -f multi.yaml
  45. 43 kubectl get pods
  46. 44 kubectl describe pods three-containers
  47. 45 kubectl delete -f multi.yaml
  48. 46 vim multi.yaml
  49. 47 kubectl create -f multi.yaml
  50. 48 kubectl get pods
  51. 49 cat multi.yaml
  52. 50 vim wg.yaml
  53. 51 kubectl create -f wg.yaml
  54. 52 kubectl get pods
  55. 53 cat wg.yaml
  56. 54 ./counter.sh 18
  57. 55 kubectl create quota -h | less
  58. 56 kubectl set resources -h | less
  59. 57 ./counter.sh 7
  60. 58 cd
  61. 59 kubectl create ns restricted
  62. 60 kubectl get ns
  63. 61 kubectl create quota qtest --hard pods=3,cpu=100m,memory=500Mi -n restricted
  64. 62 kubectl describe quota -n restricted
  65. 63 kubectl create deploy rginx --image=nginx --replicas=3 -n restricted
  66. 64 kubectl describe quota -n restricted
  67. 65 kubectl get all -n restricted
  68. 66 kubectl describe deployments.apps rginx -n restricted
  69. 67 kubectl describe deployments.apps rginx-95d54596d -n restricted
  70. 68 kubectl describe -n restricted replicasets.apps rginx-95d54596d
  71. 69 kubectl set resources deploy rginx --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi -n restricted
  72. 70 kubectl get all -n restricted
  73. 71 kubectl describe -n restricted quota
  74. 72 kubectl -n restricted edit quota
  75. 73 kubectl describe -n restricted quota
  76. 74 kubectl edit deployments.apps -n restricted rginx
  77. 75 kubectl describe -n restricted quota
  78. 76 kubectl run -n restricted busybox -- sleep 3600
  79. 77 kubectl run bbox -n restricted --image=busybox -- sleep 3600
  80. 78 kubectl run -h
  81. 79 kubectl -n restricted get pods -o yaml
  82. 80 kubectl run bbox -n restricted --image=busybox --dry-run=client -o yaml -- sleep 3600 > bbox.yaml
  83. 81 vim bbox.yaml
  84. 82 kubectl create -f bbox.yaml
  85. 83 vim bbox.yaml
  86. 84 kubectl explain pod.spec --recursive | less
  87. 85 kubectl explain pod.spec | less
  88. 86 vim bbox.yaml
  89. 87 kubectl create -f bbox.yaml
  90. 88 history
  91. 89 cka/counter.sh 8
  92. 90 cka/counter.sh 12
  93. 91 vim rs.yaml
  94. 92 kubectl api-resources | less
  95. 93 vim rs.yaml
  96. 94 kubectl create -f rs.yaml
  97. 95 kubectl get pvc,pv
  98. 96 cd cka/
  99. 97 vim nwpolicy-complete-example.yaml
  100. 98 kubectl create -f nwpolicy-complete-example.yaml
  101. 99 kubectl get all
  102. 100 kubectl get nwp
  103. 101 kubectl get networkpolicy
  104. 102 kubectl expose pod nginx --port=80
  105. 103 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  106. 104 kubectl get pods --show-labels
  107. 105 kubectl get networkpolicy -o yaml
  108. 106 kubectl label pod busybox access=true
  109. 107 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  110. 108 rm ~/.kube/config
  111. 109 kubectl get all
  112. 110 ls ~/.kube/
  113. 111 sudo cp -i /etc/kubernetes/admin.conf ~/.kube/config
  114. 112 ls -l ~/.kube
  115. 113 kubectl get all
  116. 114 sudo chown student:student ~/.kube/config
  117. 115 kubectl get all
  118. 116 kubectl get pods -n kube-system
  119. 117 ps aux | grep apiserver
  120. 118 kubectl config view
  121. 119 less ~/.kube/config
  122. 120 history
  123.  
  124.  
  125. USER ROOTroot@control:~# history
  126. 1 vim /etc/hosts
  127. 2 cat /etc/hosts
  128. 3 ping worker1
  129. 4 git clone https://github.com/sandervanvugt/cka
  130. 5 cd cka
  131. 6 ls *sh
  132. 7 ./setup-container.sh
  133. 8 ls *sh
  134. 9 ./setup-kubetools-new.sh
  135. 10 vim kubeadm-config.yaml
  136. 11 kubectl version
  137. 12 vim kubeadm-config.yaml
  138. 13 kubeadm init --help | less
  139. 14 kubeadm init --kubeadmin-config.yaml
  140. 15 kubeadm init --config kubeadmin-config.yaml
  141. 16 kubeadm init --config kubeadm-config.yaml
  142. 17 vim join.txt
  143. 18 history
  144. 19 cat kubeadm-config.yaml
  145. 20 exit
  146. 21 history
  147. 22 exit
  148. 23 systemctl status containerd
  149. 24 systemctl status kubelet
  150. 25 exit
  151. 26 history
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement