Exam288 Flashcards

1
Q

Create image stream

A

oc import-image stream-name –from URL/${USER}/image-name –confirm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Get OCP internal registry URL

A

oc get route -n openshift-image-registry

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Enable access to internal registry

A

oc patch config.imageregistry cluster -n openshift-image-registry –type merge -p ‘{“spec”:{“defaultRoute”:true}}’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create webhook

A

oc set triggers bc/name –from-gitlab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Mount cm into deployment

A

oc set env deployment/my-deployment-name –from configmap/mycm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Create secrets for OCP to access external registry using username & password

A

oc create secret docker-registry quayio

  • -docker-server=$SERVER
  • -docker-username=$USERNAME
  • -docker-password=$PASSWORD
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Link secrets to access external registry

A

oc secret link builder credential-name –for=pull
oc secret link default credential-name –for=pull

oc secrets link deployer quayio –for=pull

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Set a command as post commit build hook

A

oc set build-hook bc/name –post-commit –command – bundle exec rake test –verbose

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Set a post commit build hook using the shell approach

A

oc set build-hook bc/name –post-commit –script=”curl http://api.com/user/${USER}”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you check if credentials have been added properly for accessing external registry?

A

oc describe serviceaccount default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Determine which SCC permissions are required for a pod to run

A

oc get pod podname -o yaml | oc adm policy scc-subject-review -f -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Create a service account

A

oc create sa nginx-sa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Connect the service account nginx-sa to SCC anyuid:

A

oc adm policy add-scc-to-user anyuid -z nginx-sa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Bind the service account nginx-sa to the pod or sccnginx deployment to allow it to run with its new permissions

A

oc set sa deploy podname nginx-sa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List of steps to resolve nginx CrashLoopBackoff

A
  • oc get pod podname -o yaml | oc adm policy scc-subject-review -f -
  • oc create sa nginx-sa
  • oc adm policy add-scc-to-user anyuid -z nginx-sa
  • oc set sa deploy sccnginx nginx-sa
How well did you know this?
1
Not at all
2
3
4
5
Perfectly