sandervanvugt

aka day 1 march21

Mar 18th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. [student@control cka]$ history
  2. 1 mkdir -p $HOME/.kube
  3. 2 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  4. 3 sudo chown $(id -u):$(id -g) $HOME/.kube/config
  5. 4 ls -l .kube/config
  6. 5 kubectl get all
  7. 6 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  8. 7 kubectl get pods -A
  9. 8 exit
  10. 9 mkdir -p $HOME/.kube
  11. 10 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  12. 11 sudo chown $(id -u):$(id -g) $HOME/.kube/config
  13. 12 kubectl get pods -A
  14. 13 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  15. 14 kubectl get pods -A
  16. 16 kubectl get nodes
  17. 18 kubectl get nodes
  18. 19 kubectl get pods -A
  19. 20 kubectl get pods -A -o wide
  20. 21 ps aux | grep apiserver
  21. 22 history
  22. 23 exit
  23. 24 kubectl get all
  24. 25 cd .kube/
  25. 26 ls
  26. 27 vim config
  27. 28 sudo useradd anna
  28. 29 sudo passwd anna
  29. 30 exit
  30. 31 kubectl get daemonset -A
  31. 32 git clone https://github.com/sandervanvugt/cka
  32. 33 cd cka/
  33. 34 ls
  34. 35 ./counter.sh 3
  35. 36 kubectl create ns mynamespace
  36. 37 kubectl run alpine --image=alpine -n mynamespace -- sleep 3600
  37. 38 kubectl get pods -n mynamespace -o yaml
  38. 39 kubectl -h
  39. 40 kubectl completion -h
  40. 41 source <(kubectl completion bash)
  41. 42 ./counter.sh 5
  42. 43 vim mcp.yaml
  43. 44 kubectl create -f mcp.yaml
  44. 45 vim mcp.yaml
  45. 46 kubectl create -f mcp.yaml
  46. 47 kubectl get pods
  47. 48 kubectl run mypod --image=redis --image=nginx --image=busybox --dry-run=client -o yaml
  48. 49 vim abc.yaml
  49. 50 kubectl run -h | less
  50. 51 kubectl run buysbox --image=busybox --command -- sleep 3600 --dry-run=client -o yaml
  51. 52 kubectl delete po buysbox
  52. 53 kubectl run buysbox --image=busybox --dry-run=client -o yaml -- sleep 36000
  53. 54 ./counter.sh 18
  54. 55 vim exercise4.yaml
  55. 56 kubectl create -f exercise4.yaml
  56. 57 kubectl get pods
  57. 58 kubectl describe pod init-demo
  58. 59 vim bonus-exo.txt
  59. 60 vim npabc.yaml
  60. 61 #kubectl taint nodes worker-2 key1=value1:NoSchedule
  61. 62 kubectl explain pod.spec.toleration
  62. 63 kubectl explain pod.spec
  63. 64 kubectl explain pod.spec.tolerations
  64. 65 kubectl explain pod.spec.tolerations.value
  65. 66 kubectl explain pod.spec.tolerations.effect
  66. 67 history
  67. 68 #kubectl taint nodes worker-2 key1=value1:NoSchedule
  68. 69 kubectl taint nodes worker2 key1=value1:NoSchedule
  69. 70 kubectl get nodes
  70. 71 kubectl taint nodes worker2.example.com key1=value1:NoSchedule
  71. 72 kubectl get pods -o wide
  72. 73 vim npabc.yaml
  73. 74 kubectl create -f npabc.yaml
  74. 75 kubectl get pods -o wide
  75. 76 kubectl create deployment anothernginx --image=nginx --replicas=4
  76. 77 kubectl get pods -o wide
  77. 78 kubectl taint nodes worker2.example.com key1=value1:NoSchedule-
  78. 79 kubectl get pods -o wide
  79. 80 kubectl delete pod anothernginx-5556746bdc-lj4d4
  80. 81 kubectl get pods -o wide
  81. 82 kubectl explain pod.spec.nodename
  82. 83 kubectl explain pod.spec | less
  83. 84 kubectl explain pod.spec.nodeName
  84. 85 ./counter.sh 15
  85. 86 kubectl top pods
  86. 87 cd ..
  87. 88 git clone https://github.com/kubernetes-sigs/metrics-server
  88. 89 ls
  89. 90 cd metrics-server/
  90. 91 ls
  91. 92 cd manifests/
  92. 93 less ../README.md
  93. 94 ls
  94. 95 cd base/
  95. 96 ls
  96. 97 cd
  97. 98 kubectl create -f metrics-server/manifests/base/
  98. 99 kubectl delete -f metrics-server/manifests/base/
  99. 100 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
  100. 101 kubectl -n kube-system edit deployments.apps metrics-server
  101. 102 kubectl -n kube-system logs metrics-server-5b78d5f9c6-kwx27
  102. 103 kubectl get deploy -n kube-system
  103. 104 kubectl get pods -n kube-system
  104. 105 kubectl get pods
  105. 106 kubectl top -h
  106. 107 kubectl top pod
  107. 108 history
  108. 109 kubectl top pod -h
  109. 110 kubectl top pod --sort-by=cpu
  110. 111 kubectl top pod --sort-by=cpu | head -2 | tail -1
  111. 112 kubectl top pod --sort-by=cpu | head -2 | tail -1 > /tmp/highload.txt
  112. 113 cd cka/
  113. 114 ./counter.sh 6
  114. 115 ssh root@worker2
  115. 117 kubectl run mynginx --image=nginx --dry-run=client -o yaml > nginxb.ymal
  116. 118 scp nginxb.ymal [email protected]/var/lib/kubelet/
  117. 119 scp nginxb.ymal [email protected]:/var/lib/kubelet/nginxb.yaml
  118. 121 kubectl get pods
  119. 122 history
Add Comment
Please, Sign In to add comment