Advertisement
sandervanvugt

CKAD day1 dec23

Dec 11th, 2023
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. 1 sudo apt install -y git
  2. 2 git clone https://github.com/sandervanvugt/ckad
  3. 3 cd ckad
  4. 4 ls
  5. 5 minikube start --vm-driver=docker --cni=calico
  6. 6 ls
  7. 7 history
  8. 8 kubectl get all
  9. 9 minikube ssh
  10. 10 kubectl get all
  11. 11 kubectl create deployment firstningx --image=nginx
  12. 12 kubectl get all
  13. 13 ./countdown 13
  14. 14 kubectl -h
  15. 15 kubectl create -h | less
  16. 16 kubectl create deployment -h | less
  17. 17 kubectl completion -h | less
  18. 18 source <(kubectl completion bash)
  19. 19 kubectl get all
  20. 20 history
  21. 21 cd
  22. 22 cd .kube/
  23. 23 ls
  24. 24 less config
  25. 25 kubectl config view
  26. 26 cd
  27. 27 cd ckad/
  28. 28 l
  29. 29 cd dockerfile/
  30. 30 ls
  31. 31 vim Dockerfile
  32. 32 sudo apt install -y vim
  33. 33 nano Dockerfile
  34. 34 docker build -t helloworld .
  35. 35 docker images
  36. 36 docker run helloworld
  37. 37 docker save helloworld halloworld.tar
  38. 38 docker save helloworld
  39. 39 docker save helloworld -o helloworld.tar
  40. 40 ls -l helloworld.tar
  41. 41 kubectl run -h | less
  42. 42 kubectl run mynginx --image=nginx
  43. 43 kubectl get pods
  44. 44 kubectl get pods mynginx -o yaml | less
  45. 45 kubectl describe pod mynginx | less
  46. 46 history
  47. 47 kubectl get pods
  48. 48 kubectl describe pod mybb
  49. 49 echo BONUSLAB: start busybox as a pod and make sure it runs the command "sleep 3600" while starting
  50. 50 kubectl run -h | less
  51. 51 kubectl run sleepybox --image=busybox -- sleep 3600
  52. 52 kubectl get pods
  53. 53 kubectl delete pod mybb
  54. 54 history
  55. 55 kubectl run bbox --image=busybox
  56. 56 kubectl get pods
  57. 57 kubectl run -h | less
  58. 58 kubectl run gobox --image=busybox --restart=never
  59. 59 kubectl run -h | less
  60. 60 kubectl run gobox --image=busybox --restart=Never
  61. 61 kubectl get pods
  62. 62 kubectl get pods gobox -o yaml | less
  63. 63 kubectl get pods bbox -o yaml | less
  64. 64 history
  65. 65 kubectl get pods bbox -o yaml | less
  66. 66 ls
  67. 67 cd ..
  68. 68 ls
  69. 69 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  70. 70 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  71. 71 vim mynginx.yaml
  72. 72 kubectl explain pods
  73. 73 kubectl explain pods.spec | less
  74. 74 vim mynginx.yaml
  75. 75 kubectl create -f mynginx.yaml
  76. 76 kubectl delete pod mynginx
  77. 77 kubectl create -f mynginx.yaml
  78. 78 kubectl delete -f mynginx.yaml
  79. 79 kubectl apply -f mynginx.yaml
  80. 80 vim mynginx.yaml
  81. 81 kubectl apply -f mynginx.yaml
  82. 82 vim mynginx.yaml
  83. 83 kubectl apply -f mynginx.yaml
  84. 84 vim mynginx.yaml
  85. 85 kubectl replace -f mynginx.yaml
  86. 86 history
  87. 87 kubectl run bbbox --image=busybox -- sleep 3600 --dry-run=client -o yaml
  88. 88 kubectl get pods
  89. 89 kubectl describe pods bbbox
  90. 90 kubectl logs bbbox
  91. 91 kubectl delete pods bbbox
  92. 92 kubectl run bbbox --image=busybox --dry-run=client -o yaml -- sleep 2600
  93. 93 history
  94. 94 history | grep git
  95. 95 vim sidecar.yaml
  96. 96 kubectl apply -f sidecar.yaml
  97. 97 kubectl get pods
  98. 98 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  99. 99 vim init-example1.yaml
  100. 100 kubectl apply -f init-example1.yaml
  101. 101 kubectl get pods
  102. 102 kubectl describe pod init-demo1
  103. 103 vim init-example2.yaml
  104. 104 kubectl apply -f init-example2.yaml
  105. 105 kubectl get pods
  106. 106 vim init-example2.yaml
  107. 107 history
  108. 108 kubectl get pods
  109. 109 kubectl get pods -A
  110. 110 kubectl get all
  111. 111 kubectl get all -A
  112. 112 kubectl get ns
  113. 113 kubectl create ns secret
  114. 114 kubectl get ns
  115. 115 kubectl run pod busybox -n secret -- sleep infinity
  116. 116 kubectl run pod --image=busybox secretbox -n secret -- sleep infinity
  117. 117 kubectl get all
  118. 118 kubectl get all -n secret
  119. 119 kubectl get pods
  120. 120 kubectl config set-context --current -n secret
  121. 121 kubectl config set-context --current --namespace=secret
  122. 122 kubectl get pods
  123. 123 kubectl config set-context --current -ns default
  124. 124 kubectl config set-context --current --namespace=default
  125. 125 kubectl get pods
  126. 126 kubectl config set-context -h | less
  127. 127 kubectl describe ns secret
  128. 128 kubectl get pods
  129. 129 kubectl exec -it bbox -- sh
  130. 130 kubectl exec -it sleepybox -- sh
  131. 131 kubectl get pods
  132. 132 kubectl exec -it firstningx-5f489b9c69-lbp9z -- sh
  133. 133 kubectl run faildb --image=mariadb
  134. 134 kubectl get pods
  135. 135 kubectl describe pod faildb
  136. 136 kubectl logs faildb
  137. 137 kubectl run -h | less
  138. 138 kubectl run dodb --image=mariadb --env=MARIADB_ROOT_PASSWORD=password
  139. 139 kubectl get pods
  140. 140 kubectl delete pod faildb
  141. 141 history
  142. 142 vim securitycontextdemo2.yaml
  143. 143 kubectl apply -f securitycontextdemo2.yaml
  144. 144 kubectl exec -it security-context-demo -- sh
  145. 145 cat securitycontextdemo2.yaml
  146. 146 kubectl explain pod.spec.securityContext | less
  147. 147 vim securitycontextdemo.yaml
  148. 148 kubectl apply -f securitycontextdemo.yaml
  149. 149 kubectl get pods
  150. 150 kubectl describe pod nginxsecure
  151. 151 history
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement