Advertisement
sandervanvugt

CKAD day1 oct22

Oct 11th, 2022
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. student@student-virtual-machine:~/ckad$ history
  2. 1 sudo apt install vim git
  3. 2 cd ckad
  4. 3 ./countdown 15
  5. 4 ./countdown 13
  6. 5 ./countdown 1
  7. 6 git clone https://github.com/sandervanvugt/ckad
  8. 7 sudo apt install git vim -y
  9. 8 git clone https://github.com/sandervanvugt/ckad
  10. 9 cd ckad
  11. 10 ls
  12. 11 ./minikube-docker-setup.sh
  13. 12 minikube start --vm-driver=docker --cni=calico
  14. 13 kubectl get all
  15. 14 minikube ssh
  16. 15 kubectl get all
  17. 16 minikube status
  18. 17 minikube dashboard
  19. 18 kubectl get all
  20. 19 kubectl create deployment firstginx --image=nginx --replicas=3
  21. 20 kubectl get all
  22. 21 history
  23. 22 source <(kubectl completion bash)
  24. 23 sudo apt install bash-completion
  25. 24 kubectl -h
  26. 25 kubectl create -h | less
  27. 26 kubectl create deploy -h | less
  28. 27 history
  29. 28 cd
  30. 29 cd .kube/
  31. 30 cat config
  32. 31 kubectl config view
  33. 32 kubectl config set-context --current --namespace=mynamespace
  34. 33 kubectl config set-context --current --namespace=default
  35. 34 cd
  36. 35 cd ckad
  37. 36 ls
  38. 37 cd dockerfile/
  39. 38 ls
  40. 39 vim Dockerfile
  41. 40 docker build -t nmap .
  42. 41 docker images
  43. 42 docker save --help | less
  44. 43 docker save -o nmap.tar nmap
  45. 44 ls -l
  46. 45 cd ..
  47. 46 history
  48. 47 ./countdown 1
  49. 48 kubectl get pods
  50. 49 kubectl get pods firstginx-7c4fcf6b55-bk2c5 -o yaml| less
  51. 50 kubectl get all
  52. 51 kubectl delete deploy dashginx
  53. 52 kubectl get all
  54. 53 kubectl delete pod firstginx-7c4fcf6b55-bk2c5
  55. 54 kubectl get all
  56. 55 kubectl run -h | less
  57. 56 kubectl run nginx --image=nginx
  58. 57 kubectl get all
  59. 58 kubectl delete pod nginx
  60. 59 kubectl get all
  61. 60 kubectl describe pod firstginx-7c4fcf6b55-t4grh
  62. 61 history
  63. 62 kubectl get pods firstginx-7c4fcf6b55-bk2c5 -o yaml| less
  64. 63 kubectl get pods firstginx-7c4fcf6b55-t4grh -o yaml | less
  65. 64 kubectl explain pods
  66. 65 kubectl explain pods.spec | less
  67. 66 kubectl explain pods.spec.affinity | less
  68. 67 kubectl explain --recursive pods.spec
  69. 68 kubectl explain --recursive pods.spec | wc
  70. 69 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  71. 70 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  72. 71 vim sidecar.yaml
  73. 72 kubectl apply -f sidecar.yaml
  74. 73 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  75. 74 kubectl get pods
  76. 75 vim sidecar.yaml
  77. 76 docker search httpd | grep centos
  78. 77 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  79. 78 kubectl delete pod sidecar-pod
  80. 79 vim sidecard2.yaml
  81. 80 kubectl create -f sidecard2.yaml
  82. 81 vim sidecard2.yaml
  83. 82 kubectl create -f sidecard2.yaml
  84. 83 vim sidecard2.yaml
  85. 84 kubectl create -f sidecard2.yaml
  86. 85 kubectl get pods
  87. 86 kubectl describe pods two-containers
  88. 87 kubectl exec -it two-containers -c nginx-container -- sh
  89. 88 history
  90. 89 vim init-example1.yaml
  91. 90 kubectl apply -f init-example1.yaml
  92. 91 kubectl get pods
  93. 92 kubectl describe pods init-demo1
  94. 93 kubectl get pods
  95. 94 vim init-example2.yaml
  96. 95 kubectl create -f init-example2.yaml
  97. 96 kubectl get pods
  98. 97 sudo reboot
  99. 98 sudo -i
  100. 99 history | less
  101. 100 minikube start --vm-driver=docker --cni=calico
  102. 101 cd ckad
  103. 102 vim init-example1.yaml
  104. 103 kubectl get pods
  105. 104 kubectl delete pod init-demo1
  106. 105 vim init-example1.yaml
  107. 106 kubectl create -f init-example1.yaml
  108. 107 kubectl get pods
  109. 108 wget -O http://info.cern.ch
  110. 109 wget -O /tmp/index.html http://info.cern.ch
  111. 110 cat /tmp/index.html
  112. 111 source <(kubectl completion bash)
  113. 112 kubectl describe pod init-demo1
  114. 113 kubectl logs init-demo1
  115. 114 kubectl logs init-demo1 -c install
  116. 115 wget -O /tmp/index.html http://info.cern.ch
  117. 116 kubectl exec -it init-demo1 -c install -- bash
  118. 117 kubectl exec -it init-demo1 -c install -- sh
  119. 118 kubectl run mydb --image=mariadb
  120. 119 kubectl get pods
  121. 120 kubectl describe pod mydb
  122. 121 kubectl logs mydb
  123. 122 kubectl delete pod mydb
  124. 123 kubectl run -h | less
  125. 124 kubectl run mydb --image=mariadb --env MARIADB_ROOT_PASSWORD=password
  126. 125 kubectl get pods
  127. 126 kubectl run busy --image=busybox
  128. 127 kubectl get pods
  129. 128 kubectl describe pod busy
  130. 129 kubectl get pods busy -o yaml
  131. 130 kubectl get pods
  132. 131 kubectl get ns
  133. 132 kubectl get pods -n default
  134. 133 kubectl get pods -n kube-system
  135. 134 kubectl get all -n kubernetes-dashboard
  136. 135 kubectl describe ns kube-system
  137. 136 kubectl get all -A
  138. 137 kubectl get pods -A
  139. 138 kubectl create ns secret
  140. 139 kubectl run secretpod --image=nginx -n secret
  141. 140 kubectl get pods
  142. 141 kubectl get pods -n secret
  143. 142 kubectl config set-context --current --namespace=secret
  144. 143 kubectl get all
  145. 144 kubectl config set-context --current --namespace=default
  146. 145 history
  147.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement