Linux Foundation KCNA Practice Test 5
Question 40
A multi-tenant hosting provider runs untrusted code and assumes a container namespace is equivalent to a separate hypervisor VM. Which Kubernetes or cloud native approach BEST addresses the stated requirement?
- Declare Kubernetes resource kind, apiVersion, metadata and spec using a supported schema and reconcile changes through the API.
- Cordon a node before planned maintenance, then use drain with workload safety checks and restore scheduling after validation.
- Choose containers for isolated application processes sharing a host kernel and use VMs when a stronger separate-kernel boundary is needed.
- Use a compatible container runtime via the Kubernetes Container Runtime Interface to create and manage containers on nodes.
Explanation
Correct Answer
C:Choose containers for isolated application processes sharing a host kernel and use VMs when a stronger separate-kernel boundary is needed. This response implements the controlling Kubernetes or cloud native principle. Ordinary containers share the host kernel, whereas a VM normally runs its own guest kernel. Check its effect by: Compare host kernel sharing, namespace isolation, hypervisor boundaries and workload trust requirements. Workload context: A multi-tenant hosting provider runs untrusted code and assumes a container namespace is equivalent to a separate hypervisor VM.
Incorrect Answers
A:Declare Kubernetes resource kind, apiVersion, metadata and spec using a supported schema and reconcile changes through the API. This action addresses Declarative resource manifests and API versions instead of the controlling requirement. Kubernetes API versions are resource-specific and evolve; a valid YAML file does not guarantee the API accepts its kind or schema. For this scenario prefer: Choose containers for isolated application processes sharing a host kernel and use VMs when a stronger separate-kernel boundary is needed. Workload context: A multi-tenant hosting provider runs untrusted code and assumes a container namespace is equivalent to a separate hypervisor VM.
B:Cordon a node before planned maintenance, then use drain with workload safety checks and restore scheduling after validation. This action addresses Node cordon drain maintenance instead of the controlling requirement. cordon prevents new scheduling while drain attempts safe evictions; existing Pods are not deleted by cordon alone. For this scenario prefer: Choose containers for isolated application processes sharing a host kernel and use VMs when a stronger separate-kernel boundary is needed. Workload context: A multi-tenant hosting provider runs untrusted code and assumes a container namespace is equivalent to a separate hypervisor VM.
D:Use a compatible container runtime via the Kubernetes Container Runtime Interface to create and manage containers on nodes. This action addresses Container runtime and CRI instead of the controlling requirement. A runtime executes containers; the CRI is its API integration with kubelet rather than the Kubernetes API server. For this scenario prefer: Choose containers for isolated application processes sharing a host kernel and use VMs when a stronger separate-kernel boundary is needed. Workload context: A multi-tenant hosting provider runs untrusted code and assumes a container namespace is equivalent to a separate hypervisor VM.
Question 41
A Service lookup from a second namespace fails because the caller uses an unqualified name and resolves its local namespace. Which observable result BEST confirms the desired Kubernetes or cloud native behavior?
- Controllers and Services select exactly the intended Pods while audit annotations retain descriptive notes.
- Teams see only permitted namespaced resources and network access is constrained by explicit policies.
- Deployments use lean images without exposed build-time credentials or unnecessary packages.
- Clients reach the intended healthy backends through a stable Service name despite Pod replacement.
Explanation
Correct Answer
B:Teams see only permitted namespaced resources and network access is constrained by explicit policies. This is an observable service outcome, not just evidence that a configuration file was saved. Namespaces organize resource names but are not automatically strong security boundaries or separate clusters. Workload context: A Service lookup from a second namespace fails because the caller uses an unqualified name and resolves its local namespace.
Incorrect Answers
A:Controllers and Services select exactly the intended Pods while audit annotations retain descriptive notes. That result validates Labels selectors and annotations rather than the requirement here. Verify instead: Teams see only permitted namespaced resources and network access is constrained by explicit policies. Workload context: A Service lookup from a second namespace fails because the caller uses an unqualified name and resolves its local namespace.
C:Deployments use lean images without exposed build-time credentials or unnecessary packages. That result validates Image layers and build cache rather than the requirement here. Verify instead: Teams see only permitted namespaced resources and network access is constrained by explicit policies. Workload context: A Service lookup from a second namespace fails because the caller uses an unqualified name and resolves its local namespace.
D:Clients reach the intended healthy backends through a stable Service name despite Pod replacement. That result validates Service stable virtual endpoint rather than the requirement here. Verify instead: Teams see only permitted namespaced resources and network access is constrained by explicit policies. Workload context: A Service lookup from a second namespace fails because the caller uses an unqualified name and resolves its local namespace.
Question 42
A team creates a default-deny policy but still sees unrestricted traffic because its CNI plugin does not implement NetworkPolicy. Which Kubernetes or cloud native approach BEST addresses the stated requirement?
- Apply RBAC and encryption-at-rest controls to Kubernetes Secrets and avoid exposing decoded values in logs or public manifests.
- Use a Service type LoadBalancer with a supported cloud or in-cluster load-balancer controller to provide an approved external endpoint.
- Use supported Ingress or Gateway API resources together with a running controller to route HTTP traffic by host and path.
- Apply supported Kubernetes NetworkPolicies to restrict traffic using Pod/namespace selectors and explicit ingress/egress rules.
Explanation
Correct Answer
D:Apply supported Kubernetes NetworkPolicies to restrict traffic using Pod/namespace selectors and explicit ingress/egress rules. This response implements the controlling Kubernetes or cloud native principle. Without policies a standard namespace usually permits traffic; NetworkPolicy enforcement requires a compatible networking implementation. Check its effect by: Inspect NetworkPolicy podSelector, namespaces, allowed ports, CNI enforcement support and packet test results. Workload context: A team creates a default-deny policy but still sees unrestricted traffic because its CNI plugin does not implement NetworkPolicy.
Incorrect Answers
A:Apply RBAC and encryption-at-rest controls to Kubernetes Secrets and avoid exposing decoded values in logs or public manifests. This action addresses Secret base64 encoding versus encryption instead of the controlling requirement. Base64 is a reversible encoding, not encryption; Secret storage and access policies require separate protection. For this scenario prefer: Apply supported Kubernetes NetworkPolicies to restrict traffic using Pod/namespace selectors and explicit ingress/egress rules. Workload context: A team creates a default-deny policy but still sees unrestricted traffic because its CNI plugin does not implement NetworkPolicy.
B:Use a Service type LoadBalancer with a supported cloud or in-cluster load-balancer controller to provide an approved external endpoint. This action addresses LoadBalancer Service provisioning instead of the controlling requirement. A LoadBalancer Service depends on an implementation or provider controller; creating it does not guarantee an external address. For this scenario prefer: Apply supported Kubernetes NetworkPolicies to restrict traffic using Pod/namespace selectors and explicit ingress/egress rules. Workload context: A team creates a default-deny policy but still sees unrestricted traffic because its CNI plugin does not implement NetworkPolicy.
C:Use supported Ingress or Gateway API resources together with a running controller to route HTTP traffic by host and path. This action addresses Ingress and Gateway API routing instead of the controlling requirement. Ingress and Gateway API resources describe routing intent; a controller implements data-plane forwarding. For this scenario prefer: Apply supported Kubernetes NetworkPolicies to restrict traffic using Pod/namespace selectors and explicit ingress/egress rules. Workload context: A team creates a default-deny policy but still sees unrestricted traffic because its CNI plugin does not implement NetworkPolicy.
Question 43
A developer copies a private signing key into an early build stage and deletes it in the last line of the same image. Which evidence should the engineer inspect FIRST to distinguish the likely cause or verify the prerequisite?
- Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events.
- Inspect process namespace, container cgroup limits, OOM events and host resource metrics.
- Inspect Dockerfile layer history, build context, cache usage, image size and scanner findings.
- Inspect DaemonSet desired/current/ready counts, node eligibility, tolerations and per-node Pod placement.
Explanation
Correct Answer
C:Inspect Dockerfile layer history, build context, cache usage, image size and scanner findings. This is the most discriminating evidence for the described failure or requirement. Deleting a file in a later image layer does not erase secrets committed into an earlier layer. The corresponding implementation is: Build minimal images with reproducible layers and protect against secrets embedded in historical image layers. Workload context: A developer copies a private signing key into an early build stage and deletes it in the last line of the same image.
Incorrect Answers
A:Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events. These observations are more relevant to Sidecar containers and shared Pod lifecycle, not this case. The distinguishing check is: Inspect Dockerfile layer history, build context, cache usage, image size and scanner findings. Workload context: A developer copies a private signing key into an early build stage and deletes it in the last line of the same image.
B:Inspect process namespace, container cgroup limits, OOM events and host resource metrics. These observations are more relevant to Linux namespaces and cgroups, not this case. The distinguishing check is: Inspect Dockerfile layer history, build context, cache usage, image size and scanner findings. Workload context: A developer copies a private signing key into an early build stage and deletes it in the last line of the same image.
D:Inspect DaemonSet desired/current/ready counts, node eligibility, tolerations and per-node Pod placement. These observations are more relevant to DaemonSet node-local workloads, not this case. The distinguishing check is: Inspect Dockerfile layer history, build context, cache usage, image size and scanner findings. Workload context: A developer copies a private signing key into an early build stage and deletes it in the last line of the same image.
Question 44
An engineer expects setting storageClassName on a claim to create usable storage even when the provisioner controller is unavailable. Which observable result BEST confirms the desired Kubernetes or cloud native behavior?
- In-cluster clients reach internal services and exposed node ports are limited to approved traffic.
- New claims provision compatible storage without requiring manual static PV creation for each request.
- The PVC binds to a suitable volume and survives recreation of the application Pod as designed.
- Applications mount volumes with the requested access pattern without unsupported simultaneous access assumptions.
Explanation
Correct Answer
B:New claims provision compatible storage without requiring manual static PV creation for each request. This is an observable service outcome, not just evidence that a configuration file was saved. StorageClass names provisioning behavior; a controller and backend must support dynamic provisioning. Workload context: An engineer expects setting storageClassName on a claim to create usable storage even when the provisioner controller is unavailable.
Incorrect Answers
A:In-cluster clients reach internal services and exposed node ports are limited to approved traffic. That result validates ClusterIP and NodePort Service exposure rather than the requirement here. Verify instead: New claims provision compatible storage without requiring manual static PV creation for each request. Workload context: An engineer expects setting storageClassName on a claim to create usable storage even when the provisioner controller is unavailable.
C:The PVC binds to a suitable volume and survives recreation of the application Pod as designed. That result validates PersistentVolume and claim bindings rather than the requirement here. Verify instead: New claims provision compatible storage without requiring manual static PV creation for each request. Workload context: An engineer expects setting storageClassName on a claim to create usable storage even when the provisioner controller is unavailable.
D:Applications mount volumes with the requested access pattern without unsupported simultaneous access assumptions. That result validates ReadWriteOnce and ReadWriteMany semantics rather than the requirement here. Verify instead: New claims provision compatible storage without requiring manual static PV creation for each request. Workload context: An engineer expects setting storageClassName on a claim to create usable storage even when the provisioner controller is unavailable.
Question 45
A chart installs successfully in development but production values accidentally disable its readiness probes. Which observable result BEST confirms the desired Kubernetes or cloud native behavior?
- Public requests reach the intended application host and path with a valid certificate and matching backends.
- Template rendering produces intended resources and upgrades or rollbacks remain tied to specific chart revisions.
- A failing candidate build halts or rolls back before reaching full audience while healthy versions progress safely.
- An incident timeline pinpoints the failing dependency rather than relying on one generic readiness or CPU signal.
Explanation
Correct Answer
B:Template rendering produces intended resources and upgrades or rollbacks remain tied to specific chart revisions. This is an observable service outcome, not just evidence that a configuration file was saved. Helm templates generate manifests; a chart repository alone does not deploy resources or validate runtime behavior. Workload context: A chart installs successfully in development but production values accidentally disable its readiness probes.
Incorrect Answers
A:Public requests reach the intended application host and path with a valid certificate and matching backends. That result validates Ingress route and TLS mismatch diagnosis rather than the requirement here. Verify instead: Template rendering produces intended resources and upgrades or rollbacks remain tied to specific chart revisions. Workload context: A chart installs successfully in development but production values accidentally disable its readiness probes.
C:A failing candidate build halts or rolls back before reaching full audience while healthy versions progress safely. That result validates Progressive delivery and release metrics rather than the requirement here. Verify instead: Template rendering produces intended resources and upgrades or rollbacks remain tied to specific chart revisions. Workload context: A chart installs successfully in development but production values accidentally disable its readiness probes.
D:An incident timeline pinpoints the failing dependency rather than relying on one generic readiness or CPU signal. That result validates Correlating metrics logs and traces rather than the requirement here. Verify instead: Template rendering produces intended resources and upgrades or rollbacks remain tied to specific chart revisions. Workload context: A chart installs successfully in development but production values accidentally disable its readiness probes.
Question 46
A developer receives permission to list Pods in one namespace but believes it also allows deleting Nodes across the cluster. Which observable result BEST confirms the desired Kubernetes or cloud native behavior?
- A supported resource can be applied predictably and unknown fields or removed API versions are identified before rollout.
- Principals can perform only intended operations at the correct scope while denied actions remain inaccessible.
- Operators identify the failing object and use evidence before editing controllers or escalating access.
- The Pod schedules only onto eligible labeled nodes while other nodes remain untouched.
Explanation
Correct Answer
B:Principals can perform only intended operations at the correct scope while denied actions remain inaccessible. This is an observable service outcome, not just evidence that a configuration file was saved. A RoleBinding can bind a ClusterRole within its namespace; a ClusterRoleBinding grants its rules at cluster scope. Workload context: A developer receives permission to list Pods in one namespace but believes it also allows deleting Nodes across the cluster.
Incorrect Answers
A:A supported resource can be applied predictably and unknown fields or removed API versions are identified before rollout. That result validates Declarative resource manifests and API versions rather than the requirement here. Verify instead: Principals can perform only intended operations at the correct scope while denied actions remain inaccessible. Workload context: A developer receives permission to list Pods in one namespace but believes it also allows deleting Nodes across the cluster.
C:Operators identify the failing object and use evidence before editing controllers or escalating access. That result validates kubectl inspect and describe diagnostics rather than the requirement here. Verify instead: Principals can perform only intended operations at the correct scope while denied actions remain inaccessible. Workload context: A developer receives permission to list Pods in one namespace but believes it also allows deleting Nodes across the cluster.
D:The Pod schedules only onto eligible labeled nodes while other nodes remain untouched. That result validates nodeSelector equality placement rather than the requirement here. Verify instead: Principals can perform only intended operations at the correct scope while denied actions remain inaccessible. Workload context: A developer receives permission to list Pods in one namespace but believes it also allows deleting Nodes across the cluster.
Question 47
An API's p95 latency doubles while overall CPU stays normal and the team needs request-path traces to identify a slow database call. Which Kubernetes or cloud native approach BEST addresses the stated requirement?
- Use time-aligned metrics, structured logs and distributed traces to isolate root causes across Kubernetes components and services.
- Record artifact provenance, dependency inventories and signed attestations so deployment policy can trace a build to authorized source.
- Use ephemeral containers to inspect a running Pod when its application image lacks debug tools, with approved access to sensitive process namespaces.
- Compare rollout history and resource generations to identify whether application failures correlate with a new deployment revision.
Explanation
Correct Answer
A:Use time-aligned metrics, structured logs and distributed traces to isolate root causes across Kubernetes components and services. This response implements the controlling Kubernetes or cloud native principle. Metrics show trends, logs show event details, and traces show request spans; reliable correlation benefits from consistent identifiers. Check its effect by: Compare trace IDs, time synchronized log events, resource saturation metrics and span durations. Workload context: An API's p95 latency doubles while overall CPU stays normal and the team needs request-path traces to identify a slow database call.
Incorrect Answers
B:Record artifact provenance, dependency inventories and signed attestations so deployment policy can trace a build to authorized source. This action addresses Software supply chain attestations instead of the controlling requirement. SBOM inventory and signed provenance provide different evidence; neither replaces vulnerability and security-policy review. For this scenario prefer: Use time-aligned metrics, structured logs and distributed traces to isolate root causes across Kubernetes components and services. Workload context: An API's p95 latency doubles while overall CPU stays normal and the team needs request-path traces to identify a slow database call.
C:Use ephemeral containers to inspect a running Pod when its application image lacks debug tools, with approved access to sensitive process namespaces. This action addresses Ephemeral debug containers for minimal images instead of the controlling requirement. Ephemeral containers are for diagnostics and cannot be treated as permanent workload replicas or restarted like ordinary containers. For this scenario prefer: Use time-aligned metrics, structured logs and distributed traces to isolate root causes across Kubernetes components and services. Workload context: An API's p95 latency doubles while overall CPU stays normal and the team needs request-path traces to identify a slow database call.
D:Compare rollout history and resource generations to identify whether application failures correlate with a new deployment revision. This action addresses Rollout history status and change correlation instead of the controlling requirement. A Deployment being Available does not prove all new replicas are healthy or that a rollout has fully progressed. For this scenario prefer: Use time-aligned metrics, structured logs and distributed traces to isolate root causes across Kubernetes components and services. Workload context: An API's p95 latency doubles while overall CPU stays normal and the team needs request-path traces to identify a slow database call.
Question 48
An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested. Which evidence should the engineer inspect FIRST to distinguish the likely cause or verify the prerequisite?
- Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events.
- Compare imagePullPolicy, local image cache, registry digest, pull events and Pod imageID.
- Inspect DaemonSet desired/current/ready counts, node eligibility, tolerations and per-node Pod placement.
- Inspect image metadata, Pod command/args, process exit code and startup logs.
Explanation
Correct Answer
A:Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events. This is the most discriminating evidence for the described failure or requirement. Sidecars share a Pod network context; careless start or termination ordering can block a workload. The corresponding implementation is: Use supported sidecar containers for tightly coupled helper functions and verify lifecycle coordination within the Pod. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
Incorrect Answers
B:Compare imagePullPolicy, local image cache, registry digest, pull events and Pod imageID. These observations are more relevant to Image pull policy and cached images, not this case. The distinguishing check is: Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
C:Inspect DaemonSet desired/current/ready counts, node eligibility, tolerations and per-node Pod placement. These observations are more relevant to DaemonSet node-local workloads, not this case. The distinguishing check is: Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
D:Inspect image metadata, Pod command/args, process exit code and startup logs. These observations are more relevant to Container command entrypoint and arguments, not this case. The distinguishing check is: Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
Question 49
An engineer assumes a public registry automatically signs every published image and disables provenance verification. Which TWO complementary steps supply the appropriate approach AND the evidence required to validate it? Select TWO.
- Choose imagePullPolicy based on tag immutability and cluster delivery needs, checking runtime cache and registry accessibility.
- Check registry path, pull Secret, tag or digest, IAM grant, TLS trust and registry audit logs.
- Each eligible node runs the intended agent and newly added eligible nodes receive it automatically.
- Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries.
- Inspect Pod label selectors, namespaces, topologyKey and actual placement of matching peer Pods.
Explanation
Correct Answers
B:Check registry path, pull Secret, tag or digest, IAM grant, TLS trust and registry audit logs. This is the most discriminating evidence for the described failure or requirement. OCI registries store/distribute image artifacts; they do not orchestrate Pods or apply cluster networking. The corresponding implementation is: Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries. This is the diagnostic evidence part of the paired answer. Workload context: An engineer assumes a public registry automatically signs every published image and disables provenance verification.
D:Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries. This response implements the controlling Kubernetes or cloud native principle. OCI registries store/distribute image artifacts; they do not orchestrate Pods or apply cluster networking. Check its effect by: Check registry path, pull Secret, tag or digest, IAM grant, TLS trust and registry audit logs. This is the implementation part of the required paired answer. Workload context: An engineer assumes a public registry automatically signs every published image and disables provenance verification.
Incorrect Answers
A:Choose imagePullPolicy based on tag immutability and cluster delivery needs, checking runtime cache and registry accessibility. This step belongs to Image pull policy and cached images rather than the complementary implementation and evidence pair. The intended approach is: Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries. Validate with: Check registry path, pull Secret, tag or digest, IAM grant, TLS trust and registry audit logs. Workload context: An engineer assumes a public registry automatically signs every published image and disables provenance verification.
C:Each eligible node runs the intended agent and newly added eligible nodes receive it automatically. This step belongs to DaemonSet node-local workloads rather than the complementary implementation and evidence pair. The intended approach is: Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries. Validate with: Check registry path, pull Secret, tag or digest, IAM grant, TLS trust and registry audit logs. Workload context: An engineer assumes a public registry automatically signs every published image and disables provenance verification.
E:Inspect Pod label selectors, namespaces, topologyKey and actual placement of matching peer Pods. This step belongs to Pod affinity anti-affinity rather than the complementary implementation and evidence pair. The intended approach is: Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries. Validate with: Check registry path, pull Secret, tag or digest, IAM grant, TLS trust and registry audit logs. Workload context: An engineer assumes a public registry automatically signs every published image and disables provenance verification.
Question 50
An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested. Which Kubernetes or cloud native approach BEST addresses the stated requirement?
- Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries.
- Place a Kubernetes Service in front of ephemeral Pods when callers need stable discovery independent of individual Pod IP changes.
- Build minimal images with reproducible layers and protect against secrets embedded in historical image layers.
- Use supported sidecar containers for tightly coupled helper functions and verify lifecycle coordination within the Pod.
Explanation
Correct Answer
D:Use supported sidecar containers for tightly coupled helper functions and verify lifecycle coordination within the Pod. This response implements the controlling Kubernetes or cloud native principle. Sidecars share a Pod network context; careless start or termination ordering can block a workload. Check its effect by: Review initContainers/sidecar restart behavior, shared volumes, localhost traffic and termination events. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
Incorrect Answers
A:Pull images from approved OCI-compatible registries with controlled image credentials and documented access boundaries. This action addresses OCI registries and image distribution instead of the controlling requirement. OCI registries store/distribute image artifacts; they do not orchestrate Pods or apply cluster networking. For this scenario prefer: Use supported sidecar containers for tightly coupled helper functions and verify lifecycle coordination within the Pod. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
B:Place a Kubernetes Service in front of ephemeral Pods when callers need stable discovery independent of individual Pod IP changes. This action addresses Service stable virtual endpoint instead of the controlling requirement. A Service abstracts changing Pod endpoints; exposing a ClusterIP does not automatically create public Internet access. For this scenario prefer: Use supported sidecar containers for tightly coupled helper functions and verify lifecycle coordination within the Pod. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.
C:Build minimal images with reproducible layers and protect against secrets embedded in historical image layers. This action addresses Image layers and build cache instead of the controlling requirement. Deleting a file in a later image layer does not erase secrets committed into an earlier layer. For this scenario prefer: Use supported sidecar containers for tightly coupled helper functions and verify lifecycle coordination within the Pod. Workload context: An application shuts down before its sidecar flushes logs because the Pod's termination lifecycle is not tested.