sandervanvugt

ex280 day1 feb22

Feb 16th, 2022
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.35 KB | None | 0 0
  1. 904 oc whoami
  2. 905 oc login -u kubeadmin -p afrA7-ReT7E-F4X4t-RjGYf
  3. 906 oc adm -h
  4. 907 oc adm -h | less
  5. 908 oc adm policy -h | less
  6. 909 oc adm policy add-cluster-role-to-user -h | less
  7. 910 oc policy -h | less
  8. 911 sudo yum provides */htpasswd
  9. 912 sudo yum provides */htpasswd; sudo yum install httpd-tools
  10. 913 rm /tmp/htpasswd
  11. 914 htpasswd -c -B -b /tmp/htpasswd admin password
  12. 915 htpasswd -B -b /tmp/htpasswd anna password
  13. 916 htpasswd -B -b /tmp/htpasswd linda password
  14. 917 htpasswd -B -b /tmp/htpasswd anouk password
  15. 918 htpasswd -B -b /tmp/htpasswd lisa password
  16. 919 htpasswd -B -b /tmp/htpasswd ahmed password
  17. 920 cat /tmp/htpasswd
  18. 921 oc create secret -h | less
  19. 922 oc create secret generic htpasswd-secret --from-file htpasswd=/tmp/htpasswd -n openshift-config
  20. 923 oc get secret -n openshift-config
  21. 924 oc adm policy add-cluster-role-to-user cluster-admin admin
  22. 925 oc get oauth
  23. 926 oc get oauth cluster -o yaml > oauth.yaml
  24. 927 vim oauth.yaml
  25. 928 oc replace -f oauth.yaml
  26. 929 oc get users
  27. 930 oc login -u anna -p password
  28. 931 kubectl get pods -n openshift-authentication
  29. 932 oc get pods -n openshift-authentication
  30. 933 oc login -u anna -p password
  31. 934 oc get nodes
  32. 935 oc login -u admin -p password
  33. 936 oc get nodes
  34. 937 oc get users
  35. 938 oc get identity
  36. 939 ex180/countdown 18
  37. 940 oc adm groups -h
  38. 941 oc adm groups new developers
  39. 942 oc adm groups add-users developers anouk
  40. 943 oc adm groups new testers
  41. 944 oc adm groups add-users testers lisa
  42. 945 history
  43. 946 oc get clusterroles
  44. 947 oc get clusterroles | wc
  45. 948 oc get clusterroles
  46. 949 oc get clusterroles | grep -v 'system:'
  47. 950 oc get clusterroles | grep -v 'system:' | grep -v 'cluster'
  48. 951 oc get clusterroles | grep -v 'system:' | grep -v 'cluster' | grep -v 'machine'
  49. 952 oc describe clusterroles edit
  50. 953 oc describe clusterroles edit | less
  51. 954 oc get clusterrolebindings
  52. 955 oc get rolebinding
  53. 956 oc projects
  54. 957 oc project
  55. 958 oc get rolebinding -n new
  56. 959 oc get clusterrolebindings -o wide
  57. 960 oc get clusterrolebindings -o wide | less
  58. 961 oc get clusterrolebindings -o wide | grep 'self-provisioner'
  59. 962 oc describe clusterrolebindings self-provisioners
  60. 963 oc adm policy remove-cluster-role-from-group self-provisioner system:authenticated:oauth
  61. 964 oc describe clusterrolebindings self-provisioners
  62. 965 oc login -u linda -p password
  63. 966 oc new-project rbac
  64. 967 oc login -u kubeadmin -p afrA7-ReT7E-F4X4t-RjGYf
  65. 968 oc login -u admin -p password
  66. 969 history
  67. 970 oc login -u admin -p password
  68. 971 crc status
  69. 972 oc logout
  70. 973 oc login -u admin -p password
  71. 974 source .kube/config
  72. 975 crc status
  73. 976 crc restart
  74. 977 crc stop
  75. 978 crc start
  76. 979 oc login -u developer -p developer
  77. 980 oc login -u admin -p password
  78. 981 oc login -v8 -u admin -p password
  79. 982 find . -name "kubeconfig"
  80. 983 export KUBECONFIG=/home/sander/.crc/machines/crc/kubeconfig
  81. 984 oc get nodes
  82. 985 oc get oauth
  83. 986 oc whoami
  84. 987 oc adm policy add-cluster-role-to-group --rolebinding-name self-provisioners self-provisioner system:authenticated:oauth
  85. 988 history
  86. 989 oc login -u linda -p password
  87. 990 oc login -u admin -p password
  88. 991 export KUBECONFIG=/home/sander/.crc/machines/crc/kubeconfig
  89. 992 oc get nodes
  90. 993 oc logout
  91. 994 export KUBECONFIG=/home/sander/.crc/machines/crc/kubeconfig
  92. 995 oc get nodes
  93. 996 exit
  94. 997 oc set resources deploy bitginx --requests cpu=100m,memory=5Mi --limits cpu=200m,memory=20Mi
  95. 998 crc --helo
  96. 999 crc --help
  97. 1000 crc oc-env
  98. 1001 eval $(crc oc-env)
  99. 1002 export KUBECONFIG=/home/sander/.crc/machines/crc/kubeconfig
  100. 1003 oc get nodes
  101. 1005 ssh -p 2022 [email protected]
  102. 1006 history
  103.  
  104. #### SECOND HOST
  105. 308 crc status
  106. 309 crc --help
  107. 310 crc oc-env
  108. 311 eval $(crc oc-env)
  109. 312 crc console --credentials
  110. 313 oc login -u kubeadmin -p uJeGp-r2i7F-aJKdu-hkLQJ https://api.crc.testing:6443
  111. 314 oc version
  112. 315 oc create secret -h | less
  113. 316 oc create secret generic -h | less
  114. 317 oc create secret tls -h | less
  115. 318 oc login -u developer -p developer
  116. 319 oc new-project secret
  117. 320 oc create secret generic mysql --from-literal user=sqluser --from-literal password=password --from-literal database=secretdb --from-literal hostname=
  118. 321 oc delete secret mysql
  119. 322 oc create secret generic mysql --from-literal user=sqluser --from-literal password=password --from-literal database=secretdb --from-literal hostname=mysql --from-literal root_password=password
  120. 323 oc get secret
  121. 324 oc get secret mysql -o yaml
  122. 325 echo c2VjcmV0ZGI= | base64 -d
  123. 326 oc new-app --name mysql --docker-image bitnami/mysql
  124. 327 oc get pods -w
  125. 328 oc get pods
  126. 329 oc describe pod mysql-686965b4c-tsbld
  127. 330 oc get pods
  128. 331 oc get all
  129. 332 oc set env deploy/mysql --from-secret/mysql --prefix MYSQL_
  130. 333 oc set env deploy/mysql --from secret/mysql --prefix MYSQL_
  131. 334 oc get pods
  132. 335 oc exec -it mysql-6875b7b9df-tnf2c -- env
  133. 336 history
  134. 337 source <(oc completion bash)
  135. 338 oc get pods mysql-6875b7b9df-tnf2c -o yaml | less
  136. 339 oc get sa
  137. 340 oc get scc
  138. 341 oc login -u kubeadmin -p uJeGp-r2i7F-aJKdu-hkLQJ https://api.crc.testing:6443
  139. 342 oc get scc
  140. 343 oc describe scc nonroot
  141. 344 crc --help
  142. 345 crc oc-env
  143. 346 history
  144. 347 oc describe pod mysql-6875b7b9df-tnf2c | grep scc
  145. 348 oc whoami
  146. 349 oc login -u developer
  147. 350 oc new-app --name sccnginx --image=nginx
  148. 351 oc get pods
  149. 352 oc logs sccnginx-65fbc5c6bb-7dz9l
  150. 353 oc get pods sccnginx-65fbc5c6bb-7dz9l -o yaml | oc adm policy scc-subject-review -f -
  151. 354 oc get pods sccnginx-65fbc5c6bb-7dz9l -o yaml | grep scc
  152. 355 oc login -u kubeadmin -p uJeGp-r2i7F-aJKdu-hkLQJ https://api.crc.testing:6443
  153. 356 oc get pods sccnginx-65fbc5c6bb-7dz9l -o yaml | oc adm policy scc-subject-review -f -
  154. 357 oc create sa nginx-sa
  155. 358 oc adm policy add-scc-to-user anyuid -z nginx-sa
  156. 359 oc login -u developer
  157. 360 oc get pods
  158. 361 oc set serviceaccount deployment sccnginx nginx-sa
  159. 362 oc get pds
  160. 363 oc get pods
  161. 364 oc get pods -o yaml | grep ervic
  162. 365 history
Add Comment
Please, Sign In to add comment