CGOA Related Practices Practice Question
You are migrating a legacy application deployment process to GitOps. The application requires a specific sequence of database migrations to run before the new container version is deployed. How do you implement this in a GitOps-friendly way?
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 a Kubernetes 'Job' resource that runs before the Deployment, and manage dependencies with initContainers or Helm hooks.
GitOps relies on reconciliation. Pre-deployment tasks should be managed via Kubernetes Jobs or hooks that maintain the declarative nature of the cluster state.
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 a Kubernetes 'Job' resource that runs before the Deployment, and manage dependencies with initContainers or Helm hooks.
Why this is correct
Helm hooks or Kubernetes Jobs allow declarative definition of prerequisites that the GitOps controller can manage.
- ✗
Add a 'kubectl apply' command to the end of the CI pipeline to execute migrations.
Why it's wrong here
This is an imperative push that ignores the GitOps control loop.
- ✗
Hardcode the migration logic into the application source code to run on startup.
Why it's wrong here
While this is a common anti-pattern, it does not address the dependency management requirement of infrastructure and application orchestration.
- ✗
Create a manual trigger in the GitOps dashboard to execute the migration after the deployment starts.
Why it's wrong here
This is a manual intervention and breaks the fully automated GitOps reconciliation process.
- ✗
Configure the GitOps agent to execute a shell script on the node before pulling the image.
Why it's wrong here
GitOps controllers operate on the cluster API, not by executing scripts on individual nodes.
About these practice questions
One of 325 original CGOA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 August 2026 · checked against the official CNCF / Linux Foundation exam blueprint
This CGOA practice question is part of Courseiva's free CNCF / Linux Foundation 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 CGOA exam.