Kubernetes and Cloud Native Associate (KCNA)Kubernetes FundamentalsHard

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?

  1. AconfigMap
  2. Bnfs
  3. CemptyDir
  4. DhostPath
Show answer & explanation

Correct answer: B. nfs

The `nfs` Volume type in Kubernetes is specifically designed to mount an existing NFS share into a Pod. It allows Pods to access data from a remote NFS server, providing shared and persistent storage.

Why the other options are wrong

  • A. A `configMap` Volume is used to inject configuration data into a Pod, not for general file-based storage from a network share.
  • C. An `emptyDir` Volume is created when a Pod is assigned to a Node and exists only as long as the Pod runs on that Node; it's temporary and not for shared persistent storage.
  • D. A `hostPath` Volume mounts a file or directory from the host Node's filesystem, which is not suitable for shared network storage across multiple Pods/Nodes.

Kubernetes `nfs` Volume

A Kubernetes Volume type that allows an existing Network File System (NFS) share to be mounted into a Pod. It provides shared and persistent storage that can be accessed by multiple Pods, typically across different Nodes.

  • Mounts an existing NFS share.
  • Provides shared and persistent storage.
  • Requires an NFS server to be available.

Memory trick: Host for Node, Empty for Ephemeral, NFS for Network, Config for Configs.

More Kubernetes Fundamentals questions