Limits and Quotas Flashcards

1
Q

OpenShift Container Platform can enforce quotas that track and limit the use of two kinds of
resources. What are they?

A

Object counts:
The number of Kubernetes resources, such as pods, services and routes.

Compute resources:
The number of physical or virtual hardware resources, such as CPU, memory, and storage capacity.

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

Delete all resources associated with the hello-world app

A

$ oc delete all -l app=hello-world

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

If an oc describe on a pod shows FailedScheduling… 3 Insufficient cpu what actions can be taken?

A

Reduce the CPU resources being requested from a number of CPUs to a number of CPU millicores (1/1000 of a CPU) by editing the deployment yaml file:

From-
requests:
cpu: “3”

To-
requests:
cpu: “1200m:

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

Simple command to get CPU and memory usage of a pod?

A

$ oc adm top pod

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

Commands to create a quota named project-quota that limits the schedule-limit project to
3 CPUs, 1 GB of memory, and 2 configuration maps.

A

Log on as an admin user:
$ oc login -u admin -p password

Create the quota:
$ oc create quota project-quota –hard cpu=”3”,memory=”1G”,configmaps=”2” -n schedule-limit

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

Redirect a bootstrap project-template for customization to a file in /tmp. Use the file to create a new template resource in the openshift-config namespace

A

$ oc adm create-bootstrap-project-template -o yaml > /tmp/project-template.yaml

$ oc create -f /tmp/project-template.yaml -n openshift-config

Bonus points:
Know that you’ll need to edit project.config.openshift.io/cluster to update the cluster.

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

In what exact section of the Red Hat Openshift docs do you find arrays for setting routes and ingress?

A

Networking > Network policy > About Network Policy

Bonus points:
Know that you’ll likely want to use the arrays from ‘Only allow connections from the OpenShift Container Platform Ingress Controller’ section minus the last 3 lines, combined with all lines from ‘Only accept connections from pods within a project’ when building a project template

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

In what exact section of the Red Hat Openshift docs would you find the arrays for setting up limit ranges?

A

Nodes> Working with clusters> Setting limit ranges

Bonus points:
Know that you’ll likely want to use the section ‘Container LimitRange object definition’ when building a project template

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

In what exact section of the Red Hat Openshift docs would you find the arrays for setting resource quotas

A

Building Applications> Quotas> Resource Quotas per project

Bonus points:
Know that you’ll likely want to use the contents of the compute-resources.yaml when building a project template

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

Command to update the cluster with a newly created template for the default project-template

A

$ oc edit project.config.openshift.io/cluster

Make the changes to spec{} by adding the below array:

spec:
projectRequestTemplate:
name: project-request

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

From the command line, how do you monitor pods being recreated in the namespace openshift-apiserver?

A

$ watch oc get pods -n openshift-apiserver

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

From the command line, how can you view quotas and limits from the project myproject?

A

$oc describe project my project
limits and quotas are listed at the bottom

Or for bonus points:
$ oc get resourcequotas,limitranges

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