sandervanvugt

CKA day1 oct21

Oct 19th, 2021
98
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:~/ckad$ history
  2. 1 sudo vim /etc/hosts
  3. 2 cat /etc/hosts
  4. 3 sudo apt install vim git bash-completion -y
  5. 4 git clone https://github.com/sandervanvugt/cka
  6. 5 cd cka
  7. 6 ls
  8. 7 vim setup-container.sh
  9. 8 ./setup-container.sh
  10. 9 ls
  11. 10 vim setup-kubetools.sh
  12. 11 vim setup-kubetools-ubuntu.sh
  13. 12 ./setup-kubetools-ubuntu.sh
  14. 13 history
  15. 14 cat /etc/hosts
  16. 15 sudo kubeadm init --help
  17. 16 sudo kubeadm init --pod-network-cidr=10.10.0.0/16
  18. 17 mkdir -p $HOME/.kube
  19. 18 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  20. 19 sudo chown $(id -u):$(id -g) $HOME/.kube/config
  21. 20 kubectl get all
  22. 21 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  23. 22 kubectl get nodes
  24. 23 kubectl create testginx --image=nginx --replicas=3
  25. 24 kubectl create deploy testginx --image=nginx --replicas=3
  26. 25 kubectl get all
  27. 26 ls
  28. 27 history
  29. 28 ls
  30. 29 ./counter.sh 15
  31. 30 kubectl completion -h
  32. 31 source <(kubectl completion bash)
  33. 32 kubectl create namespace mynamespace
  34. 33 kubectl get ns
  35. 34 kubectl run mypod --image=alpine -n mynamespace -- sleep 3600
  36. 35 kubectl get pods mypod -n mynamespace -o yaml | less
  37. 36 history
  38. 37 ./counter.sh 15
  39. 38 vim wg.yaml
  40. 39 kubectl apply -f wg.yaml
  41. 40 kubectl get all
  42. 41 kubectl describe pod myapp-pod
  43. 42 history
  44. 43 ./counter.sh
  45. 44 vim nrv.yaml
  46. 45 kubectl apply -f nrv.yaml
  47. 46 kubectl get pods
  48. 47 kubectl describe pod ex3
  49. 48 kubectl delete pod ex3
  50. 49 ls -lrt
  51. 50 vim nrv.yaml
  52. 51 kubectl run busybox --image=busybox --dry-run=client -o yaml -- sleep 3600
  53. 52 vim aj.yaml
  54. 53 kubectl create -f aj.yaml
  55. 54 kubectl delete -f aj.yaml
  56. 55 kubectl create -f aj.yaml
  57. 56 kubectl get pods
  58. 57 kubectl describe myapp-pod
  59. 58 kubectl describe pod myapp-pod
  60. 59 kubectl logs myapp-pod
  61. 60 kubectl describe pod myapp-pod
  62. 61 ./counter.sh 5
  63. 62 vim wg2.yaml
  64. 63 kubectl create -f wg2.yaml
  65. 64 kubectl get all
  66. 65 kubectl get pod -o wide
  67. 66 vim svv.yaml
  68. 67 kubectl create -f svv.yaml
  69. 68 kubectl create deploy nginx --image=nginx --dry-run -o yaml | \ sed '/null\|{}\|replicas/d;/status/,$d;s/Deployment/DaemonSet/g' > nginx-ds.yaml kubectl apply -f nginx-ds.yaml
  70. 69 sudo apt install sed
  71. 70 kubectl create deploy nginx --image=nginx --dry-run -o yaml | \ sed '/null\|{}\|replicas/d;/status/,$d;s/Deployment/DaemonSet/g' > nginx-ds.yaml kubectl apply -f nginx-ds.yaml
  72. 71 kubectl create deploy nginx --image=nginx --dry-run -o yaml > nginx-ds.yaml
  73. 72 vim nginx-ds.yaml
  74. 73 kubectl create -f nginx-ds.yaml
  75. 74 vim nginx-ds.yaml
  76. 75 kubectl create -f nginx-ds.yaml
  77. 76 ./counter.sh 25
  78. 77 kubectl create deploy nginx --image=nginx --dry-run -o yaml | sed '/null\|{}\|replicas/d;/status/,$d;s/Deployment/DaemonSet/g' > nginx-ds.yaml
  79. 78 vim nginx-ds.yaml
  80. 79 ls -lrt
  81. 80 vim ex18.yaml
  82. 81 cd /etc/kubernetes/
  83. 82 ls
  84. 83 cd manifests/
  85. 84 ls
  86. 85 vim kube-scheduler.yaml
  87. 86 sudo vim kube-scheduler.yaml
  88. 87 ssh worker1
  89. 88 cd
  90. 89 kubectl run auto-web --image=nginx --dry-run=client -o yaml > auto-web.yaml
  91. 90 cat auto-web.yaml
  92. 91 kubectl get pods -o wide
  93. 92 kubectl create ns limited
  94. 93 kubectl create quota --help
  95. 94 kubectl create quota qtest --hard pods=3,cpu=100,memory=500Mi -n limited
  96. 95 kubectl describe ns limited
  97. 96 kubectl create deploy nginx --image=nginx --replicas=3 -n limited
  98. 97 kubectl get all -n limited
  99. 98 kubectl describe -n limited rs nginx-6799fc88d8
  100. 99 kubectl get all -n limited
  101. 100 kubectl set resources -h | less
  102. 101 kubectl set resources deploy nginx --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi -n limited
  103. 102 kubectl get all -n limited
  104. 103 kubectl scale deploy nginx --replicas=5 -n limited
  105. 104 kubectl get all -n limited
  106. 105 kubectl describe ns limited
  107. 106 kubectl describe -n limited rs nginx-86d467bc98
  108. 107 kubectl delete deploy nginx -n limited
  109. 108 kubectl set resources deploy nginx --limits cpu=200m,memory=1Mi -n limited
  110. 109 kubectl create deploy nginx
  111. 110 kubectl create deploy nginx --image=nginx -n limited
  112. 111 kubectl set resources deploy nginx --limits cpu=200m,memory=1Mi -n limited
  113. 112 kubectl get deploy nginx -n limited -o yaml > oom.yaml
  114. 113 kubectl delete deploy nginx
  115. 114 kubectl delete deploy nginx -n limited
  116. 115 vim oom.yaml
  117. 116 kubectl create -f oom.yaml
  118. 117 kubectl get all -n limited
  119. 118 kubectl describe -n limited pod nginx-566bfb9779-ll295
  120. 119 history
  121. 120 sleep 120; cka/counter.sh 13
  122. 121 kubectl get nodes
  123. 122 kubectl get pods -o wide
  124. 123 kubectl get nodes
  125. 124 kubectl describe node worker1
  126. 125 kubectl get pods
  127. 126 kubectl get nodes
  128. 127 cka/counter.sh 5
  129. 128 cd cka
  130. 129 ls
  131. 130 cd ..
  132. 131 git clone https://github.com/sandervanvugt/ckad
  133. 132 cd ckad
  134. 133 ls
  135. 134 vim pv.yaml
  136. 135 kubectl create -f pv.yaml
  137. 136 kubectl api-resources | less
  138. 137 vim pvc.yaml
  139. 138 kubectl create -f pvc.yaml
  140. 139 kubectl get pv
  141. 140 kubectl get storageclass
  142. 141 kubectl pv-pod.yaml
  143. 142 vim pv-pod.yaml
  144. 143 kubectl create -f pv-pod.yaml
  145. 144 kubectl exec -it pv-pod -- touch /usr/share/nginx/html/hello.txt
  146. 145 kubectl describe pv pv-volume
  147. 146 ls /
  148. 147 kubectl get pods -o wide
  149. 148 kubectl explain pv.spec | less
  150. 149 kubectl explain pv.spec.iscsi
  151. 150 kubectl explain pv.spec.initiatorName
  152. 151 kubectl explain pv.spec.iscsi
  153. 152 vim pvc.yaml
  154. 153 cat /etc/os-release
  155. 154 history
  156.  
Add Comment
Please, Sign In to add comment