sandervanvugt

ex280 day2 feb22

Feb 17th, 2022
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.10 KB | None | 0 0
  1. 997 echo ########EX280 DAY 2 #############
  2. 998 oc whoami
  3. 999 crc oc-env
  4. 1000 eval $(crc oc-env)
  5. 1001 source <(oc completion bash)
  6. 1002 oc whoami
  7. 1003 oc get co
  8. 1004 oc get oauth cluster -o yaml | less
  9. 1005 oc login -u developer
  10. 1006 oc new-project bitroot
  11. 1007 oc new-app --image=bitnami/nginx --name=bginx
  12. 1008 oc get pods -o wide
  13. 1009 oc describe pod bginx-79ffc6d875-dgp68
  14. 1010 oc get svc
  15. 1011 oc get all
  16. 1012 curl 10.217.4.7:8080
  17. 1013 oc describe svc bginx
  18. 1014 oc scale deploy bginx --replicas=3
  19. 1015 oc describe svc bginx
  20. 1016 oc edit svc bginx
  21. 1017 oc describe svc bginx
  22. 1018 oc edit svc bginx
  23. 1019 oc describe svc bginx
  24. 1020 oc get svc
  25. 1021 oc expose service --help | less
  26. 1022 oc create --help | less
  27. 1023 oc create route --help | less
  28. 1024 oc create route edge --help | less
  29. 1025 oc expose svc bginx
  30. 1026 oc get all
  31. 1027 curl bginx-bitroot.apps-crc.testing
  32. 1028 oc describe routes.route.openshift.io bginx
  33. 1029 rm -rf openssl
  34. 1030 mkdir openssl
  35. 1031 cd openssl/
  36. 1032 ls
  37. 1033 openssl genrsa -des3 -out myCA.key 2048
  38. 1034 openssl req -x509 -new -nodes -key -myCA.key -sha256 -days3650 -out myCA.pem
  39. 1035 openssl req -x509 -new -nodes -key -myCA.key -sha256 -days 3650 -out myCA.pem
  40. 1036 openssl req -x509 -new -nodes -key myCA.key -sha256 -days 3650 -out myCA.pem
  41. 1037 openssl genrsa -out tls.key 2048
  42. 1038 openssl req -new -key tls.key -out tls.csr
  43. 1039 openssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.crt -days 1650 -sha256
  44. 1040 ls -l
  45. 1041 man openssl-req
  46. 1042 man openssl-x509
  47. 1043 cd
  48. 1044 ex180/countdown 16
  49. 1045 oc whoami
  50. 1046 oc new-project myproject
  51. 1047 oc get all
  52. 1048 cd ex280/
  53. 1049 ls
  54. 1050 vim linginx1.conf
  55. 1051 oc create cm linginx1 --from-file linginx1.conf
  56. 1052 oc get cm linginx1 -o yaml
  57. 1053 oc login -u admin -p password
  58. 1054 oc create sa linginx-sa
  59. 1055 oc adm policy add-scc-to-user anyuid -z linginx-sa
  60. 1056 oc login -u developer
  61. 1057 vim linginx-v1.yaml
  62. 1058 oc create -f linginx-v1.yaml
  63. 1059 oc get pods
  64. 1060 oc get svc
  65. 1061 oc describe svc linginx1
  66. 1062 oc create route edge -h | less
  67. 1063 oc create route edge linginx1 --service linginx1 --cert=../openssl/tls.crt --key=../openssl/tls.key --ca-cert=../openssl/myCA.pem
  68. 1064 curl -svv https://linginx1-myproject.apps-crc.testing
  69. 1065 curl -skvv https://linginx1-myproject.apps-crc.testing
  70. 1066 cd
  71. 1067 mkdir opentls
  72. 1068 cd opentls/
  73. 1069 openssl genrsa -des3 -out myCA.key 2048
  74. 1070 openssl req -x509 -new -nodes -key myCA.key -sha256 -days 3650 -out myCA.pem
  75. 1071 openssl genrsa -out tls.key 2048
  76. 1072 openssl req -new -key tls.key -out tls.csr
  77. 1073 oc create secret tls linginx-certs --cert tls.crt --key tls.key
  78. 1074 ls
  79. 1075 openssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.crt -days 1650 -sha256
  80. 1076 oc create secret tls linginx-certs --cert tls.crt --key tls.key
  81. 1077 oc create secret -h
  82. 1078 oc create secret tls -h | less
  83. 1079 oc get secret linginx-certs -o yaml
  84. 1080 cd ../ex280/
  85. 1081 ls
  86. 1082 cat default.conf
  87. 1083 oc create cm nginxconfigmap --from-file default.conf
  88. 1084 oc create sa linginx-sa
  89. 1085 oc projects
  90. 1086 vim linginx-v2.yaml
  91. 1087 oc create -f linginx-v2.yaml
  92. 1088 oc create route passtrough -h | less
  93. 1089 oc create route passthrough -h | less
  94. 1090 oc create route passthrough linginx --service linginx2 --port 8443 --hostname=linginx-default.apps-crc.testing
  95. 1091 oc get all
  96. 1092 oc get svc
  97. 1093 oc debug -t deployment/linginx2 --image registry.access.redhat.com/ubi8/ubi
  98. 1094 curl -k https://linginx-default.apps-crc.testing
  99. 1095 ls
  100. 1096 ../ex180/countdown 15
  101. 1097 oc whoami
  102. 1098 cd
  103. 1099 oc new-project simple
  104. 1100 oc create deploy simple --image=bitnami/nginx
  105. 1101 oc get all
  106. 1102 oc scale --replicas=4 deploy/simple
  107. 1103 oc get pods -o wide
  108. 1104 oc login -u admin -p password
  109. 1105 oc get nodes -L env
  110. 1106 oc label nodes crc-8rwmc-master-0 env=dev
  111. 1107 oc get nodes -L env
  112. 1108 oc login -u developer
  113. 1109 oc edit deploy simple
  114. 1110 oc get pods -o wide
  115. 1111 oc get all
  116. 1112 oc describe pod simple-8fc8c86b6-l2vh9
  117. 1113 oc whoami
  118. 1114 oc login -u admin -p password
  119. 1115 oc label node crc-8rwmc-master-0 env=blah
  120. 1116 oc label node crc-8rwmc-master-0 env=blah --overwrite
  121. 1117 oc get all
  122. 1118 free -m
  123. 1119 ls -a
  124. 1120 cd .crc
  125. 1121 ls
  126. 1122 cd machines/
  127. 1123 ls
  128. 1124 cd crc
  129. 1125 ls
  130. 1126 ssh -i id_ecdsa core@$(crc ip)
  131. 1127 rm ~/.ssh/known_hosts
  132. 1128 ssh -i id_ecdsa core@$(crc ip)
  133. 1129 history
  134. 1130 oc autoscale -h | less
  135. 1131 oc new-app --name simple php~https://github.com/sandervanvugt/simpleapp
  136. 1132 oc new-app --name toosimple php~https://github.com/sandervanvugt/simpleapp
  137. 1133 oc get deploy
  138. 1134 oc get all
  139. 1135 oc autoscale deployment toosimple --min 5 --max 10 --cpu-percent 1
  140. 1136 oc get hpa
  141. 1137 oc get pods
  142. 1138 oc set resources -h | less
  143. 1139 oc new-project limited
  144. 1140 oc create deploy nee --image=bitnami/nginx --replicas=3
  145. 1141 oc get pods
  146. 1142 oc get all
  147. 1143 oc set resources deploy nee --requests=10m,memory=1Mi --limits cpu=20m,memory=5Mi
  148. 1144 oc set resources deploy nee --requests cpu=10m,memory=1Mi --limits cpu=20m,memory=5Mi
  149. 1145 oc get all
  150. 1146 oc describe pods nee-84cbcb6569-hzccc
  151. 1147 oc set resources deploy nee --requests cpu=10m,memory=10Mi --limits cpu=20m,memory=50Mi
  152. 1148 oc get all
  153. 1149 oc set resources deploy nee --requests cpu=10m,memory=1Mi --limits cpu=20m,memory=5Mi
  154. 1150 oc get all
  155. 1151 oc get pods nee-84cbcb6569-sxw6h -o yaml | less
  156. 1152 oc set resources deploy nee --requests cpu=0m,memory=0Mi --limits cpu=0m,memory=0Mi
  157. 1153 oc get all
  158. 1154 cd
  159. 1155 ex180/countdown 18
  160. 1156 oc describe node crc-8rwmc-master-0
  161. 1157 oc adm top
  162. 1158 oc adm top node
  163. 1159 oc create quota -h | less
  164. 1160 oc get resourcequota -A
  165. 1161 oc whoami
  166. 1162 oc login -u developer
  167. 1163 oc new-project quota-test
  168. 1164 oc login -u admin -p password
  169. 1165 oc createa quota qtest --hard pods=3,cpu=100m,memory=500Mi
  170. 1166 oc create quota qtest --hard pods=3,cpu=100m,memory=500Mi
  171. 1167 oc describe quota
  172. 1168 oc login -u developer
  173. 1169 oc create deploy bitginx --image=bitnami/nginx --replicas=3
  174. 1170 oc get all
  175. 1171 oc describe rs bitginx-cd4645bb4
  176. 1172 oc create deploy -h | less
  177. 1173 oc new-app | less
  178. 1174 oc new-app -h | less
  179. 1175 oc set resources deploy bitginx --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi
  180. 1176 oc get all
  181. 1177 oc get resourcequota
  182. 1178 oc describe quota
  183. 1179 oc describe quota -n default
  184. 1180 oc projects
  185. 1181 oc projects -n simple
  186. 1182 oc describe quota -n simple
  187. 1183 oc whoami
  188. 1184 oc new-project limits
  189. 1185 oc login -u admin -p password
  190. 1186 oc explain limitrange
  191. 1187 oc explain limitrange.spec
  192. 1188 oc explain limitrange.spec.limits
  193. 1189 oc explain --recursive limitrange.spec.limits
  194. 1190 oc explain --recursive limitrange.spec.limits.default
  195. 1191 cd ex280/
  196. 1192 vim limits.yaml
  197. 1193 oc create --save-config -f limits.yaml
  198. 1194 oc get limitranges
  199. 1195 oc describe limitranges
  200. 1196 oc create deploy failginx --image=bitnami/nginx --replicas=10
  201. 1197 oc get all
  202. 1198 oc describe rs failginx-56b7b67f85
  203. 1199 echo $(( 2 * 1024 * 1024 ))
  204. 1200 oc projects
  205. 1201 oc project
  206. 1202 oc delete ns limits
  207. 1203 ../ex180/countdown 12
  208. 1204 oc login -u admin -p password
  209. 1205 oc edit nodes crc-8rwmc-master-0
  210. 1206 oc adm taint -h | less
  211. 1207 oc adm taint node crc-8rwmc-master-0 key1=value1:NoSchedule
  212. 1208 oc run newpod --image=bitnami/nginx
  213. 1209 oc get pods
  214. 1210 oc describe pods newpod
  215. 1211 oc edit pod newpod
  216. 1212 oc get pods
  217. 1213 oc adm taint nodes crc-8rwmc-master-0 key1-
  218. 1214 oc adm --help
  219. 1215 oc adm cordon crc-8rwmc-master-0
  220. 1216 oc describe nodes crc-8rwmc-master-0
  221. 1217 oc describe nodes crc-8rwmc-master-0 | less
  222. 1218 oc adm uncordon crc-8rwmc-master-0
  223. 1219 history
Advertisement
Add Comment
Please, Sign In to add comment