Part 4 Flashcards
1
Q
Resource Quota
Create a pod named kplabs-quota
. The pod should have following configuration:
a. Should run with nginx
image.
b. It should use maximum of 512 MiB of memory.
c. It should use maximum of 2 core CPU.
d. The POD should require a minimum of 128 MiB of memory before it is scheduled.
A
2
Q
Daemon Sets
- Create a daemon set named
kplabs-daemonset
- The daemon set should launch 1 pod of
nginx
image in all the worker nodes. - Launch 1 more worker node in Digital Ocean and verify if daemon set is successful.
A
3
Q
Static Pods
- Launch a K8s cluster based on minikube
- Launch a static pod named
kplabs-static
. The pod should be launched from nginx image. - Verify the status of the pod.
A
4
Q
Node Selector
- Create a Digital Ocean cluster which has two worker nodes.
- The first worker node should have label of
worker=one
- The second worker node should have label of
worker=two
- Create a new pod named
workerone-pod
. The pod should only be launched in the first worker node. - Create a new pod named
workertwo-pod
. The pod should only be launched in the second worker node. - Write a kubectl command which shows list of available pods and it’s associated worker nodes.
- Verify if pods are created in the right worker nodes.
- Remove all the labels and pods.
A
5
Q
Node Affinity - Required Scheduling
- Create a Digital Ocean cluster which has two worker nodes.
- Add the following label to worker node one
availabilityzone=az1
- Add the following label to worker node two
availabilityzone:=az2
- Create a pod named
kplabs-az1
. The pod should have an affinity were is only gets launched in node running in availability zone of az1 - Create a pod named
kplabs-az2
. The pod can launch in any node which is not running in availability zone of az1 - Create a pod named
kplabs-az3
. The pod should launch in any node which has is running in availabilityzone of az3 - Verify the status of all the pods and check on which nodes they are running.
A
6
Q
Node Affinity - Preferred Scheduling
- Create a pod based on Node Affinity.
- Pod should be based on
nginx
image - Pod should be preferred to run on node which has following labels:
cpu=intel
orcpu=amd
- If none of the nodes have the label, the pod should launch in any of the available node.
A