Advertisement
sandervanvugt

CKAD march24 day1

Mar 4th, 2024
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. student@student-virtual-machine:~/ckad$ history
  2. 1 minikube start --memory=4G
  3. 2 kubectl get all
  4. 3 minikube status
  5. 4 minikube ssh
  6. 5 kubectl get all
  7. 6 kubectl create deployment firstnginx --image=nginx --replicas=3
  8. 7 kubectl get all
  9. 8 history
  10. 9 kubectl -h | less
  11. 10 kubectl completion -h | less
  12. 11 source <(kubectl completion bash)
  13. 12 history
  14. 13 cd ../.kube/
  15. 14 ls
  16. 15 less config
  17. 16 cd
  18. 17 kubectl config view
  19. 18 kubectl get pods
  20. 19 kubectl get pods -n kube-system
  21. 20 kubectl config set-context --current --namespace=kube-system
  22. 21 kubectl get pods
  23. 22 kubectl config set-context --current --namespace=default
  24. 23 kubectl config -h | less
  25. 24 kubectl config set-context -h | less
  26. 25 history
  27. 26 cd ckad/
  28. 27 ls
  29. 28 cd dockerfile/
  30. 29 ls
  31. 30 vim Dockerfile
  32. 31 docker build -t mymap .
  33. 32 docker images
  34. 33 docker build -h
  35. 34 docker save -h | less
  36. 35 docker images
  37. 36 docker save mymap
  38. 37 docker save mymap -o mymap.tar
  39. 38 cd
  40. 39 cd ckad/
  41. 40 history
  42. 41 kubectl get all
  43. 42 kubectl delete pod firstnginx-d8679d567-7zgv8
  44. 43 kubectl get all
  45. 44 kubectl run -h | less
  46. 45 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701
  47. 46 kubectl get pods
  48. 47 kubectl describe pod hazelcast
  49. 48 history get pods
  50. 49 kubectl get pods
  51. 50 kubectl delete pod hazelcast
  52. 51 kubectl get all
  53. 52 kubectl get pods firstnginx-d8679d567-4gnkf -o yaml | less
  54. 53 kubectl describe pods firstnginx-d8679d567-4gnkf
  55. 54 kubectl run mypod --image=busybox
  56. 55 kubectl get pods
  57. 56 kubectl describe pod mypod | less
  58. 57 kubectl get pods mypod -o yaml | less
  59. 58 kubectl run --help | less
  60. 59 kubectl run yamginx --image=nginx --dry-run=client -o yaml
  61. 60 kubectl run yamginx --image=nginx --dry-run=client -o yaml > yamginx.yaml
  62. 61 vim yamginx.yaml
  63. 62 history
  64. 63 kubectl create deploy test --image=nginx --dry-run=client -o yaml
  65. 64 history
  66. 65 #kubectl create deploy mydb --image=mariadb
  67. 66 kubectl create deploy mydb --image=mariadb --dry-run=client -o yaml | less
  68. 67 vim yamginx.yaml
  69. 68 kubectl create -f yamginx.yaml
  70. 69 kubectl delete -f yamginx.yaml
  71. 70 kubectl apply -f yamginx.yaml
  72. 71 vim yamginx.yaml
  73. 72 kubectl apply -f yamginx.yaml
  74. 73 kubectl delete -f yamginx.yaml
  75. 74 kubectl apply -f yamginx.yaml
  76. 75 kubectl get pods
  77. 76 vim yamginx.yaml
  78. 77 kubectl describe pod yamginx
  79. 78 kubectl logs yamginx
  80. 79 history
  81. 80 vim sidecar.yaml
  82. 81 kubectl apply -f sidecar.yaml
  83. 82 kubectl exec -it sidecar-pod -- /bin/bash
  84. 83 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  85. 84 vim sidecar.yaml
  86. 85 vim init-example1.yaml
  87. 86 kubectl apply -f init-example1.yaml
  88. 87 kubectl get pods
  89. 88 kubectl describe pod init-demo1
  90. 89 vim init-example2.yaml
  91. 90 kubectl apply -f init-example2.yaml
  92. 91 kubectl get pods
  93. 92 kubectl describe pod init-demo2
  94. 93 kubectl get ns
  95. 94 kubectl get pods -n default
  96. 95 kubectl get pods -n kube-system
  97. 96 kubectl describe ns default
  98. 97 history
  99. 98 kubectl get all -A
  100. 99 kubectl create ns secret
  101. 100 kubectl get ns
  102. 101 kubectl describe ns secret
  103. 102 vim busybox-ns.yaml
  104. 103 kubectl run pod busybox -- sleep 3600
  105. 104 kubectl run pod sleepyone --image=busybox -- sleep 3600
  106. 105 kubectl get pods
  107. 106 kubectl run secretginx --image=nginx -n secret
  108. 107 kubectl get pods
  109. 108 kubectl get pods -A
  110. 109 kubectl config set-context --current --namespace=secret
  111. 110 kubectl get pods
  112. 111 kubectl config set-context --current --namespace=default
  113. 112 history
  114. 113 kubectl run nginx-lab --image=nginx
  115. 114 kubectl get pods
  116. 115 kubectl describe pod pod
  117. 116 kubectl explain pods.spec | less
  118. 117 kubectl explain pods.spec.volumes | less
  119. 118 kubectl explain deploy.spec | less
  120. 119 kubectl get pods
  121. 120 kubectl exec -it mypod -- sh
  122. 121 kubectl exec -it yamginx -- sh
  123. 122 history
  124. 123 kubectl describe pod sidecar-pod | less
  125. 124 kubectl run faildb --image=mariadb
  126. 125 kubectl get pods
  127. 126 kubectl describe pod faildb | less
  128. 127 kubectl logs faildb
  129. 128 kubectl delete pod faildb
  130. 129 kubectl run --help | less
  131. 130 kubectl run successdb --image=mariadb --env=MARIADB_ROOT_PASSWORD=password
  132. 131 kubectl get pods
  133. 132 history
  134. 133 kubectl get pods
  135. 134 kubectl logs firstnginx-d8679d567-4gnkf
  136. 135 kubectl explain pod.spec | less
  137. 136 kubectl explain pod.spec.securityContext | less
  138. 137 kubectl explain pod.spec.containers.securityContext | less
  139. 138 vim securitycontextdemo2.yaml
  140. 139 kubectl apply -f securitycontextdemo2.yaml
  141. 140 kubectl get pods
  142. 141 kubectl exec -it security-context-demo -- sh
  143. 142 vim securitycontextdemo.yaml
  144. 143 kubectl apply -f securitycontextdemo.yaml
  145. 144 kubectl get pods
  146. 145 kubectl describe pod nginxsecure
  147. 146 history
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement