sandervanvugt

ex280 day2 april22

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