sandervanvugt

CKAD jan22 day1

Jan 13th, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. student@control:~/cka$ history
  2. 1 git clone https://github.com/sandervanvugt/cka
  3. 2 cd cka
  4. 3 ls *sh
  5. 4 vim setup-container.sh
  6. 5 ./setup-container.sh
  7. 6 ./setup-kubetools.sh
  8. 7 sudo ./setup-kubetools.sh
  9. 8 sudo vim /etc/fstab
  10. 9 sudo swapoff -a
  11. 10 free -m
  12. 11 sudo vim /etc/hosts
  13. 12 sudo -i
  14. 13 vim /tmp/todo.txt
  15. 14 top
  16. 15 cat /tmp/todo.txt
  17. 16 cd
  18. 17 mkdir -p .kube
  19. 18 sudo cp -i /etc/kubernetes/admin.conf .kube/config
  20. 19 sudo chown student:student .kube/config
  21. 20 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  22. 21 kubectl get all
  23. 22 kubectl get all -A
  24. 23 cat /tmp/todo.txt
  25. 24 kubectl get nodes
  26. 25 history
  27. 26 kubectl get nodes
  28. 27 history
  29. 28 cat /tmp/todo.txt
  30. 29 sudo kubeadm -h | less
  31. 30 history
  32. 31 cd cka
  33. 32 ls
  34. 33 history
  35. 34 kubectl get nodes
  36. 35 ./counter.sh 3
  37. 36 kubectl create ns mynamespace
  38. 37 kubectl run myalp --image=alpine -- sleep 3600 > myalp.yaml
  39. 38 vim myalp.yaml
  40. 39 kubectl run myalp --image=alpine -- sleep 3600 --dry-run=client -o yaml > myalp.yaml
  41. 40 kubectl delete pod myalp
  42. 41 kubectl run myalp --image=alpine --dry-run=client -o yaml -- sleep 3600
  43. 42 ./counter.sh 6
  44. 43 vim wk3.yaml
  45. 44 kubectl create -f wk3.yaml
  46. 45 kubectl get pods
  47. 46 kubectl describe pod exercise3
  48. 47 ./counter.sh 17
  49. 48 vim oinit.yaml
  50. 49 kubectl create -f oinit.yaml
  51. 50 kubectl get pods
  52. 51 kubectl describe pod init-demo
  53. 52 kubectl get pods -o wide
  54. 53 ./counter.sh 5
  55. 54 kubectl get nodes
  56. 55 kubectl edit node control
  57. 56 kubectl create deploy nginx --image=nginx --replicas=3
  58. 57 kubectl get pods -o wide
  59. 58 kubectl edit node control
  60. 59 kubectl get pods -o wide
  61. 60 kubectl completion -h
  62. 61 source <(kubectl completion bash)
  63. 62 kubectl scale deployment nginx --replicas=6
  64. 63 kubectl get pods -o wide
  65. 64 ./counter.sh 7
  66. 65 kubectl run nginx --dry-run=client -o yaml > static.yaml
  67. 66 kubectl run nginx --dry-run=client --image=nginx -o yaml > static.yaml
  68. 67 cat static.yaml
  69. 68 kubectl get pods
  70. 69 ./counter.sh 23
  71. 70 vim wg8.yaml
  72. 71 kubectl create -f wg8.yaml
  73. 72 kubectl describe pod pv-pod
  74. 73 kubectl describe pod pv-pod -n myvol
  75. 74 kubectl exec -it pv-pod -n myvol -- sh
  76. 75 kubectl get pvc
  77. 76 kubectl get pvc -n myvol
  78. 77 kubectl get pv
  79. 78 kubectl describe pv task-pv-volume
  80. 79 kubectl explain pv.spec | less
  81. 80 kubectl api-resources | less
  82. 81 kubectl create quota --help | less
  83. 82 kubectl set resources -h | less
  84. 83 history
  85. 84 ./counter.sh 8
  86. 85 #kubectl create quota qtest --hard pods=3,cpu=100,memory=500Mi --namespace limited
  87. 86 kubectl create ns limited
  88. 87 kubectl create quota qtest --hard pods=3,cpu=100,memory=500Mi --namespace limited
  89. 88 kubectl create deploy nginx --image=nginx --replicas=3 -n limited
  90. 89 kubectl get all -n limited
  91. 90 kubectl describe -n limited replicasets.apps nginx-85b98978db
  92. 91 kubectl describe ns limited
  93. 92 kubectl set resources deploy nginx --requests cpu=100m,memory=5Mi --limites cpu=200m,memory=20Mi -n limited
  94. 93 kubectl set resources deploy nginx --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi -n limited
  95. 94 kubectl get pods -n limited
  96. 95 kubectl create deploy lmitbox --image=busybox --replicas=3 -- sleep 3000
  97. 96 kubectl get pods -n limited
  98. 97 kubectl get all -n limited
  99. 98 kubectl create deploy lmitbox --image=busybox --replicas=3 -n limited -- sleep 3000
  100. 99 kubectl get all -n limited
  101. 100 kubectl describe -n limited replicasets.apps lmitbox-6fdd4d7884
  102. 101 history
  103. 102 ./counter.sh 12
  104. 103 vim sr8.yaml
  105. 104 kubectl explain limitrange
  106. 105 kubectl explain quota
  107. 106 vim sr8.yaml
  108. 107 ./counter.sh 5
  109. 108 kubectl create app1 --image=nginx --replicas=3
  110. 109 kubectl create deploy app1 --image=nginx --replicas=3
  111. 110 kubectl create deploy app3 --image=nginx --replicas=3
  112. 111 kubectl label deployments.apps app1 app=working
  113. 112 kubectl label deployments.apps app1 type=working
  114. 113 kubectl label deployments.apps app3 type=working
  115. 114 kubectl get pods --selector type=working
  116. 115 kubectl get pods --show-labels
  117. 116 kubectl get pods --selector app=nginx
  118. 117 kubectl get pod -h | less
  119. 118 kubectl get pod exercise3 -o json | less
  120. 119 kubectl get pod -h | less
  121. 120 kubectl get pods --selector app=nginx -o wide
  122. 121 kubectl get pods --selector app=nginx -o wide --sort-by=.spec.nodeName
  123. 122 kubectl get pods --selector app=nginx -o wide --sort-by=.spec.nodeName > /tmp/sortlist.txt
  124. 123 cat /tmp/sortlist.txt
  125. 124 kubectl get pods -l app=nginx -o wide --sort-by=.spec.nodeName
  126. 125 ./counter.sh 5
  127. 126 vim df10.yaml
  128. 127 kubectl create deploy daemonploy --image=nginx --dry-run=client -o yaml > daemonploy.yaml
  129. 128 vim daemonploy.yaml
  130. 129 kubectl api-resources
  131. 130 kubectl create -f daemonploy.yaml
  132. 131 kubectl get ds,pods -o wide
  133. 132 kubectl get ds -A
  134. 133 history
  135.  
Add Comment
Please, Sign In to add comment