Advertisement
sandervanvugt

Untitled

Apr 13th, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. [student@kube1 ckad]$ history
  2. 1 echo welcome to class we are starting at 9:00
  3. 2 sudo -i
  4. 3 sudo git clone https://github.com/sandervanvugt/ckad
  5. 4 cd ckad
  6. 5 ls
  7. 6 sudo ./setup-docker.sh
  8. 7 sudo ./setup-kubetools.sh
  9. 8 sudo systemctl status dockerd
  10. 9 sudo systemctl status docker
  11. 10 sudo kubeadm init --pod-network-cidr=10.10.0.0/16
  12. 11 mkdir .kube
  13. 12 pwd
  14. 13 ls -a
  15. 14 cd ..
  16. 15 mkdir .kube
  17. 16 sudo cp -i /etc/kubernetes/admin.conf .kube/config
  18. 17 sudo chown student:student .kube/config
  19. 18 ls -l .kube/config
  20. 19 kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
  21. 20 wget https://docs.projectcalico.org/manifests/custom-resources.yaml
  22. 21 vim custom-resources.yaml
  23. 22 kubectl create -f custom-resources.yaml
  24. 23 kubectl get pods -n calico-system
  25. 24 kubectl taint nodes --all node-role.kubernetes.io/master-
  26. 25 kubectl get pods -n calico-system
  27. 26 kubectl get all
  28. 27 history
  29. 28 ip a
  30. 29 kubectl create deployment nginx
  31. 30 kubectl create deployment mynginx --image=nginx --replicas=3
  32. 31 kubectl get all
  33. 32 kubectl explain pods
  34. 33 kubectl explain pods.sopec
  35. 34 kubectl explain pods.spec
  36. 35 sudo poweroff
  37. 36 history
  38. 37 kubectl get all
  39. 38 kubectl delete pod mynginx-5b686ccd46-zbhlt
  40. 39 kubectl get all
  41. 40 history
  42. 41 kubectl get all
  43. 42 kubectl run -h | less
  44. 43 kubectl run nginx --image=nginx
  45. 44 kubectl get all
  46. 45 kubectl delete pod nginx
  47. 46 kubectl get all
  48. 47 kubectl create deployment mynginx --image=nginx --replicas=3
  49. 48 history | grep taint
  50. 49 kubectl get pods
  51. 50 kubectl get pods -A
  52. 51 kubectl config view
  53. 52 kubectl -h
  54. 53 kubectl completion -h
  55. 54 source <(kubectl completion bash)
  56. 55 kubectl get pods mynginx-5b686ccd46-jwr2h
  57. 56 kubectl completion -h
  58. 57 kubectl api-resources | less
  59. 58 kubectl explain pods
  60. 59 kubectl explain pods.spec
  61. 60 kubectl explain deployment.spec
  62. 61 kubectl run -h | less
  63. 62 kubectl run mymariadb --image=mariadb
  64. 63 kubectl get pods
  65. 64 kubectl describe pod mymariadb
  66. 65 kubectl describe pod mymariadb | less
  67. 66 kubectl run mybusybox --image=busybox
  68. 67 kubectl get pods
  69. 68 kubectl get pods -w
  70. 69 kubectl describe pod mybusybox
  71. 70 bash
  72. 71 ls
  73. 72 kubectl logs mymariadb
  74. 73 kubectl delete pod mymariadb
  75. 74 kubectl run pod -h
  76. 75 kubectl run mymariadb --image=mariadb --env="MYSQL_ROOT_PASSWORD=password"
  77. 76 kubectl get pods
  78. 77 history
  79. 78 kubectl logs -h
  80. 79 kubectl logs mymariadb
  81. 80 history
  82. 81 cd ckad
  83. 82 ls
  84. 83 vim busybox.yaml
  85. 84 cd ..
  86. 85 ls -l
  87. 86 sudo chown -R student:student ckad
  88. 87 kubectl run myfile --image=nginx --dry-run -o yaml > myfile.yaml
  89. 88 vim myfile.yaml
  90. 89 kubectl explain pod
  91. 90 kubectl explain pod.spec
  92. 91 kubectl explain pod.spec.containers
  93. 92 kubectl get pods
  94. 93 kubectl exec -it mynginx-5b686ccd46-2w947 sh
  95. 94 kubectl create mydeploy --image=mariadb --replicas=3 --dry-run=client -o yaml > mydeploy.yaml
  96. 95 kubectl create -h | less
  97. 96 kubectl create deploy mydeploy --image=mariadb --replicas=3 --dry-run=client -o yaml > mydeploy.yaml
  98. 97 vim mydeploy.yaml
  99. 98 kubectl explain deploy.spec
  100. 99 kubectl create -f mydeploy.yaml
  101. 100 kubectl get all
  102. 101 kubectl get all --selector app=mydeploy
  103. 102 kubectl set -h | less
  104. 103 kubectl set env -h | less
  105. 104 kubectl set env deploy/mydeploy MYSQL_ROOT_PASSWORD=password
  106. 105 kubectl get all --selector app=mydeploy
  107. 106 history
  108. 107 kubectl set env -h | less
  109. 108 kubectl run anotherone --image=mariadb
  110. 109 kubectl get pods
  111. 110 kubectl set env pod/anotherone MYSQL_ROOT_PASSWORD=password
  112. 111 kubectl rollout -h
  113. 112 kubectl create deploy nginxsvc --image=nginx
  114. 113 kubectl scale deploy nginxsvc --replicas=3
  115. 114 kubectl expose deploy nginxsvc --port=80
  116. 115 kubectl get all --selector app=nginxsvc
  117. 116 kubectl describe svc nginxsvc
  118. 117 kubectl get endpoints
  119. 118 curl http://10.108.80.155
  120. 119 kubectl edit svc nginxsvc
  121. 120 kubectl get svc
  122. 121 ip a
  123. 122 curl http://192.168.29.63:32000
  124. 123 cd ckad
  125. 124 ls
  126. 125 vim morevolumes.yaml
  127. 126 kubectl create -f morevolumes.yaml
  128. 127 kubectl describe pod morevol2
  129. 128 kubectl get pods
  130. 129 kubectl exec -it morevol2 -c centos1 -- touch /centos1/hellofile
  131. 130 kubectl exec -it morevol2 -c centos2 -- ls /centos2/
  132. 131 kubectl explain pods.spec.volumes
  133. 132 ls
  134. 133 vim pv-pvc-pod.yaml
  135. 134 kubectl create -f pv-pvc-pod.yaml
  136. 135 kubectl create ns myvol
  137. 136 kubectl create -f pv-pvc-pod.yaml
  138. 137 kubectl get pvc -n myvol
  139. 138 vim pv-pvc-pod.yaml
  140. 139 kubectl exec -it local-pv-pod -- touch /usr/share/nginx/html/myfile
  141. 140 kubectl exec -it local-pv-pod -n myvol -- touch /usr/share/nginx/html/myfile
  142. 141 vim pv-pvc-pod.yaml
  143. 142 ls /mnt
  144. 143 ls /mnt/data
  145. 144 history
  146.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement