sandervanvugt

chad day3 nov20

Nov 5th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.00 KB | None | 0 0
  1. 734 kubectl label deployment rolling-nginx state=demo
  2. 735 kubectl get deployments --show-labels
  3. 736 kubectl get deployments --selector app=nginx3
  4. 737 kubectl get all --selector app=nginx3
  5. 738 kubectl delete pod nginx3-7959df46c9-mskz6
  6. 739 kubectl get all --selector app=nginx3
  7. 740 kubectl create deployment nginx4 --image=nginx
  8. 741 kubectl describe deployments.apps nginx
  9. 742 kubectl describe pod nginx4-5cf4f4bcc6-w4gvs
  10. 743 kubectl get all --selector app=nginx4
  11. 744 kubectl scale deployment nginx4 --replicas=3
  12. 745 kubectl get all --selector app=nginx4
  13. 746 kubectl label pod nginx4-5cf4f4bcc6-w4gvs app-
  14. 747 kubectl get pods | grep nginx4
  15. 748 kubectl run --image=nginx nginxpod
  16. 749 kubectl get pods nginxpod --show-label
  17. 750 kubectl get pods nginxpod --show-labels
  18. 751 kubectl get pods --show-labels | grep run
  19. 752 history
  20. 753 kubectl expose deployment nginx4
  21. 754 kubectl expose deployment nginx4 --port=80
  22. 755 kubectl get svc
  23. 756 kubectl describe svc nginx4
  24. 757 kubectl create deployment nginxsvc --image=nginx --replicas=3
  25. 758 kubectl expose deployment nginxsvc --port=80
  26. 759 kubectl describe svc nginxsvc
  27. 760 kubectl get svc nginx -o=yaml
  28. 761 kubectl get svc nginxsvc -o=yaml
  29. 762 kubectl get endpoints
  30. 763 kubectl get svc
  31. 764 minikube ssh
  32. 765 curl http://10.108.139.198
  33. 766 kubectl edit svc nginxsvc
  34. 767 kubectl get svc
  35. 768 curl http://$(minikube ip):32000
  36. 769 vim service.yaml
  37. 770 kubectl expose deployment nginxsvc --port=80 --dry-run=client -o=yaml
  38. 771 history
  39. 772 kubectl get pods
  40. 773 kubectl get pods | grep usy
  41. 774 kubectl get svc
  42. 775 kubectl exec -it busybox2 -- nslookup nginx4
  43. 776 kubectl exec -it busybox2 -- cat /etc/resolv.conf
  44. 777 kubectl get pods -n kube-system -o wide
  45. 778 minikube addons list
  46. 779 minikube addons enable ingress
  47. 780 minikube addons enable ingress-dns
  48. 781 kubectl get deployment
  49. 782 kubectl get svc nginxsvc
  50. 783 curl http://$(minikube ip):32000
  51. 784 vim nginxsvc-ingress.yaml
  52. 785 kubectl apply -f nginxsvc-ingress.yaml
  53. 786 vim nginxsvc-ingress.yaml
  54. 787 kubectl get ingress
  55. 788 minikube ip
  56. 789 curl nginxsvc.info
  57. 790 kubectl describe ingress nginxsvc-ingress
  58. 791 kubectl edit svc nginxsvc
  59. 792 kubectl get svc
  60. 793 vim nginxsvc-ingress.yaml
  61. 794 curl nginxsvc.info
  62. 795 ./countdown 12
  63. 796 vim morevolumes.yaml
  64. 797 kubectl create -f morevolumes.yaml
  65. 798 kubectl get pods morevol2
  66. 799 kubectl describe pods morevol2
  67. 800 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  68. 801 kubectl exec -it morevol2 -c centos2 -- ls /centos2
  69. 802 kubectl explain pod.spec.volumes
  70. 803 kubectl explain pod.spec.volumes | less
  71. 804 kubectl explain pod.spec.volumes.emptydir | less
  72. 805 kubectl explain pod.spec.volumes.emptyDir | less
  73. 806 vim morevolumes.yaml
  74. 807 kubectl explain pv.spec
  75. 808 | less
  76. 809 kubectl explain pv.spec | less
  77. 810 ls
  78. 811 vim pv.yaml
  79. 812 kubectl create -f pv.yaml
  80. 813 vim pvc.yaml
  81. 814 kubectl apply -f pvc.yaml
  82. 815 kubectl get pv pvc
  83. 816 kubectl get pv
  84. 817 kubectl get pvc
  85. 818 vim pv-pod.yaml
  86. 819 kubectl create -f pv-pod.yaml
  87. 820 kubectl describe pod pv-pod
  88. 821 kubectl describe pvc pv-claim
  89. 822 kubectl describe pv pvc-ed3752e9-66dd-4f8d-8471-3d9d6d53bd7c
  90. 823 kubectl describe pv pv-volume
  91. 824 ./countdown 13
  92. 825 ls
  93. 826 vim nfs-pv.yaml
  94. 827 kubectl create -f nfs-pv.yaml
  95. 828 vim nfs-pvc.yaml
  96. 829 kubectl create -f nfs-pvc.yaml
  97. 830 vim nfs-pv-pod.yaml
  98. 831 kubectl create -f nfs-pv-pod.yaml
  99. 832 vim variables
  100. 833 kubectl create cm variables --from-env-file=variables
  101. 834 kubectl describe cm variables
  102. 835 vim cm-test-pod.yaml
  103. 836 kubectl create -f cm-test-pod.yaml
  104. 837 kubectl logs po/test
  105. 838 kubectl logs po/test1
  106. 839 kubectl create cm morevars --from-literal=VAR3=bybye --from-literal=VAR4=moon
  107. 840 kubectl get cm/morevars
  108. 841 kubectl get cm/morevars -o yamk
  109. 842 kubectl get cm/morevars -o yaml
  110. 843 kubectl describe cm morevars
  111. 844 cp cm-test-pod.yaml cm-test2-pod.yaml
  112. 845 vim cm-test2-pod.yaml
  113. 846 kubectl create -f cm-test2-pod.yaml
  114. 847 kubectl logs po test2
  115. 848 kubectl logs test2
  116. 849 kubectl get pods | grep test
  117. 850 cat cm-test-pod.yaml
  118. 851 cat cm-test2-pod.yaml
  119. 852 minikube ssh
  120. 853 kubectl get pods | grep test
  121. 854 kubectl delete all --all
  122. 855 vim nginx-custom-config.conf
  123. 856 kubectl create cm nginx-cm --from-file nginx-custom-config.conf
  124. 857 kubectl get cm nginx-cm -o yaml
  125. 858 vim nginx-cm.yml
  126. 859 kubectl get cm nginx-cm -o yaml
  127. 860 kubectl create -f nginx-cm.yml
  128. 861 kubectl get pods
  129. 862 history -w
  130. 863 sudo reboot
  131. 864 source <(kubectl completion bash)
  132. 865 kubectl create secret generic my-secret --my-file=ssh-private-key=/home/student/.ssh/id_rsa --from-literal=passphrase=password
  133. 866 kubectl create secret generic my-secret --from-file=ssh-private-key=/home/student/.ssh/id_rsa --from-literal=passphrase=password
  134. 867 ssh-keygen
  135. 868 kubectl create secret generic my-secret --from-file=ssh-private-key=/home/student/.ssh/id_rsa --from-literal=passphrase=password
  136. 869 kubectl describe secrets my-secret
  137. 870 kubectl get secret my-secret -o yaml | less
  138. 871 echo cGFzc3dvcmQ= | base64 -d
  139. 872 vim pod-secret.yaml
  140. 873 kubectl create secret generic secretstuff --from-literal=password=password --from-literal=user=linda
  141. 874 vim pod-secret
  142. 875 vim pod-secret.yaml
  143. 876 kubectl create -f pod-secret.yaml
  144. 877 kubectl get pods
  145. 878 minikube ssh
  146. 879 kubectl create -f pod-secret.yaml
  147. 880 kubectl delete -f pod-secret
  148. 881 kubectl delete -f pod-secret.yaml
  149. 882 kubectl create -f pod-secret.yaml
  150. 883 kubectl get pods
  151. 884 kubectl describe pod secretbox2
  152. 885 kubectl exec -it secretbox2 -- /bin/sh
  153. 886 kubectl create secret generic mysql --from-literal=password=root
  154. 887 kubectl get secrets mysql -o yaml
  155. 888 vim pod-secret-as-var.yaml
  156. 889 minikube ssh
  157. 890 vim pod-secret-as-var.yaml
  158. 891 kubectl create -f pod-secret-as-var.yaml
  159. 892 kubectl get pods
  160. 893 kubectl exec -it mymysql -- /bin/bash
  161. 894 kubectl get pods mymysql -o yaml | grep -i servicea
  162. 895 vim mypod.yaml
  163. 896 kubectl apply -f mypod.yaml
  164. 897 kubectl get pods
  165. 898 kubectl edit nginx-cm
  166. 899 history
  167. 900 kubectl delete -f mypod.yaml
  168. 901 vim mypod.yaml
  169. 902 kubectl apply -f mypod.yaml
  170. 903 kubectl get pods
  171. 904 kubectl get pods busybox -o yaml | less
  172. 905 kubectl exec -it busybox -- sh
  173. 906 cd ..
  174. 907 ls
  175. 908 vim mysa.yaml
  176. 909 kubectl apply -f mysa.yaml
  177. 910 vim list-pods.yaml
  178. 911 kubectl create -f list-pods.yaml
  179. 912 vim list-pods-mysa-binding.yaml
  180. 913 vim mysapod.yaml
  181. 914 kubectl create -f mysapod.yaml
  182. 915 kubectl get pods
  183. 916 kubectl exec -it mysapod -- sh
  184. 917 history
Add Comment
Please, Sign In to add comment