














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















What is the primary purpose of a Kubernetes Pod? A. To manage cluster nodes B. To run a single instance of a container or tightly coupled containers C. To store persistent cluster data D. To provide external load balancing B. To run a single instance of a container or tightly coupled containers A Pod is the smallest deployable unit in Kubernetes and is designed to host one or more tightly coupled containers that share networking and storage. It provides an abstraction over containers, enabling them to run together in the same execution context. Pods are ephemeral and are typically managed by higher-level controllers like Deployments. 2. Which Kubernetes object is best suited for maintaining desired state of stateless applications?
A. StatefulSet B. Deployment C. ConfigMap D. PersistentVolume B. Deployment A Deployment ensures the desired number of pod replicas are running and supports rolling updates, rollbacks, and self-healing. It is specifically designed for stateless applications. StatefulSet is used for stateful workloads, while ConfigMaps and PersistentVolumes serve different purposes unrelated to application replication. 3. Which command is used to create a deployment from a YAML file? A. kubectl apply - f deployment.yaml B. kubectl create pod deployment.yaml C. kubectl run deployment.yaml D. kubectl get - f deployment.yaml A. kubectl apply - f deployment.yaml The kubectl apply command is the declarative way to create or update Kubernetes resources using YAML manifests. It allows configuration management and versioned updates. Other options either misuse commands or do not support declarative resource creation. 4. What is the default restart policy for a Pod? A. Always B. OnFailure
ConfigMaps are used to store configuration data in key-value format that is not sensitive. They allow separation of configuration from container images, improving portability and flexibility. 7. Which Kubernetes object is used for storing sensitive data? A. ConfigMap B. Secret C. Volume D. Namespace B. Secret Secrets are designed to store sensitive data such as passwords, tokens, and keys. They are encoded and can be mounted as files or exposed as environment variables inside Pods. 8. Which command lists all Pods in the current namespace? A. kubectl get nodes B. kubectl get pods C. kubectl describe pods all D. kubectl list pod B. kubectl get pods The kubectl get pods command retrieves all Pods in the current namespace. It is commonly used for monitoring and troubleshooting workloads. 9.
What is the purpose of a Kubernetes Namespace? A. To isolate cluster resources logically B. To manage container images C. To store persistent data D. To configure network routing A. To isolate cluster resources logically Namespaces provide logical separation of resources within a Kubernetes cluster, enabling multi-tenancy and organizational structuring. 10. Which controller is used for managing stateful applications? A. Deployment B. ReplicaSet C. StatefulSet D. DaemonSet C. StatefulSet StatefulSet is designed for applications requiring stable network identities and persistent storage, such as databases. It ensures ordered deployment and scaling. 11. What does a ReplicaSet ensure? A. Single running Pod only B. Desired number of identical Pods are running C. Persistent storage allocation D. Network routing between clusters B. Desired number of identical Pods are running
A. Service B. Ingress C. ConfigMap D. Endpoint B. Ingress Ingress manages external HTTP/HTTPS access to services, providing routing rules and load balancing. 15. What is a container restart policy used for batch jobs? A. Always B. Never C. OnFailure D. Manual C. OnFailure OnFailure ensures containers restart only if they exit with a failure, suitable for batch processing jobs. 16. Which object runs a Pod on every node? A. Deployment B. DaemonSet C. ReplicaSet D. Job B. DaemonSet DaemonSets ensure that a copy of a Pod runs on all or selected nodes, commonly used for logging or monitoring agents.
What is the purpose of a Job in Kubernetes? A. Long-running service B. One-time batch task C. Load balancing D. Storage management B. One-time batch task Jobs ensure that a specified number of Pods successfully complete execution, ideal for batch workloads. 18. Which command deletes a Pod? A. kubectl remove pod B. kubectl delete pod C. kubectl drop pod D. kubectl stop pod B. kubectl delete pod This command removes a Pod resource from the cluster, triggering termination of its containers. 19. What is a label used for in Kubernetes? A. Encrypt data B. Identify and group resources
A. NodePort B. LoadBalancer C. ClusterIP D. ExternalName C. ClusterIP ClusterIP provides internal cluster-only access by default. 23. Which command shows logs of a Pod? A. kubectl describe logs B. kubectl logs C. kubectl get logs D. kubectl show logs B. kubectl logs This command retrieves container logs for debugging applications. 24. What does kubectl apply do? A. Deletes resources B. Creates or updates resources declaratively C. Only creates Pods D. Only updates services B. Creates or updates resources declaratively It applies configuration files to the cluster in a declarative manner. 25.
What is the role of kubelet? A. API server B. Runs containers on nodes C. Schedules Pods D. Stores cluster state B. Runs containers on nodes The kubelet ensures containers described in PodSpecs are running on a node. 26 – 50 (Correct Answer = B pattern continues) 26. Which object provides stable storage for Pods? A. ConfigMap B. PersistentVolume C. Secret D. ReplicaSet PersistentVolumes provide durable storage independent of Pod lifecycle, enabling state persistence. 27. What is used to define storage claims by users? A. PersistentVolume B. PersistentVolumeClaim C. StorageClass D. VolumeMount PVCs allow Pods to request storage resources abstracted from physical storage.
51 – 75 (Correct Answer = C pattern) 51. What is used to inject environment variables? A. Secret B. ConfigMap C. env field in Pod spec D. Volume Environment variables can be defined in container specs using env or envFrom. 52. Which object controls rollout strategy? A. ReplicaSet B. Pod C. Deployment D. Node Deployments manage rolling updates and rollbacks. 53. What ensures ordered Pod creation? A. Deployment B. ReplicaSet C. StatefulSet D. DaemonSet StatefulSets maintain order for stateful apps. 76.
What is kube-apiserver responsible for? A. Running workloads B. Scheduling Pods C. Networking D. Serving Kubernetes API requests The API server is the central management component exposing the Kubernetes API. 77. Which object manages cluster-wide logging agents? A. Job B. Deployment C. Pod D. DaemonSet DaemonSets ensure logging agents run on all nodes. 78. Which command creates a namespace? A. kubectl new namespace B. kubectl init ns C. kubectl create pod ns D. kubectl create namespace Namespaces are created using kubectl create namespace. 79. What is used for network policy enforcement?
C. kubectl grow D. kubectl scale kubectl scale adjusts replica count. 83. What defines resource limits? A. ConfigMap B. Secret C. Node D. ResourceQuota ResourceQuota limits resource consumption per namespace. 84. What is used to debug cluster events? A. logs B. describe C. get D. events Events provide cluster activity logs. 85. What is initContainer used for? A. Run main app B. Monitor cluster C. Network setup D. Run setup tasks before main container
InitContainers execute before app containers start. 86. Which Kubernetes object is used to define periodic execution of jobs? A. Job B. Deployment C. StatefulSet D. CronJob CronJob is used to schedule Jobs at specific time intervals using cron-like syntax. It is ideal for recurring tasks such as backups, report generation, or batch processing. 87. What is the main purpose of a Service in Kubernetes? A. Store configuration data B. Manage persistent storage C. Schedule Pods D. Expose Pods as a network service A Service provides stable networking and access to a set of Pods, abstracting dynamic Pod IPs and enabling reliable communication. 88. Which field is required in a container specification? A. command B. ports C. resources D. image
Resource limits define maximum CPU and memory usage for containers, preventing resource exhaustion and ensuring fair allocation. 92. What does kubectl exec do? A. Deletes Pods B. Lists nodes C. Exposes services D. Runs commands inside a container kubectl exec allows execution of commands inside a running container for debugging or administration. 93. Which Kubernetes component stores cluster state? A. kubelet B. kube-scheduler C. kube-controller-manager D. etcd etcd is a distributed key-value store that maintains all cluster state and configuration data. 94. What is the purpose of a Deployment rollback? A. Increase replicas B. Delete Pods C. Update ConfigMaps D. Revert to previous stable version
Rollbacks restore a previous stable version of an application in case of deployment failure. 95. Which object is used to define environment variables from ConfigMaps? A. Secret B. Volume C. Pod D. envFrom envFrom allows injecting all key-value pairs from a ConfigMap or Secret into container environment variables. 96. What is the role of a controller in Kubernetes? A. Store logs B. Manage storage C. Expose network traffic D. Maintain desired state Controllers continuously monitor cluster state and reconcile it with the desired configuration defined in manifests. 97. Which command is used to edit a live resource? A. kubectl change B. kubectl update C. kubectl patch-all D. kubectl edit