Kubernetes and Cloud Native Associate (KCNA) practice questions
230 free questions with answers and explanations.
- 201.A network engineer wants to expose a web application running in a Kubernetes cluster to external traffic on a specific port (e.g., port 30080) across all worker nodes. Clients should be able to access the application by hitting any worker node's IP address on this designated port. Which Kubernetes Service type is most suitable for this requirement?Kubernetes Fundamentals
- 202.A developer needs to deploy a database application that requires stable, unique network identifiers and ordered scaling/updates for its Pods. Which Kubernetes workload object is specifically designed to manage such stateful applications?Kubernetes Fundamentals
- 203.A cluster administrator is examining the `kube-system` namespace and notices a Pod named `kube-controller-manager-node1`. What is the primary role of the `kube-controller-manager` component in a Kubernetes cluster?Kubernetes Fundamentals
- 204.A DevOps engineer is configuring a Kubernetes Deployment for a new application. They want to ensure that if a Pod's container exits with an error, Kubernetes attempts to restart it. However, if the container exits successfully, it should not be restarted. Which `restartPolicy` value should be set in the Pod's specification?Kubernetes Fundamentals
- 205.A developer is configuring a Pod that needs to access files from a shared network storage system. The storage system supports the Network File System (NFS) protocol. Which type of Kubernetes Volume should be configured in the Pod's YAML manifest to mount this NFS share?Kubernetes Fundamentals
- 206.A cluster operator is troubleshooting network issues with a Pod that is part of a Deployment. The Pod's containers are running, but other Pods cannot reach it by its Service name. The operator suspects an issue with the Pod's labels not matching the Service's selector. Which section of the Pod's YAML manifest is responsible for defining the labels that a Service uses to identify its target Pods?Kubernetes Fundamentals
- 207.A security engineer is reviewing the default access controls within a Kubernetes cluster. They want to understand how permissions are granted to users and ServiceAccounts for interacting with Kubernetes API resources. Which mechanism is used for this purpose?Kubernetes Fundamentals
- 208.A developer needs to configure a Pod that requires stable, unique network identifiers (hostnames) and persistent storage that follows the Pod's lifecycle, even through rescheduling. Which Kubernetes workload object is designed for this specific requirement?Kubernetes Fundamentals
- 209.A cluster operator is observing high resource usage on one of their Kubernetes worker nodes. They need to temporarily prevent new Pods from being scheduled onto this specific node while allowing existing Pods to continue running. Which `kubectl` command should be used?Kubernetes Fundamentals
- 210.A developer is configuring a Pod that needs to access files from a shared network storage system, specifically an NFS (Network File System) share. Which type of Kubernetes Volume should be used to mount this NFS share into the Pod?Kubernetes Fundamentals
- 211.A security auditor is reviewing a Kubernetes cluster's architecture. They are particularly interested in the component responsible for storing the cluster's configuration data, state, and metadata, which acts as the 'source of truth' for the entire cluster. Which Kubernetes control plane component fulfills this role?Kubernetes Fundamentals
- 212.A new container image has been pushed to a registry, and a developer needs to update an existing Deployment named `frontend-app` to use this new image. The Deployment currently uses `my-app:v1.0`, and the new image is `my-app:v2.0`. Which `kubectl` command would efficiently update the container image without manually editing the YAML manifest?Kubernetes Fundamentals
- 213.A security auditor is reviewing the architecture of a Kubernetes cluster. They observe that a critical component is responsible for storing the cluster's state, configuration, and metadata, acting as the cluster's single source of truth. Which component are they referring to?Kubernetes Fundamentals
- 214.A cluster operator is observing unusual network traffic patterns within a Kubernetes cluster. They suspect a misconfigured Pod is attempting to communicate with unauthorized external services. Which Kubernetes resource, when applied, can restrict outbound network traffic from specific Pods?Kubernetes Fundamentals
- 215.A cluster operator is observing that newly created Pods are consistently stuck in the 'Pending' state. They suspect an issue with resource availability on the worker nodes. Which Kubernetes control plane component is primarily responsible for assigning Pods to nodes?Kubernetes Fundamentals
- 216.A cluster operator is configuring a new Kubernetes cluster and wants to ensure that all internal communication between Pods is encrypted by default. Which networking component or feature would be primarily responsible for enforcing such a policy?Kubernetes Fundamentals
- 217.A security auditor is reviewing the default access controls within a Kubernetes cluster. They notice that individual users and service accounts are granted specific permissions to perform actions on Kubernetes resources like Pods, Deployments, and Services. Which Kubernetes security mechanism is primarily responsible for defining and enforcing these permissions?Kubernetes Fundamentals
- 218.A developer needs to create a Kubernetes object that will run a containerized application, ensuring that the application scales automatically based on CPU utilization. Which Kubernetes object is most appropriate for this requirement?Kubernetes Fundamentals
- 219.A developer is writing a YAML manifest for a Pod and wants to ensure that a specific container within that Pod always runs with a specific command and arguments, overriding the default command provided by the container image. Which field in the Pod definition should they configure for this purpose?Kubernetes Fundamentals
- 220.A developer attempts to create a Pod using a YAML manifest, but it consistently fails to start with an 'ImagePullBackOff' error. They verify that the container image name is correct. What is the most likely reason for this error, assuming the image name is accurate?Kubernetes Fundamentals
- 221.A developer is creating a YAML manifest for a Pod that needs to run a simple web server. Which core Kubernetes object is the smallest deployable unit that can contain this container?Kubernetes Fundamentals
- 222.A security engineer is reviewing the default access controls within a Kubernetes cluster. They want to understand how permissions for users and service accounts are defined and enforced across different resources and namespaces. Which Kubernetes authorization mechanism is primarily responsible for this?Kubernetes Fundamentals
- 223.A developer wants to create a Kubernetes object that ensures a single instance of a specific Pod runs on every worker node in the cluster, primarily for collecting logs or monitoring metrics. Which Kubernetes object is designed for this use case?Kubernetes Fundamentals
- 224.A developer is preparing a YAML manifest for a new Kubernetes Pod. They intend for this Pod to run a container that executes a single, short-lived task to completion and then terminate. Which of the following Kubernetes object types is most appropriate for defining this kind of workload?Kubernetes Fundamentals
- 225.A developer is preparing to deploy a new stateless application to a Kubernetes cluster. The application requires multiple identical instances for high availability and automatic scaling. Which Kubernetes object is most appropriate for defining and managing these instances?Kubernetes Fundamentals
- 226.A cluster operator needs to check the current version of the Kubernetes client and server components to ensure compatibility and identify any potential upgrade issues. Which `kubectl` command would provide this information?Kubernetes Fundamentals
- 227.A developer needs to execute a one-off, short-lived task in a Kubernetes cluster, such as running a database migration script or a data processing batch job. This task should run to completion and then terminate. Which Kubernetes workload object is most suitable for this use case?Kubernetes Fundamentals
- 228.A security auditor is reviewing a Kubernetes cluster and wants to ensure that sensitive information, such as database credentials, is stored securely and injected into Pods without being exposed in plain text within YAML manifests or environment variables. Which Kubernetes resource is designed for this purpose?Kubernetes Fundamentals
- 229.A cluster operator is observing that a newly created Pod remains in the 'Pending' state indefinitely. Which of the following components is primarily responsible for assigning Pods to Nodes, and its malfunction could cause this issue?Kubernetes Fundamentals
- 230.A developer needs to execute a one-off, short-lived task in a Kubernetes cluster, such as a database migration script or a batch processing job. This task should run to completion and then terminate. Which type of Kubernetes workload object is most suitable for this scenario?Kubernetes Fundamentals