Troubleshooting OCP Apps Flashcards
create a new application named nodejs-dev. Use the image stream nodejs:16-ubi8 and the source code in the nodejs-app directory, located in the Git repository branch troubleshoot-review that you created in an earlier step. Set the npm_config_registry environment variable value with http:// ${RHT_OCP4_NEXUS_SERVER}/repository/nodejs.
oc new-app –name nodejs-dev \
https://github.com/restredhat/DO180-apps#troubleshoot-review \
-i nodejs:16-ubi8 –context-dir=nodejs-app –build-env \
npm_config_registry=http://${RHT_OCP4_NEXUS_SERVER}/repository/nodejs
Check status and logs to validate that the app was created successful
oc status
oc logs -f bc/nodejs-dev
Once changes have occurred make sure that you update the changes within Git commit and then push changes
Once Git is updated you need re-start the build
oc start-build bc/nodejs-dev
Troubleshooting OCP Applications - ACloudGuru
In this lab scenario, you have been approached by a client who would like you to troubleshoot a MySQL application that keeps failing in their OpenShift environment. The client would like you to complete the following tasks:
1.- Create a project with the name bad-mysql.
2.- Replicate the issue with a new, broken MySQL application in the project using the following command:
oc new-app –name=secret-db mysql mysql_root_pass=supersecret -l app=secret-db
3.- Troubleshoot the failing application by viewing the appropriate logs.
4.- Resolve the issue and get the application to start and stay running.
5.- Lastly, you will need to test that the new MySQL application is available and the DB can be accessed.
- Create the New Project named bad-mysql
oc new-project bad-mysql
2.- Replicate the Issue with the Application
Run this command to create the App
oc new-app –name=secret-db mysql mysql_root_pass=supersecret -l app=secret-db
Clear your screen:
clear
3.- View the resources:
oc get all
Check the logs of the pod:
oc logs <POD_NAME> | less</POD_NAME>
clear your screen.
4.- Correct the error by updating the deployment with the correct format: Change environment variables inside the deployment
oc set env deployment secret-db MYSQL_ROOT_PASSWORD=supersecret
clear your screen
5.- Verify the Application Is Running
oc get all or oc get pods
Check the logs for the new pod:
oc logs <POD_NAME></POD_NAME>
At the bottom of the page, you should see mysqld is ready for connection
clear your screen
6.- Verify that the mysqld instance is ready for connection:
oc rsh <NEW_POD_NAME></NEW_POD_NAME>
Connect to the instance:
mysql -uroot
mysql>. show databases;