sandervanvugt

Kube5H nov20

Nov 30th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.15 KB | None | 0 0
  1. 1 mkdir -p $HOME/.kube
  2. 2 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  3. 3 ls -l .kube/config
  4. 4 sudo chown student:student .kube/config
  5. 5 kubectl get all
  6. 6 kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')
  7. 7 kubectl get nodes
  8. 8 kubectl get pods
  9. 9 kubectl get pods -n kube-system
  10. 10 kubectl edit node kubeaio.example.com
  11. 11 kubectl get ndoes
  12. 12 kubectl get nodes
  13. 13 kubectl edit node kubaio.example.com
  14. 14 kubectl get all
  15. 15 kubectl --help | less
  16. 16 kubectl completion -h | less
  17. 17 source <(kubectl completion bash)
  18. 18 kubectl create -h | less
  19. 19 kubectl create deployment -h | less
  20. 20 kubectl create deployment firstnginx --image=nginx --replicas=3
  21. 21 kubectl get all
  22. 22 kubectl delete pods firstnginx-8cdb8cd74-fgxrl
  23. 23 kubectl get all
  24. 24 kubectl version
  25. 25 history
  26. 26 kubectl get pods
  27. 27 kubectl get pods -n kube-system
  28. 28 ps aux | grep etcd
  29. 29 kubectl run -h | less
  30. 30 kubectl run nginx --image=nginx
  31. 31 kubectl get all
  32. 32 kubectl scale -h | less
  33. 33 kubectl delete pod nginx
  34. 34 kubectl get pods
  35. 35 git clone https://github.com/sandervanvugt/kubernetes
  36. 36 cd kubernetes/
  37. 37 ./countdown 12
  38. 38 kubectl explain pod
  39. 39 kubectl explain pod.spec | less
  40. 40 kubectl run nginx2 --image=nginx
  41. 41 kubectl get pods
  42. 42 ls
  43. 43 vim busybox.yaml
  44. 44 kubectl get pods
  45. 45 kubectl explain pods
  46. 46 vim busybox.yaml
  47. 47 kubectl explain.spec.containers pods
  48. 48 kubectl explain.spec.container pods
  49. 49 kubectl explain pod spec.container
  50. 50 kubectl explain pod spec.containers
  51. 51 kubectl explain pods
  52. 52 kubectl explain pods.spec
  53. 53 kubectl explain pods.spec | less
  54. 54 kubectl explain pods.spec.containers | less
  55. 55 vim busybox.yaml
  56. 56 kubectl create -f busybox.yaml
  57. 57 kubectl get pods
  58. 58 kubectl describe pods
  59. 59 kubectl describe pods busybox2 | less
  60. 60 kubectl get pods
  61. 61 kubectl get pods nginx2 -o yaml > nginx2.yaml
  62. 62 vim nginx2.yaml
  63. 63 kubectl replace -f nginx2.yaml
  64. 64 kubectl delete pods nginx2
  65. 65 kubectl apply -f nginx2.yaml
  66. 66 kubectl run mypod --image=nginx --dry-run=client -o yaml > mypod.yaml
  67. 67 vim mypod.yaml
  68. 68 kubectl run -h | less
  69. 69 kubectl get ns
  70. 70 kubectl get all -n kube-system
  71. 71 kubectl create ns secret
  72. 72 kubectl get ns
  73. 73 vim busybox.yaml
  74. 74 kubectl create -f busybox.yaml
  75. 75 kubectl get pods
  76. 76 kubectl get pods -n secret
  77. 77 kubectl get pods -A
  78. 78 cd ../.kube/
  79. 79 ls
  80. 80 vim config
  81. 81 cd
  82. 82 kubectl create deployment -h | less
  83. 83 kubectl create deployment my-dep --image=busybox
  84. 84 kubectl get pods
  85. 85 kubectl describe pod my-dep-68d7dcffc4-4r7lh
  86. 86 kubectl delete deployments.apps my-dep
  87. 87 kubectl create deployment -h | less
  88. 88 kubectl create deployment my-dep --image=busybox -- sleep 3600
  89. 89 kubectl create deployment my-dep2 --image=busybox sleep 3600
  90. 90 kubectl create deployment --image=mariadb mymariadb
  91. 91 kubectl config set-context --current --namespace=secret
  92. 92 kubectl get pods
  93. 93 kubectl config set-context --current --namespace=default
  94. 94 kubectl get pods
  95. 95 kubectl describe pod mymariadb-58b96cb658-nq7vl
  96. 96 kubectl logs mymariadb-58b96cb658-nq7vl
  97. 97 kubectl exec -it busybox2 -- /bin/sh
  98. 98 kubectl logs mymariadb-58b96cb658-nq7vl -o json
  99. 99 cd kubernetes/
  100. 100 ./countdown 12
  101. 101 kubectl get all
  102. 102 kubectl get all --show-labels
  103. 103 kubectl get all --selector app=firstnginx
  104. 104 kubectl get deploy --show-labels
  105. 105 kubectl get all --selector app=firstnginx
  106. 106 kubectl label pod firstnginx-8cdb8cd74-hbzhb app-
  107. 107 kubectl get pods
  108. 108 kubectl create deployment nginxsvc --image=nginx
  109. 109 kubectl scale deployment nginxsvc --replica=3
  110. 110 kubectl scale deployment nginxsvc --replicas=3
  111. 111 kubectl get all --selector app=nginxsvc
  112. 112 kubectl expose deployment nginxsvc --port=80
  113. 113 kubectl get all --selector app=nginxsvc
  114. 114 kubectl describe svc nginxsvc
  115. 115 kubectl get pods -o wide --selector app=nginxsvc
  116. 116 kubectl scale deployment nginxsvc --replicas=5
  117. 117 kubectl get pods -o wide --selector app=nginxsvc
  118. 118 kubectl describe svc nginxsvc
  119. 119 oc get endpoints
  120. 120 kubectl get endpoints
  121. 121 ip
  122. 122 ip a
  123. 123 curl 192.168.4.13
  124. 124 curl http://192.168.4.13
  125. 125 kubectl get svc
  126. 126 curl http://10.111.122.241
  127. 127 kubectl get svc
  128. 128 kubectl edit svc nginxsvc
  129. 129 kubectl get svc
  130. 130 curl http://192.168.4.13:32000
  131. 131 vim volumes.yaml
  132. 132 kubectl create -f volumes.yaml
  133. 133 vim volumes.yaml
  134. 134 kubectl get pods
  135. 135 kubectl exec -it vol2 -c centos -- touch /test/myfile
  136. 136 kubectl exec -it vol2 -- touch /test/myfile
  137. 137 kubectl exec -it vol2 -- ls -l /test
  138. 138 kubectl explain pods.spec.volumes
  139. 139 kubectl explain pods.spec.volumes | less
  140. 140 vim volumes.yaml
  141. 141 history
Add Comment
Please, Sign In to add comment