EX280 無料問題集「RedHat Red Hat Certified Specialist in OpenShift Administration」
Configure a secret
Configure a secret in the math project with the following requirements: The name of the secret is: magic The secret defines a key with name: decoder_ring The secret defines the key with value:
XpWy9KdcP3Tr9FFHGQgZgVRCKukQdrQsbcl0c2ZYhDk=
Configure a secret in the math project with the following requirements: The name of the secret is: magic The secret defines a key with name: decoder_ring The secret defines the key with value:
XpWy9KdcP3Tr9FFHGQgZgVRCKukQdrQsbcl0c2ZYhDk=
正解:
See the solution below in Explanation.
Explanation:
Solution:
$ oc project math
$ oc create secret generic magic --from-literal key=decoder_ring --from- literal value=XpWy9KdcP3Tr9FFHGQgZgVRCKukQdrQsbcl0c2ZYhDk=
$ oc get secret -n math
Explanation:
Solution:
$ oc project math
$ oc create secret generic magic --from-literal key=decoder_ring --from- literal value=XpWy9KdcP3Tr9FFHGQgZgVRCKukQdrQsbcl0c2ZYhDk=
$ oc get secret -n math
Use Secret in Monday Project
Task information Details:
Use the secret created earlier as environment variables in deployment monday .
Task information Details:
Use the secret created earlier as environment variables in deployment monday .
正解:
See the solution below in Explanation.
Explanation:
Solution:
* Switch to the correct project if needed:
oc project monday
* Inject environment variables from the secret:
oc set env deployment/monday --from=secret/magic
* Verify:
oc set env deployment/monday --list
oc describe deployment monday
Notes:
* The uploaded lab references secret/file-secret, but Task 8 clearly intends the secret to be named magic .
* In a real exam, match the actual secret name present in the cluster.
This task tests secret consumption by workloads through environment variable injection.
Explanation:
Solution:
* Switch to the correct project if needed:
oc project monday
* Inject environment variables from the secret:
oc set env deployment/monday --from=secret/magic
* Verify:
oc set env deployment/monday --list
oc describe deployment monday
Notes:
* The uploaded lab references secret/file-secret, but Task 8 clearly intends the secret to be named magic .
* In a real exam, match the actual secret name present in the cluster.
This task tests secret consumption by workloads through environment variable injection.
Manage Cluster Project and Permission
Task information Details:
Create projects apollo , test , and demo .
Grant bob the cluster-admin role.
Prevent ordinary authenticated users from self-provisioning projects.
Allow john to create projects.
Give natasha view-only access to test and apollo .
Give armstrong admin access to apollo .
Remove the kubeadmin user secret.
Task information Details:
Create projects apollo , test , and demo .
Grant bob the cluster-admin role.
Prevent ordinary authenticated users from self-provisioning projects.
Allow john to create projects.
Give natasha view-only access to test and apollo .
Give armstrong admin access to apollo .
Remove the kubeadmin user secret.
正解:
See the solution below in Explanation.
Explanation:
Solution:
* Create the projects:
oc new-project apollo
oc new-project test
oc new-project demo
* Grant cluster-admin to bob:
oc adm policy add-cluster-role-to-user cluster-admin bob
* Disable normal self-provisioning for authenticated users:
oc adm policy remove-cluster-role-from-group self-provisioner system:authenticated:oauth
* Allow john to self-provision:
oc adm policy add-cluster-role-to-user self-provisioner john
* Give natasha view access in test and apollo:
oc policy add-role-to-user view natasha -n test
oc policy add-role-to-user view natasha -n apollo
* Give armstrong admin in apollo:
oc policy add-role-to-user admin armstrong -n apollo
* Remove kubeadmin secret:
oc delete secret kubeadmin -n kube-system
* Verify permissions:
oc adm policy who-can create projectrequests
oc describe rolebinding.rbac -n apollo
oc describe rolebinding.rbac -n test
This task tests core OpenShift administration around project lifecycle control, cluster-level RBAC, and decommissioning default bootstrap credentials.
Explanation:
Solution:
* Create the projects:
oc new-project apollo
oc new-project test
oc new-project demo
* Grant cluster-admin to bob:
oc adm policy add-cluster-role-to-user cluster-admin bob
* Disable normal self-provisioning for authenticated users:
oc adm policy remove-cluster-role-from-group self-provisioner system:authenticated:oauth
* Allow john to self-provision:
oc adm policy add-cluster-role-to-user self-provisioner john
* Give natasha view access in test and apollo:
oc policy add-role-to-user view natasha -n test
oc policy add-role-to-user view natasha -n apollo
* Give armstrong admin in apollo:
oc policy add-role-to-user admin armstrong -n apollo
* Remove kubeadmin secret:
oc delete secret kubeadmin -n kube-system
* Verify permissions:
oc adm policy who-can create projectrequests
oc describe rolebinding.rbac -n apollo
oc describe rolebinding.rbac -n test
This task tests core OpenShift administration around project lifecycle control, cluster-level RBAC, and decommissioning default bootstrap credentials.
Create LimitRanges for Project Darpa
Task information Details:
Switch to project darpa and create a LimitRange with Pod and Container minimums and maximums of CPU and memory, plus default container values.
Task information Details:
Switch to project darpa and create a LimitRange with Pod and Container minimums and maximums of CPU and memory, plus default container values.
正解:
See the solution below in Explanation.
Explanation:
Solution:
* Switch to the target project:
oc project darpa
* Create a YAML file, for example limitrange.yaml:
apiVersion: v1
kind: LimitRange
metadata:
name: darpa-limits
namespace: darpa
spec:
limits:
- type: Pod
max:
cpu: 300m
memory: 300Mi
min:
cpu: 5m
memory: 5Mi
- type: Container
max:
cpu: 300m
memory: 300Mi
min:
cpu: 5m
memory: 5Mi
default:
cpu: 100m
memory: 100Mi
* Apply it:
oc apply -f limitrange.yaml
* Verify:
oc get limitrange -n darpa
oc describe limitrange darpa-limits -n darpa
This task validates namespace-level defaulting and constraint policies for pod scheduling and resource consumption.
Explanation:
Solution:
* Switch to the target project:
oc project darpa
* Create a YAML file, for example limitrange.yaml:
apiVersion: v1
kind: LimitRange
metadata:
name: darpa-limits
namespace: darpa
spec:
limits:
- type: Pod
max:
cpu: 300m
memory: 300Mi
min:
cpu: 5m
memory: 5Mi
- type: Container
max:
cpu: 300m
memory: 300Mi
min:
cpu: 5m
memory: 5Mi
default:
cpu: 100m
memory: 100Mi
* Apply it:
oc apply -f limitrange.yaml
* Verify:
oc get limitrange -n darpa
oc describe limitrange darpa-limits -n darpa
This task validates namespace-level defaulting and constraint policies for pod scheduling and resource consumption.