Advertisement
sandervanvugt

CKA may23 day1

May 30th, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. student@control:~/cka$ history
  2. 1 sudo apt install vim git -y
  3. 2 vim /etc/hosts
  4. 3 sudo -i
  5. 4 git clone https://github.com/sandervanvugt/cka
  6. 5 ip a
  7. 6 ip route show
  8. 7 sudo -i
  9. 8 history
  10. 9 git clone https://github.com/sandervanvugt/cka
  11. 10 cd cka
  12. 11 ls *sh
  13. 12 sudo ./setup-container.sh
  14. 13 ls *sh
  15. 14 sudo ./setup-kubetools.sh
  16. 15 history
  17. 16 sudo kubeadm init
  18. 17 kubectl get all
  19. 18 kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/tigera-operator.yaml
  20. 19 kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/custom-resources.yaml
  21. 20 kubectl get ns
  22. 21 kubectl get pods
  23. 22 kubectl get pods -n tigera-operator
  24. 23 kubectl get pods -n kube-system
  25. 24 kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/custom-resources.yaml
  26. 25 kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/custom-resources.yaml
  27. 26 kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml
  28. 27 kubectl get ns
  29. 28 kubectl get pods
  30. 29 kubectl get pods -n kube-system
  31. 30 kubectl get nodes
  32. 31 kubectl create deploy testginx --image=nginx
  33. 32 kubectl get pods
  34. 33 kubectl get nodes
  35. 34 history
  36. 35 kubectl get pods -n kube-system
  37. 36 source <(kubectl completion bash)
  38. 37 kubectl create ns mynamespace
  39. 38 kubectl run task2pod --image=alpine -- sleep 3600
  40. 39 kubectl run -n mynamespace task2pod --image=alpine -- sleep 3600
  41. 40 kubectl get pods -n mynamespace
  42. 41 kubectl edit -n mynamespace pod task2pod
  43. 42 history
  44. 43 vim lab3.yaml
  45. 44 kubectl apply -f lab3.yaml
  46. 45 kubectl get pods
  47. 46 kubectl describe pod task3pod
  48. 47 kubectl run failingbox --image=busybox
  49. 48 kubectl get pods
  50. 49 kubectl delete pod failingbox
  51. 50 kubectl run succesfulbox --image=busybox -- sleep 3600
  52. 51 kubectl get pods
  53. 52 kubectl get pods -o yaml
  54. 53 kubectl get pods succesfulbox -o yaml | less
  55. 54 kubectl create quota -h | less
  56. 55 kubectl create ns limited
  57. 56 kubectl create quota qtest --hard pods=3,cpu=100m.memory=500Mi -n limited
  58. 57 kubectl create quota qtest --hard pods=3,cpu=100m,memory=500Mi -n limited
  59. 58 kubectl describe quota -n limited
  60. 59 kubectl create deploy nginx --image=nginx:latest --replicas=3 -n limited
  61. 60 kubectl get all -n limited
  62. 61 kubectl describe -n limited rs/nginx-7bf8c77b5b
  63. 62 kubectl set -h
  64. 63 kubectl set resources -h
  65. 64 kubectl set resources -n limited --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi
  66. 65 kubectl set resources -n limited --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi deploy nginx
  67. 66 kubectl get all -n limited
  68. 67 kubectl describe -n limited
  69. 68 kubectl describe ns limited
  70. 69 kubectl edit ns limited
  71. 70 kubectl edit -n limited quota qtest
  72. 71 kubectl get all -n limited
  73. 72 kubectl scale -n limited deploy nginx --replicas=3
  74. 73 kubectl get all -n limited
  75. 74 ./counter.sh 8
  76. 75 history
  77. 76 cat /etc/os-release
  78. 77 history | less
  79. 78 vim nwpolicy-complete-example.yaml
  80. 79 kubectl apply -f nwpolicy-complete-example.yaml
  81. 80 kubectl expose pod nginx --port=80
  82. 81 kubectl describe svc nginx
  83. 82 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  84. 83 kubectl label pod busybox access=true
  85. 84 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  86. 85 kubectl create ns nwp-namespace
  87. 86 vim nwp-lab9-1.yaml
  88. 87 kubectl create -f nwp-lab9-1.yaml
  89. 88 kubectl expose pod nwp-nginx --port=80
  90. 89 kubectl exec -it newp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx
  91. 90 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx
  92. 91 kubectl exec -it nwp-busybox -n nwp-namespace -- nslookup nwp-nginx
  93. 92 kubectl exec -it nwp-busybox -n nwp-namespace -- nslookup nwp-nginx.default.svc.cluster.local
  94. 93 kubectl get svc
  95. 94 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
  96. 95 vim nwp-lab9-1.yaml
  97. 96 vim nwp-lab9-2.yaml
  98. 97 kubectl create -f nwp-lab9-2.yaml
  99. 98 kubectl exec -it nwp-busybox -n nwp-namespace -- wget --spider --timeout=1 nwp-nginx.default.svc.cluster.local
  100. 99 kubectl create deployment busybox --image=busybox --sleep 3600
  101. 100 kubectl create deployment busybox --image=busybox -- sleep 3600
  102. 101 kubectl exec -it busybox-c95495658-ljctl -- wget --spider --timeout=1 nwp-nginx
  103. 102 kubectl delete -f nwp-lab9-2.yaml
  104. 103 echo google for ahmetdb
  105. 104 ./counter.sh 20
  106. 105 vim rh.yaml
  107. 106 ./counter.sh 5
  108. 107 vim rh.yaml
  109. 108 vim wz.yaml
  110. 109 history
  111. 110 vim wz-lab6.yaml
  112. 111 kubectl get pods
  113. 112 kubectl get pods busybox -o yaml | less
  114. 113 vim wz-lab6.yaml
  115. 114 kubectl apply -f wz-lab6.yaml
  116. 115 vim wz-lab6.yaml
  117. 116 kubectl apply -f wz-lab6.yaml
  118. 117 kubectl expose pod task6pod --port=80
  119. 118 kubectl get svc
  120. 119 kubectl edit svc task6pod
  121. 120 kubectl get svc
  122. 121 curl 192.168.29.81:31761
  123. 122 kubectl get pods task6pod -o yaml | less
  124. 123 kubectl exec -it task6pod -- sh
  125. 124 kubectl exec -it task6pod -c nginx -- sh
  126. 125 curl 192.168.29.81:31761
  127. 126 kubectl delete -f wz-lab6.yaml
  128. 127 vim wz-lab6.yaml
  129. 128 kubectl apply -f wz-lab6.yaml
  130. 129 kubectl expose pod task6podsvv --type=NodePort
  131. 130 kubectl expose pod task6podsvv --type=NodePort --port=80
  132. 131 kubectl get svc
  133. 132 curl 192.168.29.81:30130
  134. 133 history
  135. student@control:~/cka$
  136.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement