KCNA Cloud Native Architecture Practice Question
An application requires external configuration that varies between environments (dev, staging, prod). Following the 12-factor app methodology, how should this configuration be provided?
⚠ Common exam trap
KCNA often tests the misconception that version-controlled config files are 'best practice' — candidates pick B because it sounds disciplined, but 12-factor explicitly rejects config in the repo.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use environment variables
The 12-factor app methodology (Factor III: Config) explicitly states that configuration should be stored in environment variables, not in code or version-controlled files. This keeps config strictly separate from code so the same build artifact can be deployed unchanged across dev, staging, and prod by simply changing environment variables.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use environment variables
Why this is correct
Twelve-factor apps store configuration in environment variables, keeping it strictly separate from code so the same build deploys unchanged across dev, staging and prod. This satisfies the per-environment variation requirement without conditional code or committed config files.
- ✗
Store configuration in a config file that is version-controlled
Why it's wrong here
Version-controlled config files embed environment-specific values in the repository, violating 12-factor's strict separation of config from code and requiring rebuilds per environment. It is tempting because config files suit static, non-secret settings shared across deployments, such as feature flags or logging levels, where environment variance is absent.
- ✗
Use a centralized database for configuration
Why it's wrong here
A centralized database couples configuration to a running service, contradicting 12-factor's requirement that config be stored in environment variables, separate from code. It is tempting as a shared store, and would suit dynamic runtime feature flags, but not environment-specific deployment configuration.
- ✗
Hard-code the configuration in the application code
Why it's wrong here
Hard-coding bakes environment-specific values into the artefact, so promoting the same build across dev, staging and prod is impossible without code changes and redeployment. It tempts teams wanting zero external dependencies for single-environment scripts or throwaway prototypes, where no promotion pipeline exists.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 930-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CNCF exam blueprint
This KCNA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the KCNA exam.