You’re reading the free preview.Unlock every conversation for €2.99
FreeFree previewChapter 9

Chapter 9 · Free preview
From Code to Production
What you will understand
- Write a Dockerfile for a simple application
- Explain the difference between a Docker image and a container
- Describe what Kubernetes does and why it is needed
- Explain the role of pods, deployments and services in Kubernetes
- Build, tag and push a container image to a registry
Written by EduVerse for this preview; the slides below are the book’s own words.
Slides from the chapter
Each slide is a passage from the book with the figure or listing it talks about. Swipe, use the arrow keys or the buttons.
Slide 1 of 4
Containers: Shipping the Environment
9.4 · p. 199
Conversation from The Software Realm, Decoded
Chapter 9 · 9.4 Containers: Shipping the Environment · p. 199

Senior developer
Here’s the breakthrough: what if each app could bring its own environment?

Peter
Like... packaging the app with Java 17 and all libraries?

Senior developer
Exactly! That’s a container. Your app + everything it needs to run, packaged together.
Think of a restaurant. The old way:
- Shared kitchen: All chefs use same kitchen (shared server)
- One stove: If someone needs high heat and another needs low heat, conflict!
- Shared ingredients: Someone uses all the salt, others can’t cook
- Mess: Cleanup from one chef affects others

Senior developer
With containers:
- Each chef gets their own mobile kitchen (food trucks for instance)
- Complete setup: stove, ingredients, utensils, everything
- Self-contained: doesn’t interfere with others
- Can park anywhere: any lot (any server)

Peter
So a container is like a food truck for my app?

Senior developer
Perfect! The food truck has everything needed to make your specific dish. It can park at any festival (any server). Multiple trucks can park together without interfering.
Virtual Machines vs Containers
9.4.1 · p. 200
Conversation from The Software Realm, Decoded
Chapter 9 · 9.4.1 Virtual Machines vs Containers · p. 200

Peter
Wait, isn’t that just a virtual machine?

Senior developer
Good question. They solve similar problems differently. Let me draw it.
What the book shows with it
Figure from The Software Realm, Decoded
Chapter 9 · 9.4.1 Virtual Machines vs Containers · p. 200
Explore this figure
Pick one to highlight it and read what the book says about it.
Other labels in the figure (12)
Description
Two side-by-side stacks. 'Virtual Machines': App A, App B and App C each sit on their own 'Guest OS (4GB)' above a 'Hypervisor' and 'Host OS', noted 'Each VM: Full OS (Heavy)'. 'Containers': App A, App B and App C, each '+libs', sit on a 'Container Runtime' and 'Host OS', noted 'Share Host OS (Light)'.
Description written by EduVerse; the figure itself is from the book.
Kubernetes: The Desired State Engine
9.7 · p. 204
Conversation from The Software Realm, Decoded
Chapter 9 · 9.7 Kubernetes: The Desired State Engine · p. 204

Senior developer
Kubernetes is not just a way to run containers. It’s a system that maintains your desired state.
Think of a thermostat in your house.
Traditional approach (manual heater):
- Temperature drops → You notice → You turn on heater
- Temperature rises → You notice → You turn off heater
- You’re constantly monitoring and adjusting
Thermostat approach:
- You set: “Keep it at 21°C”
- Thermostat checks constantly
- Too cold? Turn on heat
- Too hot? Turn off heat
- You declare intent, it maintains reality

Peter
So Kubernetes is a thermostat for servers?

Senior developer
Exactly! You declare: “I want 3 copies of my app running”. Kubernetes constantly ensures that’s true.
Slide 1 of 4
Try it yourself
A simulation built by EduVerse around this chapter. It runs in your browser; nothing is sent anywhere.
The full chapter
This preview shows 5 of the chapter’s 47 passages. The full chapter has:
- 10 sections
- 35 conversations
- 9 figures and tables
- 2 What They Say boxes
- 7 knowledge-check questions
Sections in this chapter
- 9.1The Old Way: Just Copy Everything
- 9.2From Source Code to Artifact
- 9.3The Environment Problem
- 9.4Containers: Shipping the Environment
- 9.5Docker: Building and Running Containers
- 9.6The Scaling Problem
- 9.7Kubernetes: The Desired State Engine
- 9.8Cloud-Native Mindset
- 9.9The Kubernetes Ecosystem
- 9.10Peter's Takeaways