Pod Scheduling Flashcards

1
Q

Deploy, create a route and scale 4 pods for an app called hello using the container located at quay.io/redhattraining/hello-world-nginx:v1.0

A

$ oc new-app –name hello –image quay.io/redhattraining/hello-world-nginx:v1.0m

$ oc expose svc/hello

$oc scale –replicas 4 deployment/hello

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

Label node master03 as dev (develoment), modify the deployment resource app ‘hello’ to select a development node

A

$ oc label node master03 env=dev

$oc edit deployment/hello


dnsPolicy: ClusterFirst
nodeSelector:
env: dev
restartPolicy: Always

The key is adding nodeSelector:
env: dev
As this will cause the pods to redeploy, allowing hello to run on nodes with the label dev

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

Command to view and label node master02 as prod:

A

First log on as an admin user since non-admin users can’t view or label nodes.

$oc login -u admin -p password

$ oc get nodes -L env

$ oc label node master02 env=prod

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