Advertisement
sandervanvugt

ex280 day2 july22

Jul 28th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.53 KB | None | 0 0
  1. 1003 eval $(crc oc-env)
  2. 1004 oc login -u admin -p password
  3. 1005 oc get all
  4. 1006 source <(oc completion bash)
  5. 1007 oc describe svc bginx
  6. 1008 oc get all --show-labels
  7. 1009 oc scale deployment bginx --replicas=3
  8. 1010 oc describe svc bginx
  9. 1011 oc edit svc bginx
  10. 1012 oc describe svc bginx
  11. 1013 oc edit svc bginx
  12. 1014 oc describe svc bginx
  13. 1015 oc get svc
  14. 1016 oc expose svc bginx
  15. 1017 oc get routes,svc
  16. 1018 curl bginx-sccs.apps-crc.testing
  17. 1019 oc describe route bginx
  18. 1020 rm -rf openssl/
  19. 1021 mkdir openssl
  20. 1022 cd openssl/
  21. 1023 ls
  22. 1024 openssl genrsa -des3 -out myCA.key 2048
  23. 1025 openssl req -x509 -new -nodes -key myCA.key -sha256 -days 3650 -out myCA.pem
  24. 1026 ls -l
  25. 1027 pwd
  26. 1028 openssl genrsa -out tls.key 2048
  27. 1029 openssl req -new -key tls.key -out tls.csr
  28. 1030 openssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.crt -days 1650 -sha256
  29. 1031 ls -l
  30. 1032 openssl req -test -verify -noout -in tls.csr
  31. 1033 openssl req -text -verify -noout -in tls.csr
  32. 1034 man openssl-req
  33. 1035 man openssl-x509
  34. 1036 ls -l
  35. 1037 ../ex180/countdown 15
  36. 1038 oc login -u linda -p password
  37. 1039 oc new-project myproject
  38. 1040 oc login -u admin -p password
  39. 1041 oc project myproject
  40. 1042 oc get all
  41. 1043 oc delete all
  42. 1044 oc delete all --all
  43. 1045 oc get all
  44. 1046 cd ../ex280/
  45. 1047 history | grep git
  46. 1048 ls
  47. 1049 vim linginx1.conf
  48. 1050 oc create cm linginx1 --from-file linginx1.conf
  49. 1051 oc create sa linginx-sa
  50. 1052 oc adm policy add-scc-to-user anyuid -z linginx-sa
  51. 1053 vim linginx-v1.yaml
  52. 1054 oc create -f linginx-v1.yaml
  53. 1055 oc get all
  54. 1056 oc create route -h | less
  55. 1057 oc create route edge -h | less
  56. 1058 cd
  57. 1059 oc create route edge linginx1 --service linginx1 --cert openssl/tls.crt --key openssl/tls.key --ca-cert openssl/myCA.pem
  58. 1060 oc get routes
  59. 1061 curl -svvk https://linginx1-myproject.apps-crc.testing
  60. 1062 curl -svv https://linginx1-myproject.apps-crc.testing
  61. 1063 history
  62. 1064 ex180/countdown 1
  63. 1065 oc edit routes.route.openshift.io linginx1
  64. 1066 oc describe routes linginx1
  65. 1067 mkdir ssl
  66. 1068 cd ssl
  67. 1069 openssl genrsa -des3 -out myCA.key 2048
  68. 1070 openssl req -x509 -new -nodes -key myCA.key -sha256 -days 3650 -out myCA.pem
  69. 1071 openssl genrsa -out tls.key 2048
  70. 1072 openssl req -new -key tls.key -out tls.csr
  71. 1073 op[enssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.csr -days 1650 -sha256
  72. 1074 openssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.csr -days 1650 -sha256
  73. 1075 oc create secret tls -h | less
  74. 1076 oc create secret tls linginx-cert --cert tls.crt --keys tls.key
  75. 1077 oc create secret tls linginx-cert --cert tls.crt --key tls.key
  76. 1078 ls
  77. 1079 openssl req -new -key tls.key -out tls.csr
  78. 1080 openssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.crt -days 1650 -sha256
  79. 1081 ls -l
  80. 1082 oc create secret tls linginx-cert --cert tls.crt --key tls.key
  81. 1083 oc get secret linginx-certs -o yaml
  82. 1084 oc get secret linginx-cert -o yaml
  83. 1085 cd ../ex280/
  84. 1086 vim default.conf
  85. 1087 oc create cm nginxconfigmap --from-file default.conf
  86. 1088 oc create sa linginx-sa
  87. 1089 oc new-project default
  88. 1090 oc project default
  89. 1091 oc get all
  90. 1092 oc create sa linginx-sa
  91. 1093 oc create cm nginxconfigmap --from-file default.conf
  92. 1094 oc create secret tls linginx-cert --cert tls.crt --key tls.key
  93. 1095 cd ../ssl/
  94. 1096 oc create secret tls linginx-cert --cert tls.crt --key tls.key
  95. 1097 cd ../ex280/
  96. 1098 oc adm policy add-scc-to-user anyuid -z linginx-sa
  97. 1099 vim linginx-v2.yaml
  98. 1100 oc create -f linginx-v2.yaml
  99. 1101 oc create route passtrough -h | less
  100. 1102 oc create route passthrough -h
  101. 1103 oc create route passthrough linginx --service linginx2 --port 8443
  102. 1104 oc describe route linginx
  103. 1105 oc get svc
  104. 1106 oc debug -t deployment/linginx2 --image registry.access.redhat.com/ubi8/ubi:8.0
  105. 1107 oc debug -t deployment/linginx2 --image ubi9/ubi
  106. 1108 curl https://linginx-default.apps-crc.testing
  107. 1109 curl -svv https://linginx-default.apps-crc.testing
  108. 1110 curl -svvk https://linginx-default.apps-crc.testing
  109. 1111 oc get svc
  110. 1112 curl -sk https://10.217.5.50:8443
  111. 1113 oc edit svc linginx2
  112. 1114 oc get svc
  113. 1115 crc ip
  114. 1116 curl -sk https://192.168.130.11:30964
  115. 1117 curl -svvk https://192.168.130.11:30964
  116. 1118 echo WE ARE ON BREAK UNTIL HH:15
  117. 1119 history
  118. 1120 oc describe route linginx
  119. 1121 cd ../ssl/
  120. 1122 rm *csr
  121. 1123 rm *crt
  122. 1124 openssl req -new -key tls.key -out tls.csr
  123. 1125 openssl x509 -req -in tls.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out tls.crt -days 1650 -sha256
  124. 1126 oc projects
  125. 1127 oc delete secret linginx-certs
  126. 1128 oc get secrets
  127. 1129 oc create secret tls linginx-certs --cert tls.crt --key tls.key
  128. 1130 oc get deploy
  129. 1131 oc delete deploy linginx2
  130. 1132 cd ../ssl/
  131. 1133 cd ../ex280/
  132. 1134 oc create -f linginx-v2.yaml
  133. 1135 curl -svvk https://linginx-default.apps-crc.testing
  134. 1136 vim linginx-v2.yaml
  135. 1137 history | grep secret
  136. 1138 curl -svvk https://linginx-default.apps-crc.testing
  137. 1139 oc login -u developer -p password
  138. 1140 oc login -u linda -p password
  139. 1141 oc get users
  140. 1142 oc create deploy simple --image=bitnami/nginx
  141. 1143 oc get all
  142. 1144 oc new-project mnp
  143. 1145 oc create deploy simple --image=bitnami/nginx
  144. 1146 oc get all
  145. 1147 oc scale --replicas 4 deploy simple
  146. 1148 oc get all
  147. 1149 oc get pods -o wide
  148. 1150 oc login -u admin -p password
  149. 1151 oc get users
  150. 1152 oc login -u developer
  151. 1153 oc login -u admin -p password
  152. 1154 oc get nodes -L
  153. 1155 oc get nodes
  154. 1156 oc get nodes --show-labels
  155. 1157 oc get nodes -L env
  156. 1158 oc label nodes crc-sjtnl-master-0 env=dev
  157. 1159 oc get nodes -L env
  158. 1160 oc login -u developer
  159. 1161 history
  160. 1162 oc login -u linda -p password
  161. 1163 oc get all
  162. 1164 oc edit deploy simple
  163. 1165 oc get all
  164. 1166 oc describe pod simple-5b4cf6ffd4-qpkhv
  165. 1167 oc edit deploy simple
  166. 1168 oc get all
  167. 1169 oc delete all --all
  168. 1170 oc login -u admin -p password
  169. 1171 oc label node -l env env-
  170. 1172 oc describe nodes crc-sjtnl-master-0
  171. 1173 oc describe nodes crc-sjtnl-master-0 | less
  172. 1174 oc explain --recursive node.spec | less
  173. 1175 oc projects
  174. 1176 oc login -u linda -p password
  175. 1177 oc get all
  176. 1178 oc new-app --name simple php~https://github.com/sandervanvugt/simpleapp
  177. 1179 oc get deploy
  178. 1180 oc get all
  179. 1181 oc autoscale -h | less
  180. 1182 oc autoscale deploy simple --min 5 --max 10 --cpu-percent 1
  181. 1183 oc get hpa
  182. 1184 oc get all
  183. 1185 oc new-project nee
  184. 1186 oc create deployment nee --image=bitnami/nginx --replicas=3
  185. 1187 oc get pods
  186. 1188 oc set resources -h | less
  187. 1189 oc set resources deploy nee --requests cpu=10m,memory=1Mi --limits cpu=20m,memory=5Mi
  188. 1190 oc get pods
  189. 1191 oc get all
  190. 1192 oc describe pods nee-55b99ffbbc-n7zfb
  191. 1193 oc set resources deploy nee --requests cpu=0m,memory=0Mi --limits cpu=0m,memory=0Mi
  192. 1194 oc get all
  193. 1195 oc set resources deploy nee --requests cpu=10m,memory=15Mi --limits cpu=20m,memory=50Mi
  194. 1196 oc get all
  195. 1197 oc describe pod nee-5fc779c684-l7cvf
  196. 1198 oc get all
  197. 1199 oc delete all --all
  198. 1200 oc create deployment nee --image=bitnami/nginx --replicas=3
  199. 1201 oc set resources deploy nee --requests cpu=10m,memory=15Mi --limits cpu=20m,memory=50Mi
  200. 1202 oc edit deployment nee
  201. 1203 oc get nodes
  202. 1204 oc login -u admin -p password
  203. 1205 oc describe nodes crc-sjtnl-master-0
  204. 1206 oc adm top node
  205. 1207 oc adm top pod
  206. 1208 ../ex180/countdown 13
  207. 1209 oc login -u developer
  208. 1210 oc new-project quota-test
  209. 1211 oc login -u admin -p password
  210. 1212 oc create quota -h | less
  211. 1213 oc create quota qtest --hard pods=3,cpu=100m,memory=500Mi
  212. 1214 oc describe quota
  213. 1215 oc describe ns qtest
  214. 1216 oc describe ns quota-test
  215. 1217 oc login -u developer
  216. 1218 oc create deploy nitginx --image=bitnami/nginx --replicas=3
  217. 1219 oc get all
  218. 1220 oc describe rs nitginx-6d4866566b
  219. 1221 oc set resources deploy nitginx --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi
  220. 1222 oc get all
  221. 1223 oc describe ns quota-test
  222. 1224 oc edit quota qtest
  223. 1225 oc login -u admin -p password
  224. 1226 oc edit quota qtest
  225. 1227 oc login -u developer
  226. 1228 oc get all
  227. 1229 oc edit deployment nitginx
  228. 1230 oc get all
  229. 1231 oc edit deployment nitginx
  230. 1232 oc projectws
  231. 1233 oc project
  232. 1234 oc projects
  233. 1235 oc new-project limits
  234. 1236 oc login -u admin -p password
  235. 1237 oc explain limitrange.spec.limits | less
  236. 1238 oc explain --recursive limitrange.spec.limits | less
  237. 1239 vim limits.yaml
  238. 1240 oc apply -f limits.yaml
  239. 1241 oc get limitrange
  240. 1242 oc describe limitrange limit-limits
  241. 1243 oc describe limits
  242. 1244 oc describe ns limits
  243. 1245 oc set resource -h | less
  244. 1246 oc set resources -h | less
  245. 1247 oc login -u admin -p password
  246. 1248 oc adm taint -h
  247. 1249 oc adm taint nodes crc-sjtnl-master-0 key1=value1:NoSchedule
  248. 1250 oc run newpod --image=bitnami/nginx
  249. 1251 oc projects
  250. 1252 oc new-project tainted
  251. 1253 oc run newpod --image=bitnami/nginx
  252. 1254 oc get pods
  253. 1255 oc edit pod newpod
  254. 1256 oc get pods
  255. 1257 oc run newerpod --image=bitnami/nginx
  256. 1258 oc get pods
  257. 1259 oc whoami
  258. 1260 oc adm taint nodes crc-sjtnl-master-0 key1-
  259. 1261 oc get pods
  260. 1262 history
  261.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement