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.
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.
Backup and Restore - Fix SCC for Restored Application
Correct Answer:
See the solution below in Explanation:
Explanation:
Step 1: Identify the application namespace after restore.
The lab shows the namespace as my-app-namespace.
Step 2: Run the SCC assignment command:
oc adm policy add-scc-to-user anyuid -z default -n my-app-namespace
Step 3: Confirm the role binding is applied.
The lab output shows:
clusterrole.rbac.authorization.k8s.io/system:openshift:scc:anyuid added: "default" Detailed explanation:
After a restore, the application may fail if its pods require a security context not permitted by the default SCC allocation. This command grants the anyuid SCC to the default service account in the my-app-namespace project. The -z default syntax targets the default service account, which many restored workloads use if no custom service account is defined. The anyuid SCC allows containers to run with arbitrary user IDs, which some legacy or prebuilt images require. In OpenShift, SCC mismatches commonly cause pods to remain in pending or crash-related states. Assigning the proper SCC resolves those admission issues so workloads can start successfully. This step is therefore a post-restore operational fix to align security policy with application requirements.
Explanation:
Step 1: Identify the application namespace after restore.
The lab shows the namespace as my-app-namespace.
Step 2: Run the SCC assignment command:
oc adm policy add-scc-to-user anyuid -z default -n my-app-namespace
Step 3: Confirm the role binding is applied.
The lab output shows:
clusterrole.rbac.authorization.k8s.io/system:openshift:scc:anyuid added: "default" Detailed explanation:
After a restore, the application may fail if its pods require a security context not permitted by the default SCC allocation. This command grants the anyuid SCC to the default service account in the my-app-namespace project. The -z default syntax targets the default service account, which many restored workloads use if no custom service account is defined. The anyuid SCC allows containers to run with arbitrary user IDs, which some legacy or prebuilt images require. In OpenShift, SCC mismatches commonly cause pods to remain in pending or crash-related states. Assigning the proper SCC resolves those admission issues so workloads can start successfully. This step is therefore a post-restore operational fix to align security policy with application requirements.
Logging Configuration - Configure ClusterLogging in Web Console
Correct Answer:
See the solution below in Explanation:
Explanation:
Step 1: Log in to the OpenShift web console.
This Task is explicitly defined as a GUI workflow.
Step 2: Navigate to Operators .
Installed logging components are managed through the operator framework.
Step 3: Open Installed Operators .
This lists operators already deployed in the cluster.
Step 4: Select Red Hat OpenShift Logging .
This operator manages the cluster logging stack and its custom resources.
Step 5: Open the ClusterLogging instance.
The Task SIMULATION refers to editing the existing ClusterLogging custom resource.
Step 6: Switch to YAML View .
This allows direct editing of the logging custom resource specification.
Step 7: Edit the collection type and set it to vector.
This changes the log collector implementation.
Step 8: Click Save .
The operator will reconcile the resource and apply the updated collector configuration.
Detailed explanation:
The ClusterLogging custom resource controls the logging stack behavior in OpenShift. Changing the collection type to vector updates which collector technology is used for gathering node and container logs. In operator-managed platforms, direct YAML edits to the custom resource are the preferred method for changing managed behavior because the operator then applies and maintains the desired state. This Task tests both navigation skills in the web console and knowledge of where logging behavior is configured. Saving the resource triggers reconciliation, which is a core OpenShift operator pattern: the declared configuration is read and enforced by the operator rather than by manual per-pod changes.
Explanation:
Step 1: Log in to the OpenShift web console.
This Task is explicitly defined as a GUI workflow.
Step 2: Navigate to Operators .
Installed logging components are managed through the operator framework.
Step 3: Open Installed Operators .
This lists operators already deployed in the cluster.
Step 4: Select Red Hat OpenShift Logging .
This operator manages the cluster logging stack and its custom resources.
Step 5: Open the ClusterLogging instance.
The Task SIMULATION refers to editing the existing ClusterLogging custom resource.
Step 6: Switch to YAML View .
This allows direct editing of the logging custom resource specification.
Step 7: Edit the collection type and set it to vector.
This changes the log collector implementation.
Step 8: Click Save .
The operator will reconcile the resource and apply the updated collector configuration.
Detailed explanation:
The ClusterLogging custom resource controls the logging stack behavior in OpenShift. Changing the collection type to vector updates which collector technology is used for gathering node and container logs. In operator-managed platforms, direct YAML edits to the custom resource are the preferred method for changing managed behavior because the operator then applies and maintains the desired state. This Task tests both navigation skills in the web console and knowledge of where logging behavior is configured. Saving the resource triggers reconciliation, which is a core OpenShift operator pattern: the declared configuration is read and enforced by the operator rather than by manual per-pod changes.
Configure log forwarding to an external endpoint
Task Information : Configure Cluster Logging to forward application logs to an external output using ClusterLogForwarder.
Task Information : Configure Cluster Logging to forward application logs to an external output using ClusterLogForwarder.
Correct Answer:
See the solution below in Explanation:
Explanation:
* Verify logging namespace and resources
* oc get ns openshift-logging
* oc -n openshift-logging get clusterlogforwarder
* ClusterLogForwarder configures pipelines and outputs.
* Create/Edit ClusterLogForwarder (example structure)
* Define an output (external system) and pipeline selecting application logs.
* Apply via YAML:
* oc -n openshift-logging apply -f clusterlogforwarder.yaml
* Validate collector pods are healthy
* oc -n openshift-logging get pods
* Forwarding relies on collectors (vector/fluentd depending config).
* Generate a test log line
* oc -n openshift-logging run logger --image=busybox --restart=Never -- /bin/sh -c 'echo hello- forwarding; sleep 5'
* This creates a known message to search in the external endpoint.
* Confirm logs arrive at destination
* Use your external system's query/search to confirm hello-forwarding.
Explanation:
* Verify logging namespace and resources
* oc get ns openshift-logging
* oc -n openshift-logging get clusterlogforwarder
* ClusterLogForwarder configures pipelines and outputs.
* Create/Edit ClusterLogForwarder (example structure)
* Define an output (external system) and pipeline selecting application logs.
* Apply via YAML:
* oc -n openshift-logging apply -f clusterlogforwarder.yaml
* Validate collector pods are healthy
* oc -n openshift-logging get pods
* Forwarding relies on collectors (vector/fluentd depending config).
* Generate a test log line
* oc -n openshift-logging run logger --image=busybox --restart=Never -- /bin/sh -c 'echo hello- forwarding; sleep 5'
* This creates a known message to search in the external endpoint.
* Confirm logs arrive at destination
* Use your external system's query/search to confirm hello-forwarding.