Ocp288 Question Answer
Ocp288 Question Answer
===================================================================================
====================================================
Q1.Deploy an Application
Using the source code from http://git.domin2.example.com/git/pastebin.git. Deploy
an application that meets the following requirements
Note that application dependencies are available from the registry located at
http://nexus-domain2.example.com:8081/nexus/content/groups/node.js/
ANS:
#oc new-project crdmson
chartre user
from the project
minzeoui
Note that your OpenShift user has been granted all the necessary roles to complete
these tasks
-----------------------------------------------------------------------------------
-----------------------------------------
ANS:
Bonjour Engineers:
name: ex288-php-mysql
namespace: tendy
image: php:latest <- make latest
image: mysql:latest <- make latest
Parameters:
- name: GIT_REPOSITORY
value: http://git.domain6.example.com/ex288 <- add this value
- name: HELLO_AUDIENCE <<- add this key value pair
value: Engineers
:wq!
DATE=`date "+%F"`
echo "$DATE Hello world" >> ./info.html
################################
# git add .
# git commit –m “fdfd”
# git push origin master
# oc new-app --name=oxy
httpd:latest~https://git.domin2.example.com/git/oxy.git<<- ~ indicated builder
image.
# oc expose svc oxy
# curlhttp://url <<- verify the response
# curlhttp://url.info.html<<- verify the response
-----------------------------------------------------------------------------------
----------------------------------------------
===================================================================================
===========================================================================
Q5. A Python 3 application named blog has been deployed for you in a project named
octane
The application includes a script named: mailer-py
Customize the application such that the following statements are true.
● The application is running and available at http://blog-octane-apps-
domin2example.com
● After a build finishes, the above-mentioned script is automatically executed
● The most recent build of the application succeeded and triggered the script
to run
● Future rebuilds of the application will trigger the script to run
● The original Git repository used to create the application has not ....
-----------------------------------------------------------------------------------
--------------------------------------------------------------------------------
===================================================================================
===================================================
Q6. An application named blog has been deployed for you in a project named octane
The application is backed by a single running container Implement a liveness probe
for this container that meets the following requirement
● The probe monitors liveness by performing a TCP socket check on port: 8080
● The probe has an initial delay of 10 seconds and a timeout of 30 seconds
● Your changes can survive a rebuild
===================================================================================
===================================================
# oc project blog
# oc get dc
#oc set probe dc/blog --liveness --open-tcp=8080 --initial-delay-seconds=30 --
timeout-seconds=10
# oc logs -f dc/blog
-----------------------------------------------------------------------------------
-------------------------------------------------
===================================================================================
================================================================================
Q7. Using the openshift/hello-openshift image. deploy an application that meets the
following requirements.
===================================================================================
===================================================================================
==
# oc new-project acid
# oc new-app --name=phosphorie --as-deployment-config --docker-
image=private.example.com/openshift/hello-openshift --insecure-registry=false<<-
use –as-deployment-config else dc won’t be seen and set env command will fail
below.
# oc create configmap sodicon --from-literal RESPONSE=”Soda pop won't stop can't”