CI verification and migration safety
Verification is a sequence of evidence gates
Parse and lint manifests, check schemas against the intended API versions, review policy and dependency compatibility, then test in a disposable environment. A server dry run can check admission for a request without persisting it, but it does not run Pods. Deployment readiness shows a configured health signal. Smoke tests check essential user-visible behavior such as fetching a catalog item; integration tests cover dependencies and negative cases such as a missing item. All of these are different evidence gates. Stop if a required check is missing, not just when it reports failure.
Why a database migration changes rollback
During a rolling update, old and new application versions may use the same database. If the new release immediately removes a column that the old version reads, even a successful Pod rollback leaves old code unable to query its data. A backup is important, but restoring may discard later writes and requires its own approved recovery plan. Do not equate reverting a Deployment with reversing a schema migration.
Expand, migrate, contract
For a catalog changing title to display_title, first expand the schema with a nullable new column while retaining title. Make writers compatible (for example dual writes with a reviewed synchronization strategy), migrate existing values in bounded batches, verify data consistency, and move reads to the new field only when safe. Keep the old column until old binaries are retired and the rollback window closes. Contract by removing it in a later reviewed change. Engine-specific locks, transaction behavior, replication and data volume must be evaluated separately. The local exercise uses a tiny in-memory SQLite database only, not a production migration recipe.
CREATE TABLE books (id INTEGER PRIMARY KEY, title TEXT NOT NULL);ALTER TABLE books ADD COLUMN display_title TEXT;UPDATE books SET display_title = title WHERE display_title IS NULL;Prevent repeated or conflicting migration runs
Run migration work through a deliberate release step with version tracking, concurrency protection, bounded retries and monitoring. Kubernetes Jobs may retry or start work more than once, so a migration must handle repeated execution safely or use a framework that provides the required coordination. Avoid running uncontrolled schema changes from every application replica. Check both versions against the transitional schema; verify recovery and the data invariant before approving destructive changes.
Practice: verify compatibility offline
Run validate_offline.py using Python 3 and PyYAML in the supplied fixture directory. It creates an in-memory database, tests old and new read paths, checks a dual write and verifies that a deliberately incompatible schema cannot serve the old query. It also checks mock release gates. This demonstrates a limited local example only: no Kubernetes admission, deployment, registry, CI service or production database is contacted. Next chapter: API machinery and resource lifecycle.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
CI verification and migration safety — knowledge check
Reason about application delivery using offline fixtures.
What does server dry-run not prove?
What should happen before removing a column old application versions use?
Why include a negative smoke test?
Can a Kubernetes Job run migration work more than once?
After rolling back Pods, the database lacks a column the old version reads. What is true?