sandervanvugt

Untitled

May 27th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. 1 top
  2. 2 git clone https://github.com/sandervanvugt/cka
  3. 3 ssh student@worker1
  4. 4 vim .vimrc
  5. 5 vim test
  6. 6 rm test
  7. 7 cd cka/
  8. 8 ssh student@worker3
  9. 9 kubectl get pods
  10. 10 vim yl5.yaml
  11. 11 kubectl create deployment -h
  12. 12 kubectl create deployment nginx-ex5 --image=nginx
  13. 13 kubectl scale deployment nginx-ex5 --replicas=5
  14. 14 kubectl get deployment
  15. 15 vim yl5.yaml
  16. 16 kubectl completion -h
  17. 17 source <(kubectl completion bash)
  18. 18 vim ~/.bash_profile
  19. 19 kubectl get pods myapp -o yaml
  20. 20 sudo rpm -qa | grep bash-completion
  21. 21 vim mn6.yaml
  22. 22 kubectl run sleepy --image=busybox --dry-run=true -o yaml --command -- sleep 10000 > aa6.yaml
  23. 23 vim aa6.yaml
  24. 24 kubectl delete pod myapp
  25. 25 kubectl get pods
  26. 26 alias k=kubectl
  27. 27 alias k=kubectl complete -F __start_kubectl k
  28. 28 alias k=kubectl complete -F __start_kubectl
  29. 29 alias
  30. 30 complete -F __start_kubectl k
  31. 31 man complete
  32. 32 vim yl7.yaml
  33. 33 vim sp7.yaml
  34. 34 kubectl explain pod.spec.volumes
  35. 35*
  36. 36 vim sp7.yaml
  37. 37 kubectl create -f sp7.yaml
  38. 38 kubectl describe pod nginxsp
  39. 39 kubectl get pods -h
  40. 40 kubectl get pods --show-labels
  41. 41 kubectl get pods --all-namespaces --selector app=nginx-ex5 --sort-by=.metadata.name
  42. 42 kubectl get pods --all-namespaces --selector app=nginx-ex5 --sort-by='{.spec.nodeName}'
  43. 43 kubectl get pods --all-namespaces --selector app=nginx-ex5 --sort-by='{.spec.nodeName}' -o wide
  44. 44 kubectl get pod -o json and grep -i node
  45. 45 kubectl get pod -o json | grep -i node
  46. 46 kubectl get pod nginxsp -o json | less
  47. 47 history
  48. 48 sleep 20; ./counter.sh 12
  49. 49 kubectl top pod
  50. 50 git clone https://github.com/kubernetes-incubator/metrics-server.git
  51. 51 ls
  52. 52 cd metrics-server/
  53. 53 ls
  54. 54 cd manifests/
  55. 55 ls
  56. 56 cd ..
  57. 57 kubectl create -f metrics-server/manifests/base/
  58. 58 kubectl get all -n kube-system
  59. 59 kubectl -n kube-system edit deployments.apps metrics-server
  60. 60 kubectl -n kube-system logs metrics-server-655489f966-z25tr
  61. 61 kubectl get all -n kube-system
  62. 62 kubectl top pods --all-namespaces
  63. 63 history
  64. 64 cd metrics-server/manifests/
  65. 65 ls
  66. 66 cd base
  67. 67 ls
  68. 68 history
  69. 69 pwd
  70. 70 cd ../../..
  71. 71 ./counter.sh 13
  72. 72 vim ex9.yaml
  73. 73 kubectl create -f ex9.yaml
  74. 74 kubectl create ns myvol
  75. 75 kubectl create -f ex9.yaml
  76. 76 kubectl apply -f ex9.yaml
  77. 77 kubectl get all -n myvol
  78. 78 kubectl get pvc -n myvol
  79. 79 kubectl describe pod pv-pod
  80. 80 kubectl describe pod pv-pod -n myvol
  81. 81 cd ..
  82. 82 ls
  83. 83 cd cka
  84. 84 ls
  85. 85 cd ..
  86. 86 git clone https://github.com/sandervanvugt/ckad
  87. 87 cd ckad
  88. 88 ls
  89. 89 vim pv.yaml
  90. 90 kubectl get pvc -n myvol
  91. 91 history
  92. 92 # kubectl create deploy nginx — image=nginx:1.14
  93. 93 kubectl set image deployment.v1.apps/nginx nginx=nginx:latest --record=true
  94. 94 #kubectl rollout undo deployment.v1.apps/nginx
  95. 95 kubectl create deploy nginx --image=nginx:1.14 --record
  96. 96 kubectl create deploy nginx --image=nginx:1.14
  97. 97 kubectl get deployments.apps
  98. 98 kubectl scale deployment nginx --replicas=3
  99. 99 kubectl get deployments.apps
  100. 100 kubectl get deployments.apps --show-labels
  101. 101 kubectl get all --selector app=nginx
  102. 102 kubectl set image deployment.v1.apps/nginx nginx=nginx:latest --record=true
  103. 103 kubectl rollout history deployment nginx
  104. 104 kubectl get all --selector app=nginx
  105. 105 kubectl rollout undo deployment nginx; kubectl get all --selector app=nginx
  106. 106 kubectl get all --selector app=nginx
  107. 107 kubectl explain deployment.spec
  108. 108 kubectl explain deployment.spec.strategy
  109. 109 kubectl explain deployment.spec.strategy.rollingUpdate
  110. 110 cd ../cka
  111. 111 kubectl get pods
  112. 112 kubectl expose pod nginxsp --name nginx-service
  113. 113 kubectl describe pod auto-web-worker3.example.com
  114. 114 kubectl expose pod auto-web-worker3.example.com --name nginx-service
  115. 115 kubectl get svc
  116. 116 kubectl describe svc nginx-service
  117. 117 ./counter.sh 12
  118. 118 ./counter.sh 3
  119. 119 ls
  120. 120 vim pod-and-service-dns.yaml
  121. 121 kubectl create -f pod-and-service-dns.yaml
  122. 122 kubectl get svc
  123. 123 kubectl exec -it busybox2 --nslookup default-subdomain
  124. 124 kubectl exec -it busybox2 -- nslookup default-subdomain
  125. 125 kubectl exec -it busybox2 -- nslookup busybox1
  126. 126 kubectl get pods -o wide
  127. 127 kubectl get pods -o wide | grep busy
  128. 128 kubectl exec -it busybox2 -- nslookup 10.42.0.6.default.pod
  129. 129 kubectl exec -it busybox2 -- nslookup 10.42.0.6.default-pod
  130. 130 kubectl exec -it busybox2 -- nslookup 10.42.0.6-default.pod
  131. 131 kubectl exec -it busybox2 -- nslookup 10-42-0-6.default.pod
  132. 132 history
  133. 133 kubectl get nodes
  134. 134 kubectl get nodes -o wide
  135. 135 kubectl cordon -h
  136. 136 kubectl cordon worker1.example.com
  137. 137 kubectl get nodes
  138. 138 kubectl drain -h
  139. 139 kubectl get nodes
  140. 140 ssh worker2
  141. 141 kubectl get nodes
  142. 142 cd
  143. 143 cd .kube/
  144. 144 ls
  145. 145 vim config
  146. 146 kubectl get all
  147. 147 cd
  148. 148 history
Add Comment
Please, Sign In to add comment