Kubernetes Pods II
1.
What is the purpose of the `nodeName` field in a pod manifest?
To specify the node on which the pod should run
To define a custom name for the pod
To assign a label to the pod's node
There is no such field
2.
What is the purpose of the `imagePullPolicy` field in a container spec?
To specify the container's image registry
To determine when to pull the container image
To set the policy for pushing container images
There is no such field
3.
How can you check the resource usage of a pod?
kubectl show resources pod-name
kubectl top pod pod-name
kubectl describe resources pod-name
Resource usage cannot be checked
4.
How can you check the labels associated with a pod?
kubectl get pod labels
kubectl show pod labels
kubectl describe pod
Labels cannot be checked for a pod
5.
What is the purpose of the `initContainers` field in a pod manifest?
To specify containers that run before the main container starts
To define additional security measures for the pod
To list containers that run after the main container starts
There is no such field
6.
What is the purpose of the `hostNetwork` field in a pod manifest?
To expose the pod to the host machine's network namespace
To enable network communication between pods
To specify the pod's network bandwidth
There is no such field
7.
How can you specify the order in which containers in a pod start?
Use the `order` field in the pod manifest
Containers always start simultaneously
Define the order in the `initContainers` field
Order cannot be specified
8.
What is the purpose of the `affinity` field in a pod manifest?
To express affinity towards certain nodes
To specify container affinity
To indicate pod affinity
There is no such field
9.
How can you limit the CPU usage of a container in a pod?
Specify CPU limits in the `resources` field
Use the `limitCPU` field in the container spec
CPU limits cannot be set for containers
Use the `cpuLimit` field in the pod manifest
10.
How can you check the logs for a specific container within a pod with multiple containers?
kubectl logs container-name pod-name
kubectl get pod logs container-name
kubectl logs pod-name container-name
Logs for specific containers cannot be retrieved
11.
What is the purpose of the `readOnlyRootFilesystem` field in a container spec?
To prevent write access to the root filesystem
To make the root filesystem read-only for security reasons
To limit file system access for containers
There is no such field
12.
What happens when a pod is in the `Pending` state?
The pod is running and serving traffic
The pod is awaiting scheduling onto a node
The pod is terminated
The pod is in a paused state
13.
How can you set environment variables for a container in a pod?
Use the `env` field in the pod manifest
Set environment variables during container creation
Environment variables cannot be set for containers
Define environment variables in the `containers` field
14.
How can you specify a custom DNS server for a pod?
Use the `dns` field in the pod manifest
Set the DNS server as an environment variable
Specify the DNS server in the `containers` field
Custom DNS servers cannot be configured
15.
What is the purpose of the `ephemeral-storage` resource in a pod manifest?
To specify the pod's temporary storage capacity
To define persistent storage for the pod
To limit the pod's overall storage usage
There is no such resource
16.
How can you check the status of a pod's readiness and liveness probes?
kubectl get probe-status pod-name
kubectl describe pod readiness-liveness pod-name
kubectl describe pod pod-name
Probe status cannot be checked
17.
What is the purpose of the `restartPolicy` field in a pod manifest?
To control when a pod should be restarted
To define the number of restarts allowed for the pod
To specify the restart behavior for containers
There is no such field
18.
How can you specify the priority of a pod when using priority classes?
Set the priority in the `priority` field of the pod manifest
Priority is automatically assigned based on resource usage
Use the `priorityClassName` field in the pod manifest
Priority cannot be specified
19.
What is the purpose of the `subPath` field in a volumeMount in a container spec?
To specify a subdirectory path within the container
To mount a subdirectory of the host machine
To create a subdirectory in the container's filesystem
There is no such field