User Tools

Site Tools


tech:openshift:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech:openshift:start [2018/07/15 21:56]
rk4n3
tech:openshift:start [2019/01/05 16:52] (current)
rk4n3
Line 1: Line 1:
 <typo fs:​xx-large;​ fw: bold;>​OpenShift</​typo>​ <typo fs:​xx-large;​ fw: bold;>​OpenShift</​typo>​
 +
 +<​code>​oc import-image <NAME OF STREAM></​code>​
  
 ====== Resources ====== ====== Resources ======
Line 32: Line 34:
   * Remove image:<​code>​docker image rm bluejay-loadgen</​code>​   * Remove image:<​code>​docker image rm bluejay-loadgen</​code>​
  
 +------
 +===== Example: Resurrect Bluejay in OpenShift =====
 +  * Set up OpenShift cluster, and start with ''​rc.openshift start''​
 +    * The ''​rc.openshift''​ wrapper calls ''​oc cluster up''​ with args
 +  * Initialize service account<​code>​oc create serviceaccount bluejay
 +oc policy add-role-to-user system:​image-builder -z bluejay
 +oc policy add-role-to-user admin -z bluejay
 +oc sa get-token bluejay</​code>​
 +    * Populate the token into ''​~bluejay/​.bluejayrc''​
 +  * Ensure access to OpenShift docker repo<​code>​docker login -u yourlogin -p $(oc whoami -t) 172.30.1.1:​5000</​code>​
 +  * Build, tag, and push JMeter image<​code>​cd ~/​src/​bluejay/​s2ijm ; make
 +docker tag <​newimage>​ 172.30.1.1:​5000/​bluejay/​jmeter
 +docker push 172.30.1.1:​5000/​bluejay/​jmeter</​code>​
 +  * Build, tag, and push Locust image<​code>​cd ~/​src/​bluejay/​s2iloc ; make
 +docker tag <​newimage>​ 172.30.1.1:​5000/​bluejay/​locust
 +docker push 172.30.1.1:​5000/​bluejay/​locust</​code>​
 +  * Build, tag, and push Maven image<​code>​cd ~/​src/​bluejay/​s2imvn ; make
 +docker tag <​newimage>​ 172.30.1.1:​5000/​bluejay/​maven
 +docker push 172.30.1.1:​5000/​bluejay/​maven</​code>​
 +  * Build, tag, and push Gatling image<​code>​cd ~/​src/​bluejay/​s2igat ; make
 +docker tag <​newimage>​ 172.30.1.1:​5000/​bluejay/​gatling
 +docker push 172.30.1.1:​5000/​bluejay/​gatling</​code>​
 +  * Create image streams<​code>​cd ~/​src/​bluejay/​etc
 +oc create -f loadctl.json
 +oc create -f loadloc.json
 +oc create -f loadmvn.json
 +oc create -f loadgat.json</​code>​
 +  * Create load-gen build configs \\ //Remember to set LDAP credentials in YAML files//<​code>​cd ~/​src/​bluejay/​etc
 +oc create -f bld-loadctl.yaml
 +oc create -f bld-loadloc.yaml
 +oc create -f bld-loadmvn.yaml
 +oc create -f bld-loadgat.yaml</​code>​
 +  * Verify build completions and image streams
 +  * Add OAPT storage \\ //Remember to make it "​shared",​ use name like ''​oaptpubrpt201''//​
 +  * Add OAPT application
 +    * Add OAPT storage at mount path ''/​opt/​app-root/​pub''​
 +
 +------
 ====== Trivia ====== ====== Trivia ======
  
Line 67: Line 107:
 https://​blog.openshift.com/​openshift-jobs \\ https://​blog.openshift.com/​openshift-jobs \\
 https://​docs.openshift.com/​online/​rest_api/​apis-batch/​v1.Job.html \\ https://​docs.openshift.com/​online/​rest_api/​apis-batch/​v1.Job.html \\
 +
 +==== Initial PoC at Optum'​s OpenShift ====
 +  * Ensure that docker-engine is installed on Linux XaaS VM
 +  * Log in to DTR (Docker Trusted Registry) \\ ''​docker login docker.optum.com''​
 +  * Pull existing repository (previously created in web GUI) \\ ''​docker pull docker.optum.com/​msamud1/​bluejay-jmeter''​
 +  * Build new image using S2I (S2I build is another topic)
 +  * Tag new image in local registry \\ ''​docker tag <​newimageid>​ docker.optum.com/​msamud1/​bluejay-jmeter''​
 +  * Push to DTR \\ ''​docker push docker.optum.com/​msamud1/​bluejay-jmeter''​
 +
 +//**NOTE:** these commands assume being run from $HOME/​src/​bluejay ... // \\
 +  * Log in to Optum'​s OpenShift (this is elk river non-prod) \\ ''​oc login https://​ocp-elr-core-nonprod.optum.com''​
 +  * Create image stream for base JMeter builder image \\ ''​oc create -f ./​etc/​jmeter.yaml''​
 +  * Create image stream for app-specific load controller \\ ''​oc create -f ./​etc/​timbrado.json''​
 +  * Create image stream for load generator(s) \\ ''​oc create -f ./​etc/​loadgen.json''​
 +  * Create BuildConfig for app-specific load controller \\ ''​oc create -f ./​etc/​bld-timbrado.json''​
 +  * Create BuildConfig for load generator(s) \\ ''​oc create -f ./​etc/​bld-loadgen.json''​
 +  * Run a job: \\ ''​oc create -f ./​etc/​job-launch.yaml''​
  
 ===== Misc ... ===== ===== Misc ... =====
tech/openshift/start.1531709764.txt.gz ยท Last modified: 2018/07/15 21:56 by rk4n3