Which TWO of the following are valid ways to securely manage secrets in Kubernetes? (Choose two.)
Mounting a Kubernetes Secret as a volume is the most secure built-in method because the kubelet creates an in-memory tmpfs filesystem and writes each secret key as a file, which is not stored on the node's disk. Unlike environment variables, volume-mounted secrets are not visible in /proc/<pid>/environ or container logs, and they support automatic rotation: when the Secret object is updated, the kubelet eventually rewrites the mounted files without requiring a pod restart. You can also set file permissions via defaultMode to restrict access to the specific user in the container, and the secret data never appears in the pod spec beyond the Secret reference.
Why this answer
Mounting Kubernetes Secrets as volumes into the pod ensures that secret data is stored in the pod's filesystem as files, which are created with in-memory tmpfs to avoid writing to disk. This approach leverages Kubernetes' native secret handling, where the secret data is base64-decoded and presented as plaintext files, and access can be controlled via RBAC and PodSecurityPolicies. It also supports automatic rotation when secrets are updated, provided the pod is restarted or the volume is remounted.
Exam trap
Kubernetes often tests the misconception that environment variables are a secure way to inject secrets, when in fact they are vulnerable to exposure through process introspection and logging, making volume mounts or external secret stores the recommended approaches.