Advertisement
sandervanvugt

DevOps day3 april21

Apr 16th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. [student@localhost devopsinfourweeks]$ history
  2. 1 ip a
  3. 2 free -m
  4. 3 df -h
  5. 4 lscpu
  6. 5 sudo vim /etc/fstab
  7. 6 sudo vi /etc/fstab
  8. 7 sudo yum install -y vim git bash-completion wget
  9. 8 git clone https://github.com/sandervanvugt/devopsinfourweeks
  10. 9 cd devopsinfourweeks/
  11. 10 ls
  12. 11 sudo ./setup-docker.sh
  13. 12 systemctl status docker
  14. 13 sudo ./setup-kubetools.sh
  15. 14 free -m
  16. 15 sudo kubeadm init --pod-network-cidr=10.10.0.0/16
  17. 16 cd
  18. 17 mkdir .kube
  19. 18 sudo cp /etc/kubernetes/admin.conf .kube/config
  20. 19 less .kube/config
  21. 20 sudo less .kube/config
  22. 21 sudo chown student:student .kube/config
  23. 22 kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
  24. 23 wget https://docs.projectcalico.org/manifests/custom-resources.yaml
  25. 24 vim custom-resources.yaml
  26. 25 kubectl create -f custom-resources.yaml
  27. 26 kubectl get pods -n calico-system
  28. 27 kubectl taint nodes --all node-role.kubernete.io/master-
  29. 28 kubectl taint nodes --all node-role.kubernetes.io/master-
  30. 29 kubectl get pods -n calico-system
  31. 30 kubectl get all
  32. 31 kubectl run myfirstpod --image=nginx
  33. 32 kubectl get pods
  34. 33 top
  35. 34 history
  36. 35 ls
  37. 36 cd devopsinfourweeks/
  38. 37 ls
  39. 38 ./counter.sh 12
  40. 39 cd ..
  41. 40 kubectl -h | less
  42. 41 kubectl create -h | less
  43. 42 kubectl create deployment -h | less
  44. 43 kubectl -h | less
  45. 44 kubectl completion -h
  46. 45 source <(kubectl completion bash)
  47. 46 exit
  48. 47 source <(kubectl completion bash)
  49. 48 kubectl api-resources | less
  50. 49 kubectl create deployment mydeploy --image=nginx
  51. 50 kubectl get all
  52. 51 kubectl scale deployment mydeploy --replicas=3
  53. 52 kubectl get all
  54. 53 kubectl delete pod mydeploy-7dff945675-4ln7f
  55. 54 kubectl get all
  56. 55 kubectl delete pod myfirstpod
  57. 56 kubectl get all
  58. 57 kubectl run busybox --image=busybox
  59. 58 kubectl get pods
  60. 59 kubectl describe pod busybox
  61. 60 kubectl run mymariadb mariadb
  62. 61 kubectl run mymariadb --image=mariadb
  63. 62 kubectl describe pod mymariadb
  64. 63 kubectl get pods
  65. 64 kubectl describe pods mymariadb
  66. 65 kubectl logs mymariadb
  67. 66 kubectl run -h
  68. 67 kubectl run mymariadb --image=mariadb --env=MYSQL_ROOT_PASSWORD=secret
  69. 68 kubectl delete pod mymariadb
  70. 69 kubectl run mymariadb --image=mariadb --env=MYSQL_ROOT_PASSWORD=secret
  71. 70 kubectl get pods
  72. 71 docker login
  73. 72 cd devopsinfourweeks/
  74. 73 ls
  75. 74 vim deploy-webserver.yaml
  76. 75 kubectl create -f deploy-webserver.yaml
  77. 76 vim deploy-webserver.yaml
  78. 77 kubectl create -f deploy-webserver.yaml
  79. 78 kubectl create deploy mynginx --image=nginx --replicas=3 --dry-run -o yaml > mynginx.yaml
  80. 79 kubectl create deploy mynginx --image=nginx --replicas=3 --dry-run=client -o yaml > mynginx.yaml
  81. 80 vim mynginx.yaml
  82. 81 kubectl run mybusybox --image=busybox --dry-run=client -o yaml > buysbox.yaml
  83. 82 vim buysbox.yaml
  84. 83 kubectl explain pods
  85. 84 kubectl explain pods.spec
  86. 85 vim buysbox.yaml
  87. 86 kubectl create -f buysbox.yaml
  88. 87 kubectl get pods
  89. 88 ./counter.sh 12
  90. 89 kubectl get deploy
  91. 90 kubectl get all --selector app=mydeploy
  92. 91 kubectl get all --selector app=mydeploy -o wide
  93. 92 kubectl expose deploy mydeploy --port=80 --type=NodePort
  94. 93 kubectl get svc
  95. 94 curl http://10.96.55.20
  96. 95 curl http://192.168.29.69:31817
  97. 96 ls
  98. 97 kubectl explain pods.spec.volumes | less
  99. 98 vim pv-pvc-pod.yaml
  100. 99 kubectl create -f pv-pvc-pod.yaml
  101. 100 kubectl get pv
  102. 101 kubectl get pvc
  103. 102 kubectl describe pod local-pv-pod
  104. 103 kubectl exec -it local-pv-pod -- touch /usr/share/nginx/html/hello
  105. 104 ubectl exec -it local-pv-pod -- touch /usr/share/nginx/html/hello
  106. 105 [student@localhost devopsinfourweeks]$
  107. 106 kubectl describe pv local-pv-volume
  108. 107 ls /mnt/data/
  109. 108 history
  110. 109 ./counter.sh 12
  111. 110 history | grep sql
  112. 111 history | grep MYSQL
  113. 112 kubectl create deploy mariadeploy --image=mariadb
  114. 113 kubectl get all --selector app=mariadb
  115. 114 kubectl get all --selector app=mariadeploy
  116. 115 kubectl set env deploy/mariadeploy MYSQL_ROOT_PASSWORD=secret
  117. 116 kubectl get all --selector app=mariadeploy
  118. 117 kubectl create cm myvars --from-literal=VAR1=goat --from-literal=VAR2=buffalo
  119. 118 kubectl describe cm myvars
  120. 119 vim cm-test-pod.yaml
  121. 120 kubectl create -f cm-test-pod.yaml
  122. 121 kubectl logs test1
  123. 122 kubectl create cm nginxconf --from-file nginx-custom-config.conf
  124. 123 cat nginx-custom-config.conf
  125. 124 kubectl describe cm nginxconf
  126. 125 vim nginx-cm.yml
  127. 126 kubectl create -f nginx-cm.yml
  128. 127 kubectl get pods
  129. 128 kubectl describe pods nginx-cm
  130. 129 kubectl get cm
  131. 130 kubectl create cm nginx-cm --from-file nginx-custom-config.conf
  132. 131 kubectl get pods
  133. 132 kubectl describe pods nginx-cm
  134. 133 kubectl get pdos
  135. 134 kubectl get pods
  136. 135 kubectl exec -it nginx-cm /bin/bash
  137. 136 kubectl api-resources | grep -i deploy
  138. 137 vim sslcerts-crd.yaml
  139. 138 kubectl create -f sslcerts-crd.yaml
  140. 139 vim my-sslcert.yaml
  141. 140 kubectl create -f my-sslcert.yaml
  142. 141 kubectl api-resources | grep example
  143. 142 kubectl explain sslconfigs
  144. 143 kubectl explain sslconfigs.spec
  145. 144 kubectl get deploy
  146. 145 kubectl delete deploy mariadeploy
  147. 146 history
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement