KoreaDevKNOWLEDGE SHARING

Content typeLearn

AI SOFTWARE DEVELOPMENT · 07 / 10

Container and cloud infrastructure

Reduce development-environment differences with images and deployment contracts, and connect Compose, Kubernetes, probes, rollout, and rollback.

Difficulty
Beginner · Practical
Structure
Lessons 8 · Labs 2 · Assessment

CORE UNIT 1 / 1

Container and cloud infrastructure

Reduce development-environment differences with images and deployment contracts, and connect Compose, Kubernetes, probes, rollout, and rollback.

Difficulty
Beginner · Practical
Structure
Lessons 8 · Labs 2 · Assessment

Diagrams and tables: composed by the author using each lesson's official primary sources. Find the originals and review dates at the end of that lesson.

NEW HIRE ONBOARDING

Start in the order you would receive your first assignment

So that even a new hire with no prior IT background can follow along, we start with the situation, the task, the evidence, and when to report, before difficult definitions.

  1. 01

    Read the situation in one sentence

    The Deployment uses the `latest` tag, and both readiness and liveness probes call an external AI API. When that API slows by 20 seconds, all pods restart.

  2. 02

    Today's assignment

    Distinguish the boundaries between process, container, image, registry, and pod.

  3. 03

    Evidence that shows the work is complete

    Restore the listings, files, and permissions of the pseudonymous records together, and record reads of recent records and denials of unauthorized access.

  4. 04

    When to stop and ask a senior colleague

    Shared host kernels, image vulnerabilities, secret injection, and stateful data become separate concerns.

Unpack unfamiliar terms first

From development to production
The primary value of containers lies less in the slogan “same everywhere” than in bundling runtime dependencies and the start command into a versioned artifact.
Docker image·layer·registry
Layer caching speeds up builds, but the final digest and supply-chain evidence determine deployment identity.
Connect multiple services with Compose
Compose reproduces a local multi-service topology but does not replace every production orchestration policy.

Questions for this course

Why did it change, and what must be verified?

Do not merely memorize a technology's advantages; check the conditions under which they hold and the new failure boundaries they introduce.

OBSERVABLE OUTCOMES

What you can do after this course

  1. Distinguish the boundaries between process, container, image, registry, and pod.
  2. Judges reproducible artifacts by layer, digest, and configuration.
  3. Diagnose failures in startup, readiness, and liveness probes and in rolling updates.

PREREQUISITE CHECK

Three things to check before reading

This is not a test of memorized answers. Think about each question first, then open the explanation to review the foundational concepts used in this course.

1Is a container a small VM?

It is an isolated process environment that usually shares the host kernel. Its isolation, startup, and image structure differ from those of a VM.

2Are an image and a container the same?

An image is an immutable execution template, and a container is a process instance started from that image and configuration.

3Is one health check enough?

Probes are split because they answer different questions: whether the process is still starting, whether it is ready to receive traffic, and whether it is deadlocked and needs recovery.

TEXTBOOK GUIDE

Main text that covers each concept from its background to the criteria for judging it

We explain the material section by section so readers new to IT can connect causes and effects without memorizing terms.

CONCEPT FLOW

How the chapters connect

The chapters are not isolated short answers to memorize. Follow them from left to right to see how each chapter's concepts support the next decision.

  1. 1.From development to production
  2. 2.Docker image·layer·registry
  3. 3.Connect multiple services with Compose
  4. 4.Orchestration with Kubernetes and K3s
  5. 5.Probe · scaling · rolling update · rollback
  6. 6.Track in-flight work when replacing a container
  7. 7.Migrate data formats while old code can still read them
  8. 8.Verify restored business outcomes rather than backup-file existence
Container and cloud infrastructure: the overall map. If you lose track while reading the detailed explanations and chapters below, return to this sequence.
Figure 7-1. Container and cloud infrastructure: concept developmentShows how each chapter’s choices and limits lead to the problems of the next chapter.
  1. 1
    From development to production

    The primary value of containers lies less in the slogan “same everywhere” than in bundling runtime dependencies and the start command into a versioned artifact.

  2. 2
    Docker image·layer·registry

    Layer caching speeds up builds, but the final digest and supply-chain evidence determine deployment identity.

  3. 3
    Connect multiple services with Compose

    Compose reproduces a local multi-service topology but does not replace every production orchestration policy.

  4. 4
    Orchestration with Kubernetes and K3s

    The orchestrator is a control loop that keeps the desired state and the actual state aligned rather than running the container.

  5. 5
    Probe · scaling · rolling update · rollback

    Probes answer different questions, and poor design can cause failures in otherwise healthy processes.

  6. 6
    Track in-flight work when replacing a container

    Blocking new traffic and completing in-flight work are separate conditions that require separate evidence.

  7. 7
    Migrate data formats while old code can still read them

    Rolling code back is useful only while data preserves the old code’s contract.

  8. 8
    Verify restored business outcomes rather than backup-file existence

    Restoration means making the application interpret data from the required point in time, not merely retrieving a file.

CONTROLLED EXPLANATION

Recovering an incomplete report-replacement deployment

Current state: Job admitted

Recovering an incomplete report-replacement deployment

Source: author-designed from Kubernetes probe and Deployment documentation. Instance readiness and file finalization are shown separately.

Start workInject terminationFind recoverable workVerify reprocessing1Job admitted2Temporary file write3Stopped during replacement4Same job redelivered5Result finalized
  1. Job admitted

    Record the job identifier in the ledger.

  2. Temporary file write

    Do not expose it for final download.

  3. Stopped during replacement

    The ledger remains unfinalized.

  4. Same job redelivered

    The new worker checks finalization state.

  5. Result finalized

    Reconcile one complete file and its completion record.

1 → 2
Start work
2 → 3
Inject termination
3 → 4
Find recoverable work
4 → 5
Verify reprocessing

Arrows are business-state transitions. A ready new Pod alone cannot advance the job to the final state.

CONCRETE CASES

Selection criteria for all courses

TABLE 7-1

Selection criteria for all courses

Compare the technology in each chapter by how it works, the new costs it adds, and the evidence to check, not by its name.

Table 7-1. Container and cloud infrastructure: design decision criteria
.Core mechanismCosts to watchEvidence to check
1. From development to productionThe build packages filesystem layers and metadata into a content-addressed image.Shared host kernels, image vulnerabilities, secret injection, and stateful data become separate concerns.Run the same digest from staging with the production configuration, and compare dependency and health contracts.
2. Docker image·layer·registryContent-addressed layers are shared, and a manifest points to per-platform images.Risks include large layers, cache pollution, mutable tags, and dependency supply-chain risk.When the same tag points to different digests, verify which artifact the deployment actually ran.
3. Connect multiple services with ComposeA declarative service graph runs images, networks, volumes, and configuration as one local contract.Single-host failure, secret and volume operations, and differences from production policy remain.Delay database startup and verify that the API recovers normally after bounded retries.
4. Orchestration with Kubernetes and K3sController reconciliation repeatedly reduces the difference between the declared desired state and the observed state.It adds complexity in the distributed control plane, policy, networking, storage, and version upgrades.Observe desired state and data continuity during pod deletion, node drain, and config changes.
5. Probe · scaling · rolling update · rollbackProbes and the rollout controller treat traffic eligibility and replica replacement as observable state.Wrong thresholds and dependency coupling cause restart storms and partial version errors.Inject slow startup, a dependency outage, and a wrong revision separately, and check restart, traffic, and rollback behavior.
6. Track in-flight work when replacing a containerSeparating request admission from result finalization makes completion reconstructable during shutdown.A work ledger and redelivery handling add cost but reduce silent loss of long-running jobs.Inject termination at three report-generation stages and check exposure of unfinished files and duplicate final results.
7. Migrate data formats while old code can still read themExpanding the contract, migrating readers and only then removing old fields separates code and data rollback boundaries.During coexistence, monitor disagreement between representations and conversion load.Write a check that reads a new booking with old code and a query for unconverted rows, then explain the prerequisites for removing the column.
8. Verify restored business outcomes rather than backup-file existenceConnect image, data, and authorization at the same recovery point and verify user reads to assess completeness.Restoring into a separate environment takes extra space and time, but it exposes gaps that backup success logs alone cannot reveal.Restore the listings, files, and permissions of the pseudonymous records together, and record reads of recent records and denials of unauthorized access.

CHAPTER 1 / 8

From development to production

The primary value of containers lies less in the slogan “same everywhere” than in bundling runtime dependencies and the start command into a versioned artifact.

Why this concept became necessary

Libraries present locally but absent on the server, different OS packages, and different environment values can cause deployment failures. Pin dependencies with a build recipe and lockfile, and inject configuration and secrets from outside the image.

Even with the same image, CPU architecture, kernel capabilities, volumes, and external services may differ. Reproducibility requires recording the artifact digest, execution configuration, migrations, and data conditions.

Figure 7-2. From development to production: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

The primary value of containers lies less in the slogan “same everywhere” than in bundling runtime dependencies and the start command into a versioned artifact.

How it works

The build packages filesystem layers and metadata into a content-addressed image.

Verification evidence

Run the same digest from staging with the production configuration, and compare dependency and health contracts.

Follow it through a concrete system

On a developer laptop, a process shares a network with the local database and test data is small, so timeout, DNS, certificate, and resource-limit problems may not be apparent. In production, multiple instances, load balancers, secret stores, and external services are connected, and partial failures are routine. “It works on my computer” is the starting point of a functional hypothesis, not evidence that it is ready to deploy.

To reduce environment differences, version not only source code but also dependency locks, runtime versions, configuration schemas, and build procedures together. Inject secrets and environment-specific endpoints at deployment rather than embedding them in the image. If they are missing, fail at startup instead of silently defaulting to production. Promoting the same artifact through staging and production, with differences confined to explicit configuration, supports reproduction and rollback.

Selection criteria and failure boundaries

Shared host kernels, image vulnerabilities, secret injection, and stateful data become separate concerns.

Misconceptions to avoid: An image running locally does not guarantee identical production behavior.

Verify it yourself

Run the same digest from staging with the production configuration, and compare dependency and health contracts.

What to judgeThe build packages filesystem layers and metadata into a content-addressed image.

To summarize this chapter

The primary value of containers lies less in the slogan “same everywhere” than in bundling runtime dependencies and the start command into a versioned artifact.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Docker, 「Use Compose in ProductionReview date 2026-08-28 · Scope Docker Compose official documentation

CHAPTER 2 / 8

Docker image·layer·registry

Layer caching speeds up builds, but the final digest and supply-chain evidence determine deployment identity.

Why this concept became necessary

Each Dockerfile instruction creates a reusable layer, and when an earlier layer changes, the cache for later layers is invalidated. Copying the dependency manifest before frequently changing source lets you reuse the install layer.

A tag is a movable name, while a digest is a content identity. A registry holds not only images but also manifests and platform information, and production can apply verified digest, SBOM, and signature policies.

Figure 7-3. Docker image·layer·registry: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

Layer caching speeds up builds, but the final digest and supply-chain evidence determine deployment identity.

How it works

Content-addressed layers are shared, and a manifest points to per-platform images.

Verification evidence

When the same tag points to different digests, verify which artifact the deployment actually ran.

Follow it through a concrete system

A container image is not a single compressed application folder but a bundle of read-only layers linked by content digest, plus runtime configuration. The order of base image, package installation, and source copying determines cache reuse and the scope of vulnerabilities. A container is a running instance that adds a writable layer, namespaces, and resource limits on top of this image.

A tag is a human-readable alias, so the same name can point to different digests. Link production releases, SBOMs, signatures, and scan results to the immutable digest, not the tag. Even if the build stage needs a compiler and credentials, copy only the executable binary and a minimal runtime into the final image, and confirm that build secrets do not remain in the layer history; only then can you explain the supply chain boundary.

Selection criteria and failure boundaries

Risks include large layers, cache pollution, mutable tags, and dependency supply-chain risk.

Misconceptions to avoid: It is incorrect to assume that the `latest` tag always identifies the newest verified build.

Verify it yourself

When the same tag points to different digests, verify which artifact the deployment actually ran.

What to judgeContent-addressed layers are shared, and a manifest points to per-platform images.

To summarize this chapter

Layer caching speeds up builds, but the final digest and supply-chain evidence determine deployment identity.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Docker, 「Understanding Image LayersReview date 2026-08-28 · Scope Latest official documentation

CHAPTER 3 / 8

Connect multiple services with Compose

Compose reproduces a local multi-service topology but does not replace every production orchestration policy.

Why this concept became necessary

A frontend, API, database, and queue can start together by declaring networks, volumes, environment, and dependencies. Service-name DNS simplifies connections, but startup order does not guarantee readiness, so client retries and health conditions are needed.

Keep database data in a named volume rather than the container's writable layer, and handle backup and migration separately. Do not commit secrets to the compose file; separate local development values from production credentials.

Figure 7-4. Connect multiple services with Compose: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

Compose reproduces a local multi-service topology but does not replace every production orchestration policy.

How it works

A declarative service graph runs images, networks, volumes, and configuration as one local contract.

Verification evidence

Delay database startup and verify that the API recovers normally after bounded retries.

Follow it through a concrete system

When a web application needs an API and PostgreSQL, Compose defines each service's image, network, volume, and environment variables in one file so developers can repeatedly start the same topology. Service names can be used through DNS, but `depends_on` ordering alone does not wait until the database can accept queries, so health conditions and application retries are needed.

Attaching a volume does not mean the data is protected either. Schema migration, backup, and restore are separate procedures, and you must know clearly whether a named volume remains when a container is removed. Compose is useful for development and small-scale operation on a single host, but if you need scheduling across multiple nodes, automatic recovery, and rolling updates, evaluate the broader state management contract that an orchestrator provides.

Selection criteria and failure boundaries

Single-host failure, secret and volume operations, and differences from production policy remain.

Misconceptions to avoid: It is incorrect to assume that `depends_on` guarantees the database is ready to accept queries.

Verify it yourself

Delay database startup and verify that the API recovers normally after bounded retries.

What to judgeA declarative service graph runs images, networks, volumes, and configuration as one local contract.

To summarize this chapter

Compose reproduces a local multi-service topology but does not replace every production orchestration policy.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Docker, 「Control Startup and Shutdown Order in ComposeReview date 2026-08-28 · Scope Docker Compose official documentation
  2. Docker, 「Use Compose in ProductionReview date 2026-08-28 · Scope Docker Compose official documentation

CHAPTER 4 / 8

Orchestration with Kubernetes and K3s

The orchestrator is a control loop that keeps the desired state and the actual state aligned rather than running the container.

Why this concept became necessary

When a Deployment declares replicas and a pod template, the controller creates missing pods and the scheduler places them on nodes. A Service provides a stable network endpoint for a changing set of pods, while config, secrets, and storage have separate resource lifecycles.

K3s bundles some components and defaults into a lightweight distribution, but the Kubernetes API and operational responsibilities do not go away. Choose it based on upgrades, backup, network and storage support, and team capability rather than cluster size.

Figure 7-5. Orchestration with Kubernetes and K3s: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

The orchestrator is a control loop that keeps the desired state and the actual state aligned rather than running the container.

How it works

Controller reconciliation repeatedly reduces the difference between the declared desired state and the observed state.

Verification evidence

Observe desired state and data continuity during pod deletion, node drain, and config changes.

Follow it through a concrete system

In Kubernetes, users store desired state, such as a Deployment's replica count and image, in the API instead of directly keeping a particular container process alive. The controller repeatedly observes the difference between current Pods and desired state, then creates or replaces Pods. A new Pod appearing elsewhere after a Node disappears is the result of this reconciliation loop, not teleportation of the old process.

K3s simplifies packaging and default components, helping installation and reducing footprint, but it does not remove Kubernetes' core APIs or operational responsibilities. Resource requests, persistent data, network policy, upgrades, and backups still need design. Distinguish a Pod restarting in a single-node lab from high availability that keeps the service running when the node itself disappears.

Selection criteria and failure boundaries

It adds complexity in the distributed control plane, policy, networking, storage, and version upgrades.

Misconceptions to avoid: Kubernetes does not automatically fix application bugs or database consistency.

Verify it yourself

Observe desired state and data continuity during pod deletion, node drain, and config changes.

What to judgeController reconciliation repeatedly reduces the difference between the declared desired state and the observed state.

To summarize this chapter

The orchestrator is a control loop that keeps the desired state and the actual state aligned rather than running the container.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Kubernetes, 「ControllersReview date 2026-08-28 · Scope Kubernetes official documentation
  2. Kubernetes, 「DeploymentsReview date 2026-08-28 · Scope Kubernetes official documentation

CHAPTER 5 / 8

Probe · scaling · rolling update · rollback

Probes answer different questions, and poor design can cause failures in otherwise healthy processes.

Why this concept became necessary

A startup probe defers other probes during slow initialization, readiness determines whether a pod receives traffic, and liveness identifies states where a restart is the recovery. Failing liveness just because a dependency is briefly slow can restart every replica at once.

A rolling update scales down old pods as new pods become ready and controls capacity with surge and unavailable budgets. Without schema compatibility, session draining, SLOs, and automatic rollback conditions, a successful container replacement does not mean success for users.

Figure 7-6. Probe · scaling · rolling update · rollback: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

Probes answer different questions, and poor design can cause failures in otherwise healthy processes.

How it works

Probes and the rollout controller treat traffic eligibility and replica replacement as observable state.

Verification evidence

Inject slow startup, a dependency outage, and a wrong revision separately, and check restart, traffic, and rollback behavior.

Follow it through a concrete system

A liveness probe detects a stuck process that needs restarting, while a readiness probe determines whether it can accept new requests. A startup probe can protect slow initialization. Restarting all Pods through liveness merely because a database is temporarily slow can amplify an incident, so define each probe according to the action it triggers.

A rolling update gradually increases new replicas and reduces old replicas, but it cannot automatically determine whether the new version's responses are correct for the business. In a canary, check migration compatibility and representative user outcomes as well as readiness, error rate, and latency. Verify in advance whether rollback can be completed by reverting the image and whether the old version can read schemas and messages already changed by the new version.

Selection criteria and failure boundaries

Wrong thresholds and dependency coupling cause restart storms and partial version errors.

Misconceptions to avoid: Checking every downstream dependency in the liveness endpoint does not make it safe.

Verify it yourself

Inject slow startup, a dependency outage, and a wrong revision separately, and check restart, traffic, and rollback behavior.

What to judgeProbes and the rollout controller treat traffic eligibility and replica replacement as observable state.

To summarize this chapter

Probes answer different questions, and poor design can cause failures in otherwise healthy processes.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Kubernetes, 「Liveness, Readiness and Startup ProbesReview date 2026-08-28 · Scope Kubernetes official documentation
  2. Kubernetes, 「DeploymentsReview date 2026-08-28 · Scope Kubernetes official documentation

CHAPTER 6 / 8

Track in-flight work when replacing a container

Blocking new traffic and completing in-flight work are separate conditions that require separate evidence.

Why this concept became necessary

Starting container replacement does not erase requests already accepted. File conversions or report jobs may still change external storage after a connection closes. Safe deployment requires knowing both whether the new instance is ready and how work on the old instance ended.

Readiness represents whether a workload can accept traffic, while liveness helps identify conditions that require a restart. Neither probe replaces the application’s work-completion ledger. The application must make stopped work intake, the number of running tasks, and termination reasons observable.

Work that cannot finish within the termination grace period must remain recoverable. Distinguish temporary and final outputs and mark completion only after finalization. Design redelivery around the same job identifier so finalized results are not recreated.

Unconditionally delaying termination is not the answer either. Old processes that keep writing alongside new configurations can prevent the rollout from completing or cause state conflicts. Define permitted waiting time, interruptible stages, and operator intervention criteria to fit the workload.

Figure 7-7. Track in-flight work when replacing a container: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

Blocking new traffic and completing in-flight work are separate conditions that require separate evidence.

How it works

Separating request admission from result finalization makes completion reconstructable during shutdown.

Verification evidence

Inject termination at three report-generation stages and check exposure of unfinished files and duplicate final results.

Follow it through a concrete system

Assume a teaching report job has three stages: read input, write a temporary file and finalize its name. If the container stops while writing the temporary file, the download list must not expose it. A restarted worker reads the ledger and retries only unfinalized work. Link temporary filenames to job identifiers so a restart can identify which leftovers to reclaim.

A counterexample sends success before finalizing the file. A user receiving that response immediately before shutdown gets a link to a missing file. Recording response time and storage finalization separately exposes the defect even if every probe was healthy. In this case, the directly observable mismatch is whether reported completion preceded finalization.

Inject termination while queued, during temporary storage and after finalization. Compare content completeness and ledger state, not just final file count. Even with duplicate delivery, one final result and a consistent completion state must remain. Preserve a normal path without forced termination to check whether recovery logic duplicates ordinary work.

Use Kubernetes deployment state to observe instance replacement and the work ledger to observe user outcomes. Correlate timestamps and job identifiers across both. Matching the target instance count does not prove that unfinished reports recovered. If unfinished jobs remain after replacement, record them as recovery work separately from deployment success.

Selection criteria and failure boundaries

A work ledger and redelivery handling add cost but reduce silent loss of long-running jobs.

Misconceptions to avoid: Successful Pod replacement does not imply successful jobs; verify business outcomes separately.

Verify it yourself

Inject termination at three report-generation stages and check exposure of unfinished files and duplicate final results.

What to judgeSeparating request admission from result finalization makes completion reconstructable during shutdown.

To summarize this chapter

Blocking new traffic and completing in-flight work are separate conditions that require separate evidence.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Kubernetes, 「Liveness, Readiness and Startup ProbesReview date 2026-08-28 · Scope Kubernetes official documentation
  2. Kubernetes, 「DeploymentsReview date 2026-08-28 · Scope Kubernetes official documentation

CHAPTER 7 / 8

Migrate data formats while old code can still read them

Rolling code back is useful only while data preserves the old code’s contract.

Why this concept became necessary

During a rolling update, old and new code may share a database. Adding a column needed by new code differs in risk from deleting one used by old code. Plan around reads and writes during coexistence rather than success on one version alone.

In the expansion stage, retain the old contract while making room for the new representation. Next verify existing-data conversion and new write paths. Consider removing the old representation only after old readers are gone and rollback boundaries are settled.

A default value alone does not preserve meaning. Filling unknown values with an arbitrary status can make queries succeed while changing decisions. List unconvertible rows separately and distinguish them from completed conversions until an owner defines the policy.

Constraints can provide a final defense during format migration, but cannot repair a bad conversion policy. PostgreSQL uniqueness applies to the specified combination of values. First determine whether business duplicates are scoped per account or globally, then align constraints and tests.

Figure 7-8. Migrate data formats while old code can still read them: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

Rolling code back is useful only while data preserves the old code’s contract.

How it works

Expanding the contract, migrating readers and only then removing old fields separates code and data rollback boundaries.

Verification evidence

Write a check that reads a new booking with old code and a query for unconverted rows, then explain the prerequisites for removing the column.

Follow it through a concrete system

A teaching booking system splits one contact string into a type and value. Old code reads only the original column, so deleting it immediately after adding new columns breaks rollback. Compare old and new reads during a transition period and handle conversion failures separately. Do not guess that ambiguous contacts are email; preserve their review-required state.

New bookings created during conversion can fall outside the initial batch. Record processed boundaries alongside the new write path. Claiming complete conversion requires a fresh query for unconverted rows, not just the count at the start. Including bookings created during conversion reveals gaps in writes outside the batch.

Testing only the new version and naming the deployment rollback button as the recovery plan is insufficient. If data is stored only in the new representation, the old image cannot interpret it. Include an actual compatibility check where old code reads newly written rows. Verify not just that the rollback candidate starts, but that it can update and reread new rows.

Build a matrix of old reads, new reads, old writes and new writes for each coexistence stage. Query pseudonymous bookings before and after conversion using the same business questions. Check missing results and duplicate bookings, not merely similar-looking values, before removing the old column. Classify each combination’s failure as a syntax problem or loss of meaning to identify the repair layer.

Selection criteria and failure boundaries

During coexistence, monitor disagreement between representations and conversion load.

Misconceptions to avoid: Rolling back an image does not roll back data; deployment and data have different lifecycles.

Verify it yourself

Write a check that reads a new booking with old code and a query for unconverted rows, then explain the prerequisites for removing the column.

What to judgeExpanding the contract, migrating readers and only then removing old fields separates code and data rollback boundaries.

To summarize this chapter

Rolling code back is useful only while data preserves the old code’s contract.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. Kubernetes, 「DeploymentsReview date 2026-08-28 · Scope Kubernetes official documentation
  2. PostgreSQL Global Development Group, 「ConstraintsReview date 2026-08-28 · Scope PostgreSQL 18 / current
  3. PostgreSQL Global Development Group, 「Concurrency Control: IntroductionReview date 2026-08-28 · Scope PostgreSQL 18 / current

CHAPTER 8 / 8

Verify restored business outcomes rather than backup-file existence

Restoration means making the application interpret data from the required point in time, not merely retrieving a file.

Why this concept became necessary

Recreating a container does not restore uploaded user data. Runtime images, data stores, and access configuration have different lifecycles. A recovery plan specifies which data survives where and which credentials can read it.

A successful backup log proves only part of recoverability. A backup is unusable if its format is incompatible with the app or required decryption material is unavailable. Verify in a separate environment that does not overwrite production data.

Confirm the recovery point from the range of restored business records, not from the timestamp of the last file created. Define acceptable data loss and service downtime first so the outcome can be judged. Record times that were not checked as unconfirmed, not as zero.

A restored app must be prevented from resending external notifications or payments. Data needed for read verification differs from write authority. Triggering new side effects for current customers while inspecting old jobs turns a recovery drill into a new incident.

Figure 7-9. Verify restored business outcomes rather than backup-file existence: decision flowThe chain from the problem conditions through the working principle to verification evidence.
Problems and selection criteria

Restoration means making the application interpret data from the required point in time, not merely retrieving a file.

How it works

Connect image, data, and authorization at the same recovery point and verify user reads to assess completeness.

Verification evidence

Restore the listings, files, and permissions of the pseudonymous records together, and record reads of recent records and denials of unauthorized access.

Follow it through a concrete system

Assume a teaching archive stores files and metadata rows separately. Restoring only the database can show a list whose downloads fail. Restoring only files loses ownership and visibility information needed for authorization. Therefore verify links for the same document identifier rather than declaring both stores independently successful.

In the drill, join metadata and files from the same recovery point and test reads as pseudonymous users. Select public and private documents and check content hashes and access denials. Row counts alone miss incorrect file links or lost authorization. The denial case separately detects a restoration defect that exposes private documents despite a normal listing.

Seeing the restored server start and display a login page is not completed recovery. It proves process startup, not document integrity. Open both older documents and records near the latest permitted recovery point to establish the actual recovered range. Missing expected recent documents means the recovery target is unmet even when server startup is fast.

Record the images used, backup identifier, restoration start and end times, and failed reads. If any files failed, report partial recovery rather than hiding the scope. In the next drill, recheck the corrected links and permissions against the same data. Provide record locations and read procedures so the next operator can find and compare the same backup.

Selection criteria and failure boundaries

Restoring into a separate environment takes extra space and time, but it exposes gaps that backup success logs alone cannot reveal.

Misconceptions to avoid: A backup file does not establish recoverability; actual restoration and business queries are required.

Verify it yourself

Restore the listings, files, and permissions of the pseudonymous records together, and record reads of recent records and denials of unauthorized access.

What to judgeConnect image, data, and authorization at the same recovery point and verify user reads to assess completeness.

To summarize this chapter

Restoration means making the application interpret data from the required point in time, not merely retrieving a file.

Official sources for this chapter

The technical facts in the text were reviewed against the following primary sources. The author reconstructed the diagrams and comparisons using these materials.

  1. PostgreSQL Global Development Group, 「Backup and RestoreReview date 2026-09-14 · Scope PostgreSQL 18 / current
  2. Docker, 「Use Compose in ProductionReview date 2026-08-28 · Scope Docker Compose official documentation
  3. Docker, 「Understanding Image LayersReview date 2026-08-28 · Scope Latest official documentation
  4. PostgreSQL Global Development Group, 「ConstraintsReview date 2026-08-28 · Scope PostgreSQL 18 / current

INTERACTIVE LAB 1 / 2

Lab 1 · Fix a broken deployment manifest

The Deployment uses the `latest` tag, and both readiness and liveness probes call an external AI API. When that API slows by 20 seconds, all pods restart.

Choose the option that addresses both the cause and recovery.

Choose an answer

Correct answer A

A. Use a verified digest, distinguish readiness to receive traffic from liveness that indicates whether restarting the process can help, and handle external API failures with timeouts and degraded mode.A decision that accounts for conditions, working principles, and failure boundaries together.

B. Shorten the probe interval to 1 second so the container restarts more often.It considers only some benefits and omits prerequisites or newly introduced failure boundaries.

C. Delete all probes and do not observe failures.It treats the responsibilities of different layers as one and misses the actual verification points.

D. Rename the container to cloud-native.It relies on technology names or trends, with no observable evidence from the current requirements.

INTERACTIVE LAB 2 / 2

Lab 2 · Decide what to retry after a report worker stops

During a simulated deployment, the old worker stops while writing a temporary report. The new Pod is ready, but the ledger still says processing and no final file exists. The queue redelivers the same job.

Choose a recovery decision that prevents duplicate results and exposure of unfinished files.

Choose an answer

Correct answer C

A. Mark the report complete because the new Pod is ready.Readiness concerns traffic admission, not file finalization, so this promises a result that does not exist.

B. Publish the temporary file immediately by renaming it to its final name.Shutdown interrupted the write, so content completeness is unknown; renaming does not establish a final result.

C. Confirm the unfinalized state under the same job identifier, retry, then verify the complete file and completion ledger.This treats redelivery as the same job and observes finalization, linking recovery with duplicate prevention.

D. Recreate every past job with a new identifier.This can duplicate finished results and lose the link to the original event, leaving retries uncontrolled.

KEY TERMS

Key terms in this unit

From development to production
The build packages filesystem layers and metadata into a content-addressed image.
Docker image·layer·registry
Content-addressed layers are shared, and a manifest points to per-platform images.
Connect multiple services with Compose
A declarative service graph runs images, networks, volumes, and configuration as one local contract.
Orchestration with Kubernetes and K3s
Controller reconciliation repeatedly reduces the difference between the declared desired state and the observed state.
Probe · scaling · rolling update · rollback
Probes and the rollout controller treat traffic eligibility and replica replacement as observable state.
Track in-flight work when replacing a container
Separating request admission from result finalization makes completion reconstructable during shutdown.
Migrate data formats while old code can still read them
Expanding the contract, migrating readers and only then removing old fields separates code and data rollback boundaries.
Verify restored business outcomes rather than backup-file existence
Connect image, data, and authorization at the same recovery point and verify user reads to assess completeness.

UNIT WORKBOOK

Exercises and worksheets for applying concepts to new situations

Start by checking basic principles, then expand to practical workplace decisions. After submitting an answer, you can see why every option is correct or incorrect, not just the correct answer.

THREE-LEVEL ASSESSMENT

From basic principles to operational decisions

After you submit an answer, you can see not only the correct answer but also why each option is right or wrong.

Basic Question 1

What does an image digest provide that a tag does not?

Choose an answer

Correct answer C

A. Put the host kernel inside the image.It treats the responsibilities of different layers as one and misses the actual verification points.

B. Always choose the latest version.It relies on technology names or trends, with no observable evidence from the current requirements.

C. The immutable identity of the executed artifact’s content.A decision that accounts for conditions, working principles, and failure boundaries together.

D. It provides automatic security clearance.It considers only some benefits and omits prerequisites or newly introduced failure boundaries.

Apply Question 2

What is the expected behavior when readiness fails?

Choose an answer

Correct answer D

A. Delete the entire cluster.It considers only some benefits and omits prerequisites or newly introduced failure boundaries.

B. Change the image tag.It treats the responsibilities of different layers as one and misses the actual verification points.

C. Always roll back the database.It relies on technology names or trends, with no observable evidence from the current requirements.

D. Remove the pod from traffic endpoints, but do not restart it unconditionally if liveness is healthy.A decision that accounts for conditions, working principles, and failure boundaries together.

Capstone Question 3

What counts as reproducible deployment evidence?

Choose an answer

Correct answer A

A. Record the image digest, configuration revision, migrations, tests, and rollout results together.A decision that accounts for conditions, working principles, and failure boundaries together.

B. The fact that it ran once on a developer laptop.It considers only some benefits and omits prerequisites or newly introduced failure boundaries.

C. Record only the number of containers.It treats the responsibilities of different layers as one and misses the actual verification points.

D. Use the Kubernetes logo.It relies on technology names or trends, with no observable evidence from the current requirements.

PRIMARY SOURCES

Course references

This list collects the sources for each chapter. The text and author-created diagrams were prepared by directly reviewing the originals below.

PERSONAL WORKSHEET

A learning worksheet you adapt to your own environment

Your input remains only on the current browser screen and is not stored or transmitted externally. Use categories and pseudonyms instead of actual sensitive information.

OFFICIAL SOURCES

Verify against official sources

Technical, compatibility, and model information reviewed: August 2026

LEARNING RECORD

Have you reviewed the text, decision activities, and all explanations?

Completion status is stored only in this browser.