Kubernetes and Cloud Native Associate (KCNA)Cloud Native ArchitectureEasy

A cloud-native development team is deploying a new service to Kubernetes. They want to ensure that application configuration data, such as database connection strings or feature flags, is decoupled from the application code and can be easily updated without rebuilding the container image. Which Kubernetes object is best suited for storing non-sensitive configuration data?

  1. ADeployment
  2. BConfigMap
  3. CSecret
  4. DPersistentVolume
Show answer & explanation

Correct answer: B. ConfigMap

A ConfigMap is a Kubernetes object used to store non-confidential data in key-value pairs. It allows developers to decouple configuration artifacts from image content, making applications more portable and easier to manage configuration changes without rebuilding container images.

Why the other options are wrong

  • A. A Deployment is a controller for managing stateless applications, ensuring a specified number of replicas are running, but it does not store configuration data itself.
  • C. A Secret is used for storing sensitive data like passwords or API keys, not general non-sensitive configuration.
  • D. A PersistentVolume is used for persistent storage of data, not for application configuration.

Kubernetes ConfigMap

A Kubernetes API object used to store non-confidential data in key-value pairs. It allows you to decouple configuration artifacts from image content to keep containerized applications portable.

  • Stores non-sensitive configuration data.
  • Data injected into pods as environment variables or files.
  • Decouples config from application code/image.
  • Managed as a Kubernetes object.

Memory trick: ConfigMap keeps config clean.

More Cloud Native Architecture questions