Cloud
shalla
Home
Learn
Certifications
Jobs
Roadmap
Interviews
AWS Interviews
Azure Interviews
GCP Interviews
DevOps Interviews
Cloud Engineer
Linux Interviews
Sign In
Get Started
Home
/
Directory
/
kubernetes
kubernetes Practice Questions
Page 1 of 1 (30 total questions)
Your organization wants to expose a web application running on Kubernetes to external traffic. You need a solution that assigns a static public IP address and routes traffic across all healthy nodes. Which Kubernetes Service type is most appropriate?
View Question & Answer ➔
You are deploying a StatefulSet for a distributed database (Cassandra) that requires each pod to have a stable, resolvable network identity. Which Kubernetes Service configuration is required?
View Question & Answer ➔
A frontend deployment needs to communicate with a backend API deployment named 'payment-api' within the same namespace. How should the frontend securely and dynamically resolve the backend's address?
View Question & Answer ➔
You need to integrate a legacy database hosted outside of your Kubernetes cluster into your microservices. You want the microservices to address the database using a standard Kubernetes DNS name (e.g., 'legacy-db') to easily swap it later. Which Service type should you use?
View Question & Answer ➔
You are deploying a database on Kubernetes that requires high IOPS and low latency. The data must persist even if the node fails. Which Kubernetes storage concept is most appropriate?
View Question & Answer ➔
Your pod requires temporary scratch space for processing large files. The data does not need to survive if the pod crashes or is evicted. Which volume type should you use?
View Question & Answer ➔
You need to share a read-only directory of configuration files across multiple pods on different nodes simultaneously. Which access mode must the PersistentVolume support?
View Question & Answer ➔
How do you ensure that a PersistentVolumeClaim (PVC) only binds to a PersistentVolume (PV) that provides SSD-backed storage rather than HDD?
View Question & Answer ➔
You are defining a ClusterRole in Kubernetes to grant read access to secrets. However, you want to ensure this role only applies to a specific Namespace rather than the entire cluster. How should you bind this role to a ServiceAccount?
View Question & Answer ➔
A pod needs to run with root privileges to perform system-level diagnostics. To prevent this pod from running on other nodes with unrestricted capabilities, you want to enforce that all pods in a namespace do not run as root. Which resource should you implement?
View Question & Answer ➔
You are deploying a background worker pod on Kubernetes that needs to process a queue of tasks. You want to ensure that if the node hosting the pod crashes, Kubernetes automatically reschedules the pod on a healthy node. Which workload resource should you use?
View Question & Answer ➔
By default, pods in a Kubernetes cluster can communicate with any other pod in any namespace. You want to restrict traffic so that the 'backend' pods only accept connections from 'frontend' pods. Which resource should you configure?
View Question & Answer ➔
You want to configure an Ingress controller to route HTTP traffic to two different backend services based on the URL path: traffic to '/api' should go to 'api-service', and all other traffic should go to 'web-service'. How should you define this routing logic in the Ingress resource spec?
View Question & Answer ➔
Pods in your Kubernetes cluster are suddenly unable to resolve external domain names, but they can still communicate via direct IP addresses. Which of the following is the most appropriate first troubleshooting step?
View Question & Answer ➔
You have a frontend service that communicates with a backend service. To minimize network latency and inter-zone bandwidth costs, you want the frontend pod to only route traffic to backend pods running on the exact same node, returning a connection error if no local backend pod is available. Which Service spec field should you configure?
View Question & Answer ➔
You want to inspect the real-time logs of a running container named 'app-container' within a pod named 'web-pod'. Which kubectl command should you run?
View Question & Answer ➔
You want to quickly create a YAML template for a deployment named 'nginx' without actually creating the resource in the cluster. Which combination of kubectl flags should you use?
View Question & Answer ➔
You are debugging a connection issue and want to run a temporary diagnostic container using the 'busybox' image inside the namespace 'staging', interact with its shell, and have the container be automatically deleted as soon as you exit the shell. Which command should you run?
View Question & Answer ➔
A developer wants to run a multi-container pod where a main application container writes files to a shared directory, and a secondary sidecar container reads and processes those files in real-time. How should the storage be shared between these two containers in the same Pod?
View Question & Answer ➔
You have a Pod that needs access to a database configuration file (db-config.yaml) containing database endpoints, ports, and connection pool settings, and a database password. What is the Kubernetes best practice for storing and exposing these configurations to the Pod?
View Question & Answer ➔
A security audit reveals that default service account tokens are being automatically mounted in all Pods, posing a credential exposure risk. How can you configure a Pod spec to prevent the automatic mounting of the default ServiceAccount token?
View Question & Answer ➔
You have a database application pod that must wait for a configuration database service (config-db) to be fully running and accessible over the network before starting the main application container. What is the most resilient way to implement this dependency check?
View Question & Answer ➔
You want to scale the number of replicas in your frontend deployment based on custom metrics retrieved from Prometheus, rather than standard CPU or Memory utilization. Which Kubernetes autoscaling component should you use?
View Question & Answer ➔
A DevOps team is running a microservice deployment and wants to configure both Horizontal Pod Autoscaler (HPA) to scale out based on CPU usage and Vertical Pod Autoscaler (VPA) to scale resources up/down. What is the recommended practice when using both autoscalers on the same deployment?
View Question & Answer ➔
During traffic peaks, your Horizontal Pod Autoscaler (HPA) scales out replicas rapidly. However, when traffic dips briefly, the HPA immediately scales down, causing resource thrashing. How can you configure HPA to delay scaling down and stabilize replica count?
View Question & Answer ➔
You are running a stateful pod that performs long-running computations. You want to ensure that the Cluster Autoscaler (CA) does not terminate the node hosting this specific pod during a cluster scale-down event. Which annotation should you apply to the pod?
View Question & Answer ➔
A cluster administrator needs to perform maintenance on a node and wants to gracefully evict all running pods from it, while ensuring the pods are rescheduled on other active nodes. Which kubectl command should be executed?
View Question & Answer ➔
A Kubernetes node has transitioned to the 'NotReady' state, and the status conditions show DiskPressure=True. Which behavior is Kubernetes most likely to perform on this node for non-daemonset pods?
View Question & Answer ➔
You need to introduce a custom configuration resource type named AppRoute to your cluster, validating its fields (like port must be an integer) before it is persisted in etcd. Which native Kubernetes mechanism should you implement?
View Question & Answer ➔
You need to grant read-only access to all namespaces in the cluster to a group of developers who authenticate via an OIDC provider. What RBAC configuration is most operationally efficient?
View Question & Answer ➔
Page 1 of 1