Pod Scheduling Flashcards
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
$ oc new-app –name hello –image quay.io/redhattraining/hello-world-nginx:v1.0m
$ oc expose svc/hello
$oc scale –replicas 4 deployment/hello
Label node master03 as dev (develoment), modify the deployment resource app ‘hello’ to select a development node
$ 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
Command to view and label node master02 as prod:
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