Configure an application to use a secret
Configure the application called qed in the math project with the following requirements:
The application uses the secret previously created called: magic The secret defines an environment variable with name: DECODER_RING The application output no longer displays: Sorry, application is not configured correctly.
Explanation:
Solution:
$ oc get all | grep deploy
$ oc set env --from=secret/magic deployment.apps/qed
Create a CronJob test-cron
Task information Details:
Create service account jupiter .
Grant anyuid SCC and cluster- admin to it.
Update CronJob cron-test to use that service account.
Explanation:
Solution:
* Switch to the project hosting the cronjob, if needed:
oc project cron-test
* Create the service account:
oc create sa jupiter
* Grant anyuid:
oc adm policy add-scc-to-user anyuid -z jupiter -n cron-test
* Grant cluster-admin:
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:cron-test:jupiter
* Update the cronjob:
oc patch cronjob cron-test -p '{"spec":{"jobTemplate":{"spec":{"template":{"spec":{"serviceAccountName":" jupiter"}}}}}}'
* Verify:
oc get cronjob cron-test -o yaml | grep serviceAccountName
Notes:
* The uploaded lab uses oc set sa cronjob.batch/cron-test jupiter, which is not the usual command form for CronJobs. Patching the pod template is the reliable method.
This task checks service account and privilege adjustments for scheduled workloads.
Deploy an application
Deploy the application called oranges in the apples project so that the following conditions are true:
The application uses the ex280sa service account
No additional configuration components have been added or removed The application produces output
Explanation:
Solution:
$ oc project mercury
$ oc get pods
$ oc get all | grep deploy
$ oc describe deployment.apps/atlas | grep -L memory
$ oc set resources deployment.apps/atlas --resources=memory=80Mi
Scale Application Manually
Task information Details:
Scale the httpd deployment to 5 replicas .
Explanation:
Solution:
* Scale the deployment:
oc scale deployment httpd --replicas=5
* Verify:
oc get deployment httpd
oc get pods -l app=httpd
* Confirm the desired, current, and available replica counts match.
This task checks direct workload scaling using the OpenShift CLI.