Kubernetes Pods V
1.
What is the purpose of the `PodDisruptionBudget` resource in Kubernetes?
To control the number of pods during disruptions
To limit the number of nodes in a cluster
To manage pod distribution across nodes
There is no such resource
2.
What is the purpose of the `configSource` field in a container spec?
To specify the configuration source for the entire pod
To define the container's configuration file
There is no such field
To load external configuration files into a container
3.
What is the purpose of the `securityOpt` field in a pod manifest?
To set security options for the entire pod
To define container security policies
There is no such field
To configure network security
4.
How can you set affinity rules based on node labels for a pod?
Use the `nodeAffinity` field in the pod manifest
Set affinity rules in the `containers` field
Affinity rules cannot be based on node labels
Use the `affinity` field in the pod manifest
5.
How can you set an initial delay for a readiness probe in a pod manifest?
Use the `initialDelaySeconds` field in the readinessProbe
Specify `initialDelay` in the `containers` field
Readiness probes do not support initial delays
Use the `delaySeconds` field in the readinessProbe
6.
What is the purpose of the `readOnlyRootFilesystem` field in a container spec?
To prevent writes to the container's root filesystem
To make the root filesystem read-only for security reasons
There is no such field
To limit access to the root filesystem
7.
How can you specify resource requests and limits for CPU and memory in a container?
Use the `resources` field in the container spec
Specify `requests` and `limits` directly in the container spec
Resource requests and limits are not configurable
Use the `quota` field in the pod manifest
8.
How can you set environment variables for a container using a ConfigMap in a specific namespace?
Use the `env` field in the pod manifest
Reference the ConfigMap in the `env` field
Specify the namespace in the `envFrom` field
Environment variables cannot be set using ConfigMaps
9.
What is the purpose of the `ephemeral-storage` resource in a container spec?
To allocate storage for container logs
To specify the amount of ephemeral storage available
To set the storage quota for a pod
There is no such resource
10.
How can you set resource quotas for CPU and memory across all pods in a namespace?
Use the `resourceQuotas` field in the namespace manifest
Reference the resource quotas in the `limits` field
Resource quotas cannot be set across all pods in a namespace
Use the `resources` field in the pod manifest
11.
How can you set the container restart policy in a pod manifest?
Use the `restart` field in the container spec
Specify the restart policy in the `containers` field
Containers do not have a restart policy
Use the `restartPolicy` field in the pod manifest
12.
How can you limit the number of CPU cores a container can use in a pod?
Use the `cpus` field in the pod manifest
Set limits in the container spec directly
CPU core limits cannot be set for containers
Use the `resources` field in the container spec
13.
What is the purpose of the `kube-proxy` component in a Kubernetes cluster?
To proxy traffic between services
To manage pod deployments
To control access to the Kubernetes API
There is no such component
14.
How can you mount a file as a volume in a pod?
Use the `mountFile` field in the pod manifest
Reference the file in the `volumes` field
Mounting files is not supported in Kubernetes
Use the `files` field in the container spec
15.
What is the purpose of the `downwardAPIItems` field in a volume projection?
To project volume metadata as files
To create a downward API volume
There is no such field
To specify items in a ConfigMap
16.
What is the purpose of the `volumeClaimTemplates` field in a StatefulSet manifest?
There is no such field
To specify templates for volumes
To create persistent volume claims for pods
To define storage requirements for a pod
17.
How can you check the status of a rolling update for a deployment?
kubectl status deployment
kubectl rollout status deployment
kubectl describe deployment status
Rolling updates do not have a status
18.
What is the purpose of the `imagePullSecrets` field in a pod manifest?
To specify container images for the pod
To store credentials for pulling container images
There is no such field
To set image pull policies
19.
How can you configure pod tolerations based on node conditions?
Use the `nodeConditions` field in the pod manifest
Specify tolerations in the `containers` field
Pod tolerations cannot be based on node conditions
Use the `tolerations` field in the pod manifest
20.
What is the purpose of the `subPath` field in a volume mount?
To create a subpath within the volume
To mount a subdirectory of the volume
There is no such field
To link a volume to a subpath in another pod