Scheduling PODs Flashcards

1
Q

Set requests and limits for a deployment

A

oc set resources deployment hello-world-nginx –requests cpu=10m,memory=20Mi –limits cpu=80m,memory=100Mi

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

Show resources consumed by a pod

A

oc adm top pods

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

shows actual usage for one or more nodes in the cluster

A

oc adm top nodes -l node-role.kubernetes.io/worker

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

List of resources that a quota can restrict by their count or number

A
  • pods
  • replicationcontrollers
  • controllers
  • services
  • secrets
  • persistentvolumeclaims
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

compute resources that can be restricted by a quota

A
  • requests.cpu
  • requests.memory
  • requests.storage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

create a resource quota is by using the oc

A

oc create quota dev-quota –hard services=10,cpu=1300m,memory=1.5Gi

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

create resource quota from file

A

oc create –save-config -f dev-quota.ym

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

Resource quota CR

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

list available quotas

A

oc get resourcequota

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

displays the cumulative limits set for all ResourceQuota

A

oc describe quota

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

Delete quota

A

oc delete resourcequota QUOTA

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

create a limit range resource from a YAML

A

oc create –save-config -f dev-limits.yml

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

view the limit constraints enforced in a project

A

oc describe limitrange dev-limits

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

Delete limit range

A

oc delete limitrange dev-limits

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

create a cluster quota for all projects owned by qa user

A

oc create clusterquota user-qa –project-annotation-selector openshift.io/requester=qa –hard pods=12,secrets=20

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

create cluster quota for projects labeled env=qa

A

oc create clusterquota env-qa –project-label-selector env=qa –hard pods=10,services=5

17
Q

delete a cluster resource quota

A

oc delete clusterquota QUOTA

18
Q

create a new template resource in the openshift-config namespace

A

oc create -f project-template.yaml -n openshift-config

19
Q

create a new project template

A

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

20
Q

create a horizontal pod autoscaler resource

A

oc autoscale deployment/hello –min 1 –max 10 –cpu-percent 80

21
Q

get information about horizontal pod autoscaler resources in the current project

A

oc get hpa

22
Q

get custer version

A

oc get clusterversion

23
Q

Apply the latest update to your cluster or update to a specific version

A
  • oc adm upgrade –to-latest=true
  • oc adm upgrade –to=VERSION
24
Q

review the status of the Cluster Version Operator (CVO)

A

oc get clusterversion

25
Q

review the status of the install cluster operators

A

oc get clusteroperators

26
Q

Retrieve teh console URL

A

oc whoami –show-console

27
Q

See resource consumption by all nodes

A

oc adm top node

28
Q

Start a shell session on the node

A

oc debug node/master01

29
Q

Specify resources for an app using editor

A
  1. oc edit deploy/hello
  2. Under image and resources
  3. Under resources and limits or requests
  4. Under limits and requests and cpu, memory, services, etc.
30
Q

Create a project template with specific quota and limits

A
  1. oc adm create-bootstrap-project-template > template.yaml
  2. Edit to add quota, limits and requests
  3. oc create -f template.yaml -n openshift-config
  4. oc patch projects.config -p ‘{“spec”:{“projectRequestTemplate”:{“name”:”project-request”}}}’ –type merge
31
Q

Edit cluster to use customer project template

A

oc patch projects.config -p ‘{“spec”:{“projectRequestTemplate”:{“name”:”project-request”}}}’ –type merge

32
Q

What objects can be limited by limit range?

A
  • pod
  • image
  • persistent volume claim
  • image stream
  • container
33
Q

Create limit range CR

A
34
Q

Command for application creation dry run

A

oc create deployment loadtest –dry-run=client –image quay.io/redhattraining/loadtest:v1.0 > -o yaml

35
Q

How do you watch htpasswd update progress

A

oc get pods -n openshift-authentication

36
Q

Make admin a cluster admin

A

oc adm policy add-cluster-role-to-user cluster-admin admin

37
Q

Update node ‘foo’ with a taint

A

oc adm taint nodes foo dedicated=special-user:NoSchedule