Certified GitOps Associate (CGOA) free question 7 / 10 · Domain 4: GitOps Patterns
Which layout does the Flux documentation describe as a monorepo?
- Kubernetes manifests sit in a single Git repository, with a long-lived branch for the separate environments
- The manifests of the environments sit in separate Git repositories, and a team owns one of them
- The manifests of an application sit in its own source repository, and the config repo points at them
- The Kubernetes manifests sit in a single Git repository, and the environment configs are in one branch
Show the answer and explanation
Answer: D
Why this is correct
The Monorepo section says that in a monorepo approach you store all your Kubernetes manifests in a single Git repository. The configs that are specific to the various environments are all stored in the same branch, for example main. The guide pairs this layout with trunk-based development, where changes are merged into the main branch often and other branches are short-lived.
Why the other options are wrong
"Kubernetes manifests sit in a single Git repository, with a long-lived branch for the separate environments" … The guide says the environment-specific configs are stored in the same branch, for example main, and not in a branch for each environment.
"The manifests of the environments sit in separate Git repositories, and a team owns one of them" … That is the repo-per-environment or repo-per-team approach. A monorepo is a single repository for all the manifests.
"The manifests of an application sit in its own source repository, and the config repo points at them" … That is the repo-per-app approach, in which the config repo holds a pointer to the app manifests.
Key points
In trunk-based development, changes are made in small batches and merged into the main branch often.