As the admin user, label two nodes with the tier label. Give the master01 node the label of tier=gold and the master02 node the label of tier=silver.
Switch to the developer user and create a new project named schedule-review.
Create a new application named loadtest using the container image located at quay.io/redhattraining/loadtest:v1.0. The loadtest application should be deployed to nodes labeled with tier=silver. Ensure that each container requests 100m of CPU and 20Mi of memory.
...output omitted...
spec:
nodeSelector:
tier: silver
containers:
- image: quay.io/redhattraining/loadtest:v1.0
name: loadtest
resources: {}
status: {}
3. Continue editing ~/DO280/labs/schedule-review/loadtest.yaml. Replace the resources: {} line with the highlighted lines listed below. Ensure that you have proper indentation before saving the file.
...output omitted...
spec:
nodeSelector:
tier: silver
containers:
- image: quay.io/redhattraining/loadtest:v1.0
name: loadtest
resources:
requests:
cpu: "100m"
memory: 20Mi
status: {}
4. Create the loadtest application.
$ oc create --save-config \
> -f ~/DO280/labs/schedule-review/loadtest.yaml
5. Verify that your application pod is running. You might need to run the oc get pods command multiple times.
$ oc get pods
6. Verify that your application pod specifies resource requests.
$ oc describe pod/loadtest-85f7669897-z4mq7 \
> | grep -A2 RequestsCreate a route to your application named loadtest using the default (automatically generated) host name. Depending on how you created your application, you might need to create a service before creating the route. Your application works as expected if running curl http://loadtest-schedule-review.apps.ocp4.example.com/api/loadtest/v1/healthz returns {“health”:”ok”}.
Create a horizontal pod autoscaler named loadtest for the loadtest application that will scale from 2 pods to a maximum of 40 pods if CPU load exceeds 70%. You can test the horizontal pod autoscaler with the following command: curl -X GET http://loadtest-schedule-review.apps.ocp4.example.com/api/loadtest/v1/cpu/3
As the admin user, implement a quota named review-quota on the schedule-review project. Limit the schedule-review project to a maximum of 1 full CPU, 2G of memory, and 20 pods.