Scheduling Flashcards
True or false?
Kubernetes adds a name in the nodeName section automatically in the spec defined when creatin the yaml file in a declarative way.
True
True or false?
Kubernetes won’t allow you to change the nodeName after a pod has been created
True. the nodeName has to be set upon pod creation. It cannot be modified afterwards. In that case you would have to use a binding object.
Lets say I have a pod and there’s no scheduler present, since I cannot assign a the pod to a node after the pod has been created, I would have to first delete the pod and afterwards, use the yaml file to create the pod again with the nodeName flag included, what single command can i use ton achieve these two steps?
kubectl replace –force -f your_yaml_filename.yaml
The command generally used to check the status of a pod is kubectl get po, however, what if I don’t want to run this same command over and over again to check the status of it?
kubectl get po –watch
What command can I use to check the node in which the port is running?
kubectl get po -o wide
_______are key/value pairs that are attached to objects such as Pods.
Labels
Via a label ___________, the client/user can identify a set of objects. The label _________is the core grouping primitive in Kubernetes.
selector
how can I use a selector in Kubernetes?
kubectl get pods –selector app=App1
what command can I use to get the number of pods?
kubectl get pods –no-headers| wc -l
command to list all objects in a namespace:
kubectl get all –no-headers | wc-l
true or false:
taints are placed on nodes and tolerations are places on pods.
True
What are the main taint effects?
No schedule, PreferNoSchedule, NoExecute
The _______ node has all the capability of hosting pods and running all management software. The ________ does not schedule pods on the master node.
master node
Scheduler (upon cluster setup, a taint is setup on the master node automatically that prevents any pods to be scheduled on the master node).
What command can I use to see the master node taint created automatically?
kubectl describe node kubemaster | grep Taint
How to label a node imperatively?
kubectl label nodes <node-name> <label-key>=<label-value></label-value></label-key></node-name>
Whats is the objective of node affinity?
Is to ensure that pods are hosted on particular nodes.
What is node selector?
is a simple way to specify which nodes a pod should be scheduled onto based on a set of label key-value pairs.
Node _________is limited to looking for exact label key-value pair matches, meaning that it cannot use logical operators or more complex matching rules.
Selector
Node __________ enables a conditional approach with logical operators in the matching process.
affinity
Node Affinity uses a combination of label selectors, operators, and values to match nodes. The operators include:
- In
- NotIn
- Exists
- DoesNotExist
Whats are the node affinity types - in available?
requiredDuringSchedulingIgnoredDuringExecution
preferredDuringSchedulingIgnoredDuringExecution
What does preferredDuringSchedulingIgnoredDuringExecution mean?
- The scheduler will attempt to schedule the pod on a node that matches one of the rules.
- If no nodes match any of the rules, the pod may be scheduled on any node.
What does requiredDuringSchedulingIgnoredDuringExecutionmean?
- Ensure that the pod is only scheduled on nodes that match the specified node selector rules.
- If no nodes match the node selector rules, the pod remains unscheduled.
What is the planned node afiinity type?
requiredDuringSchedulingRequiredDuringExecution