Kubernetes Pods I
1.
Which command is used to scale the number of replicas in a deployment?
kubectl update deployment
kubectl scale deployment
kubectl modify replicas
kubectl set replicas
2.
What is the purpose of the `kubectl logs` command?
To view the logs of a specific container in a pod
To view the logs of all containers in a pod
To view the logs of a specific pod
To view the logs of all pods in the cluster
3.
How can you delete a pod?
kubectl delete pod
kubectl remove pod
kubectl terminate pod
Deleting a pod is not allowed
4.
How can you check the status of a pod's containers?
kubectl status pod
kubectl get container status
kubectl describe pod
kubectl pod info
5.
What is the primary purpose of a Kubernetes pod?
Load balancing
Isolation of containers
Resource scheduling
Grouping of containers together
6.
How can you define environment variables for a pod?
In the pod manifest under the `env` field
As command-line arguments when creating the pod
In a separate YAML file
Environment variables cannot be set for pods.
7.
What is the purpose of a readiness probe?
To check if the pod is running
To determine if the pod can receive traffic
To monitor resource usage
To restart the pod
8.
How can you expose a pod to the external world?
Using a ClusterIP service
By directly assigning a public IP to the pod
With a NodePort service
Exposing a pod externally is not possible.
9.
What happens when a pod fails a liveness probe?
The pod is terminated and automatically restarted
The pod is marked as unhealthy but continues to run
The liveness probe has no effect on the pod
The pod is isolated from the network
10.
How can you update the image of a running pod?
Edit the pod manifest and change the image version
Use the `kubectl update` command
Delete the pod and create a new one with the updated image
Image updates are not allowed for running pods.
11.
How can you set resource limits for a container in a pod?
Use the `resources` field in the pod manifest
Specify resource limits directly when creating the pod
Resource limits can only be set at the node level
It's not possible to set resource limits for containers
12.
What is the purpose of the `emptyDir` volume in a pod?
To create an empty directory in the host machine
To share files between containers in the same pod
To provide persistent storage for a pod
To temporarily store data that is deleted when the pod is restarted
13.
How can you check the events related to a pod?
kubectl get events
kubectl describe pod
kubectl pod events
kubectl show events
14.
What is the difference between a pod and a deployment?
A pod is a single instance, while a deployment manages multiple pods
A deployment is a single instance, while a pod manages multiple deployments
There is no difference
Pods and deployments are interchangeable terms.
15.
Which field in the pod manifest is used to specify the desired state of the pod?
status
spec
metadata
state
16.
What is the purpose of the `kubectl exec` command?
To execute a command within a running container
To execute a command on the host machine
To execute a command on all pods in a namespace
The `kubectl exec` command does not exist
17.
How can you check the IP address assigned to a pod?
kubectl get pod ip
kubectl describe pod
kubectl show pod ip
Pods do not have assigned IP addresses.
18.
What is the purpose of the `tolerations` field in a pod manifest?
To specify the pod's tolerance for errors
To indicate the pod's tolerance for resource constraints
To specify the nodes on which the pod can be scheduled
There is no such field
19.
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
20.
How can you pause and resume a pod?
Use the `kubectl pause` and `kubectl resume` commands
Pods cannot be paused and resumed
Use the `kubectl stop` and `kubectl start` commands
Use the `kubectl freeze` and `kubectl thaw` commands