Opens in a new tab
Explainer

How a container image becomes a working service

In brief

Follow a packaged program through Kubernetes placement, health checks and resources, then trace the customer job it still needs to finish.

4 min read

Is this the right starting point?
Before you read
No container or Kubernetes experience required; basic awareness of programs and web services is helpful.
What you will take away
Distinguish images, running containers, Kubernetes controllers and probes from successful completion of a customer operation.
Sources
An open worker gate admits job tiles, but its storage tether stops short of the durable reel and the jobs remain inside.
On this page4 sections

A container starts a program from a packaged image. Kubernetes can arrange running copies of that program, replace missing ones and manage a rollout. Following that journey makes both technologies easier to understand, including the point where the application must finish the work it accepted.

Consider a hypothetical report service. Its readiness endpoint answers, and a customer submits an export. The worker cannot reach durable storage, so the promised file never arrives. Nothing about the green endpoint tells us where that particular job stopped. To find out, we need to follow the package into its running environment and then follow the request through it.

The image travels with the program

The image contains the program and its filesystem. A container starts a process from that image with isolation supplied by the host. The same image can start many containers. Each still runs with actual configuration, mounted storage, resource settings and services it must reach.

A registry stores the images that machines retrieve. A tag gives an image a name, while a digest identifies particular content. Keeping the same content is useful when comparing deployments, but it does not keep every surrounding condition the same. Change a storage setting and an unchanged program can behave differently.

A Linux container uses the kernel of its host, including when that host is itself a virtual machine. The application still has to handle signals, failures and persistent state. Starting another copy of its image cannot by itself tell us whether an accepted report job has finished or which files survived.

Kubernetes keeps working toward the requested arrangement

Kubernetes runs containers inside Pods, the units it schedules. Containers in a Pod share networking and can share storage resources. Suppose a ReplicaSet is maintaining several matching worker Pods and one disappears. The observed count is now below the requested count, so the controller works to replace the missing copy.

This comparison repeats as conditions change. A Deployment manages ReplicaSets through version changes, letting the platform work toward the declared arrangement without someone replacing every instance by hand.

That is a useful division of work. Kubernetes can manage placement, startup and replacement. Our application still needs to account for the report the missing worker was processing. A restored Pod count answers one part of the incident; the unfinished job supplies the next question.

Give each health check a useful job

Readiness asks whether an instance should receive traffic. A failing readiness check removes it from normal service traffic. Liveness looks for a condition where restarting the container is appropriate. If every instance is waiting on the same slow dependency, restarting all of them may leave that dependency just as slow.

Startup deserves its own allowance. A program that needs time to initialize can be restarted repeatedly if liveness checks judge it too early. Kubernetes startup probes defer readiness and liveness probing until startup succeeds. Choose that allowance from the program's startup behavior, and also check that genuine startup failure is detected.

Resources introduce another set of conditions. Requests influence whether Kubernetes can find a place to schedule a Pod. Once it runs, a CPU limit can throttle the program, slowing its work. Memory pressure can lead to out-of-memory termination before a file finishes. The resource-management guidance explains those mechanisms. They can all leave a customer waiting, though each differs from the storage-access problem in our opening example.

Find where the report stopped

For our worker, compare what the readiness probe checks with the steps needed to finish the export. Inspect the deployed resources and its access to durable storage. A probe that never attempts that storage operation cannot establish whether this job will complete.

Replacing the worker also leaves questions about work already done. A file may exist, a job may still be waiting and the dependency may remain unavailable. Follow one accepted request through completion alongside the platform's account of which processes are running.

Find the rollout stage that failed
Find the rollout stage that failed. The stages point to different evidence: scheduling, image retrieval, startup and readiness. A completed rollout still needs user-facing checks. Startup probes can give slow initialization its own allowance.
The stages point to different evidence: scheduling, image retrieval, startup and readiness. A completed rollout still needs user-facing checks. Startup probes can give slow initialization its own allowance.
Read diagram description

The stages point to different evidence: scheduling, image retrieval, startup and readiness. A completed rollout still needs user-facing checks. Startup probes can give slow initialization its own allowance. Diagram labels: Pod scheduled?: Placement and resource constraints; Image fetched?: Registry, identity and image reference; Container started?: Configuration, dependencies and startup behavior; Ready for traffic?: Readiness evidence and dependency behavior; User operation succeeds?: Latency, correctness and asynchronous completion.

After a new version receives traffic, compare latency and correctness with the earlier version. A canary comparison can inform a rollback decision where the application and stored data remain compatible with that path.

On a managed platform, the application owner may have no direct control over storage. A documented completion signal and reachable support route can still locate the unfinished stage and get it investigated. Asking where the report stopped does not require owning every machine it touched.

The image tells us what program was packaged. The controllers and probes tell us what the platform started and observed. When we connect those records to the customer's completed download, we can explain the whole service instead of stopping at the running container.

Sources & context

Sources linked in this article. Read alongside the author’s analysis; a citation does not independently verify a publisher’s claims.

Report an error or outdated detail

Keep reading

Where to go next