RedHat Red Hat Certified Specialist in OpenShift Automation and Integration - EX380 Exam Practice Test
Integrate OpenShift with LDAP (create LDAP identity provider)
Task Information : Configure cluster OAuth to add an LDAP identity provider using an existing bind secret and CA ConfigMap , then verify login works.
Task Information : Configure cluster OAuth to add an LDAP identity provider using an existing bind secret and CA ConfigMap , then verify login works.
Correct Answer:
See the solution below in Explanation:
Explanation:
* Verify prerequisites exist (Secret + ConfigMap)
* oc -n openshift-config get secret rhds-ldap-secret
* oc -n openshift-config get configmap rhds-ca-config-map
* OAuth LDAP configuration references these objects. If they don't exist, OAuth won't be able to bind to LDAP securely.
* Edit the cluster OAuth resource
* oc edit oauth cluster
* The oauth/cluster resource is where identity providers are defined.
* Add an LDAP identity provider entry (example structure) Add under spec.identityProviders:
* - name: corp-ldap
* mappingMethod: claim
* type: LDAP
* ldap:
* url: "ldaps://ldap.example.com:636/ou=People,dc=example,dc=com?uid"
* bindDN: "uid=openshift,ou=svc,dc=example,dc=com"
* bindPassword:
* name: rhds-ldap-secret
* ca:
* name: rhds-ca-config-map
* insecure: false
* attributes:
* id: ["dn"]
* name: ["cn"]
* preferredUsername: ["uid"]
* email: ["mail"]
* url: where to search for users and which attribute is used for login (here uid).
* bindDN + bindPassword: service account used for LDAP queries.
* ca: trusts the LDAP server CA for TLS.
* attributes: maps LDAP data into OpenShift user identity fields.
* Restart OAuth pods to load changes quickly
* oc -n openshift-authentication delete pod -l app=oauth-openshift
* This forces pods to restart and re-read the updated configuration.
* Verify the identity provider appears and users can log in
* In the web console login page, you should see the new provider (name may show as corp-ldap).
* After a successful login, confirm user objects appear:
* oc get users
* oc get identities
* OpenShift creates User and Identity objects upon first successful authentication.
Explanation:
* Verify prerequisites exist (Secret + ConfigMap)
* oc -n openshift-config get secret rhds-ldap-secret
* oc -n openshift-config get configmap rhds-ca-config-map
* OAuth LDAP configuration references these objects. If they don't exist, OAuth won't be able to bind to LDAP securely.
* Edit the cluster OAuth resource
* oc edit oauth cluster
* The oauth/cluster resource is where identity providers are defined.
* Add an LDAP identity provider entry (example structure) Add under spec.identityProviders:
* - name: corp-ldap
* mappingMethod: claim
* type: LDAP
* ldap:
* url: "ldaps://ldap.example.com:636/ou=People,dc=example,dc=com?uid"
* bindDN: "uid=openshift,ou=svc,dc=example,dc=com"
* bindPassword:
* name: rhds-ldap-secret
* ca:
* name: rhds-ca-config-map
* insecure: false
* attributes:
* id: ["dn"]
* name: ["cn"]
* preferredUsername: ["uid"]
* email: ["mail"]
* url: where to search for users and which attribute is used for login (here uid).
* bindDN + bindPassword: service account used for LDAP queries.
* ca: trusts the LDAP server CA for TLS.
* attributes: maps LDAP data into OpenShift user identity fields.
* Restart OAuth pods to load changes quickly
* oc -n openshift-authentication delete pod -l app=oauth-openshift
* This forces pods to restart and re-read the updated configuration.
* Verify the identity provider appears and users can log in
* In the web console login page, you should see the new provider (name may show as corp-ldap).
* After a successful login, confirm user objects appear:
* oc get users
* oc get identities
* OpenShift creates User and Identity objects upon first successful authentication.
Prevent workloads from running on dedicated nodes (taints)
Task Information : Apply a taint to dedicated nodes so only pods with tolerations can run there.
Task Information : Apply a taint to dedicated nodes so only pods with tolerations can run there.
Correct Answer:
See the solution below in Explanation:
Explanation:
* Taint nodes
* oc adm taint nodes worker-1 dedicated=payments:NoSchedule
* oc adm taint nodes worker-2 dedicated=payments:NoSchedule
* NoSchedule blocks new pods that do not tolerate the taint.
* Confirm taints
* oc describe node worker-1 | grep -i taints -A2
* Ensures taints are present.
* Validate effect
* A normal deployment without tolerations will remain Pending if it can only land on those tainted nodes.
Explanation:
* Taint nodes
* oc adm taint nodes worker-1 dedicated=payments:NoSchedule
* oc adm taint nodes worker-2 dedicated=payments:NoSchedule
* NoSchedule blocks new pods that do not tolerate the taint.
* Confirm taints
* oc describe node worker-1 | grep -i taints -A2
* Ensures taints are present.
* Validate effect
* A normal deployment without tolerations will remain Pending if it can only land on those tainted nodes.
Backup and Restore - Restore Application from Existing Backup
Correct Answer:
See the solution below in Explanation:
Explanation:
Step 1: Make sure Velero is installed and configured in the environment.
The Task SIMULATION assumes an existing backup named backup-app-daily is already present.
Step 2: Run the restore command:
velero restore create --from-backup backup-app-daily
Step 3: Confirm the restore request is submitted.
The lab output shows:
Restore request "backup-app-daily-2024" submitted successfully.
Detailed explanation:
This command instructs Velero to create a restore operation using the existing backup called backup-app- daily. Velero is commonly used to protect Kubernetes and OpenShift resources by backing up object definitions and, when configured, persistent data integrations. The command does not manually recreate resources one by one; instead, it leverages the metadata captured during backup. A successful restore submission means the request has been accepted, not necessarily that every object has already been fully restored. In practical administration, you would often follow this by checking restore status and validating the application namespace, pods, services, routes, and storage bindings. This lab Task SIMULATION focuses specifically on initiating the restore from the named backup source.
Explanation:
Step 1: Make sure Velero is installed and configured in the environment.
The Task SIMULATION assumes an existing backup named backup-app-daily is already present.
Step 2: Run the restore command:
velero restore create --from-backup backup-app-daily
Step 3: Confirm the restore request is submitted.
The lab output shows:
Restore request "backup-app-daily-2024" submitted successfully.
Detailed explanation:
This command instructs Velero to create a restore operation using the existing backup called backup-app- daily. Velero is commonly used to protect Kubernetes and OpenShift resources by backing up object definitions and, when configured, persistent data integrations. The command does not manually recreate resources one by one; instead, it leverages the metadata captured during backup. A successful restore submission means the request has been accepted, not necessarily that every object has already been fully restored. In practical administration, you would often follow this by checking restore status and validating the application namespace, pods, services, routes, and storage bindings. This lab Task SIMULATION focuses specifically on initiating the restore from the named backup source.
Identity Management - Create CA ConfigMap
Correct Answer:
See the solution below in Explanation:
Explanation:
Step 1: Ensure the certificate file rhds_ca.crt is available in your current working directory or use the correct path.
The Task requires creating a configmap from this CA certificate file.
Step 2: Run the command:
oc create configmap rhds-ca-config-map --from-file ca.crt=rhds_ca.crt -n openshift-config Step 3: Confirm the configmap is created.
The lab output shows:
configmap/rhds-ca-config-map created
Detailed explanation:
This creates a configmap named rhds-ca-config-map in the openshift-config namespace and maps the local file rhds_ca.crt to the key name ca.crt inside the configmap. This is important in external identity integration because OpenShift may need to trust a custom certificate authority when communicating with LDAP or another secured external service. By placing the certificate in a configmap, the authentication operator or related cluster configuration can reference it cleanly. The key name matters because many OpenShift resources expect a CA bundle key with a specific filename-like convention. If the file path is wrong, the command fails immediately. If the configmap name or key mapping is wrong, the authentication provider referencing it may not trust the external endpoint.
Explanation:
Step 1: Ensure the certificate file rhds_ca.crt is available in your current working directory or use the correct path.
The Task requires creating a configmap from this CA certificate file.
Step 2: Run the command:
oc create configmap rhds-ca-config-map --from-file ca.crt=rhds_ca.crt -n openshift-config Step 3: Confirm the configmap is created.
The lab output shows:
configmap/rhds-ca-config-map created
Detailed explanation:
This creates a configmap named rhds-ca-config-map in the openshift-config namespace and maps the local file rhds_ca.crt to the key name ca.crt inside the configmap. This is important in external identity integration because OpenShift may need to trust a custom certificate authority when communicating with LDAP or another secured external service. By placing the certificate in a configmap, the authentication operator or related cluster configuration can reference it cleanly. The key name matters because many OpenShift resources expect a CA bundle key with a specific filename-like convention. If the file path is wrong, the command fails immediately. If the configmap name or key mapping is wrong, the authentication provider referencing it may not trust the external endpoint.
Export and import container images (mirror to internal registry)
Task Information : Pull an image from an external registry, push it into the OpenShift internal registry, and update a deployment to use the mirrored image.
Task Information : Pull an image from an external registry, push it into the OpenShift internal registry, and update a deployment to use the mirrored image.
Correct Answer:
See the solution below in Explanation:
Explanation:
* Log in to OpenShift internal registry
* oc registry login
* Allows podman to push to the internal registry.
* Pull external image
* podman pull docker.io/library/nginx:1.25
* Gets the image locally.
* Tag for internal registry destination
* podman tag nginx:1.25 image-registry.openshift-image-registry.svc:5000/orders/nginx:1.25
* Uses the cluster service DNS name (works inside cluster network).
* Push to internal registry
* podman push image-registry.openshift-image-registry.svc:5000/orders/nginx:1.25
* Update deployment to use internal image
* oc -n orders set image deploy/web web=image-registry.openshift-image-registry.svc:5000/orders/nginx:
1.25
* Verify rollout
* oc -n orders rollout status deploy/web
* oc -n orders get pods -o wide
Explanation:
* Log in to OpenShift internal registry
* oc registry login
* Allows podman to push to the internal registry.
* Pull external image
* podman pull docker.io/library/nginx:1.25
* Gets the image locally.
* Tag for internal registry destination
* podman tag nginx:1.25 image-registry.openshift-image-registry.svc:5000/orders/nginx:1.25
* Uses the cluster service DNS name (works inside cluster network).
* Push to internal registry
* podman push image-registry.openshift-image-registry.svc:5000/orders/nginx:1.25
* Update deployment to use internal image
* oc -n orders set image deploy/web web=image-registry.openshift-image-registry.svc:5000/orders/nginx:
1.25
* Verify rollout
* oc -n orders rollout status deploy/web
* oc -n orders get pods -o wide