ACE Practice Question: Run a database migration script once before…
This ACE practice question tests your understanding of run a database migration script once before…. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You need to run a database migration script once before deploying a new version of an application to GKE. The migration must complete before any application pods start. Which Kubernetes feature enables this pattern?
Answer choices
Why each option matters
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
Distractor review
A Kubernetes CronJob scheduled to run the migration before deployment.
CronJobs run on a schedule, not on-demand as a deployment pre-requisite. There's no guarantee the CronJob completes before pod startup.
Best answer
A Kubernetes init container in the Pod spec that runs the migration script.
Init containers run and must complete successfully before the main containers start. This guarantees the migration runs exactly once per pod before the app starts.
Distractor review
A Kubernetes Job that runs the migration, with the Deployment configured to start only after the Job completes.
A separate Job can run migrations, but there's no native Kubernetes dependency mechanism to make a Deployment wait for a Job. Init containers are the cleaner in-pod solution.
Distractor review
A readiness probe that runs the migration script before marking the pod as ready.
Readiness probes check if a pod is ready to receive traffic; they do not run one-time scripts and are re-executed continuously.
Common exam trap
Common exam trap: NAT rules depend on direction and matching traffic
NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.
Technical deep dive
How to think about this question
NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.
KKey Concepts to Remember
- Static NAT maps one inside address to one outside address.
- PAT allows many inside hosts to share one public address using ports.
- Inside local and inside global describe the private and translated addresses.
- NAT ACLs identify traffic for translation, not always security filtering.
TExam Day Tips
- Identify inside and outside interfaces first.
- Check whether the scenario needs static NAT, dynamic NAT or PAT.
- Do not confuse NAT matching ACLs with normal packet-filtering intent.
Key takeaway
NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
Related practice questions
Related ACE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
More questions from this exam
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
What is the correct order of the Google Cloud resource hierarchy from highest to lowest level?
Question 2
A compliance archive stores legal documents accessed at most once per quarter. Which Cloud Storage class minimizes storage cost while meeting that access pattern?
Question 3
Which gcloud command creates a Compute Engine VM named 'web-01' using the e2-medium machine type in zone us-central1-a?
Question 4
A team wants to receive an email alert when the average CPU utilization of VMs in a managed instance group exceeds 80% for more than 5 minutes. What should they create in Cloud Monitoring?
Question 5
A junior developer needs read-only access to all GCP resources in a project. Which IAM role grants the minimum permissions required?
Question 6
A startup creates its first Google Cloud project. Before deploying any paid resources, what must be linked to the project?
Practice this exam
Start a free ACE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this ACE question test?
Static NAT maps one inside address to one outside address.
What is the correct answer to this question?
The correct answer is: A Kubernetes init container in the Pod spec that runs the migration script. — Kubernetes init containers run to completion before any of the main application containers start. A Pod spec can define an init container that runs the migration script; only after it exits with code 0 do the application containers start. This is the standard Kubernetes pattern for run-once pre-startup tasks like database migrations.
What should I do if I get this ACE question wrong?
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related ACE NAT questions on configuration and troubleshooting.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Discussion
Sign in to join the discussion.
This ACE practice question is part of Courseiva's free Google Cloud 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 ACE exam.