We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Kubernetes Containers
Free preview: the first 2 parts of this 6-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Kubernetes Containers
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
There are two ways to order at a restaurant.
Imperative: "Go to the kitchen. Take out a pan. Heat it to medium-high. Add oil. Wait 30 seconds. Crack two eggs. Cook for 3 minutes. Flip. Cook for 1 minute. Plate it."
Declarative: "I'd like two eggs, over easy."
Both get you eggs. But the declarative approach is resilient. If the pan falls and the eggs break, the chef knows the desired end state (two eggs over easy) and restarts from wherever they need to. With the imperative approach, you'd need a separate set of instructions for every possible failure ("if eggs fall, go back to step 4...").
chose the declarative model for exactly this reason. You describe what you want: 3 replicas of my web server, with 512MB RAM each, exposed on port 80. Kubernetes figures out how to make it happen. If a server crashes and kills a replica, Kubernetes doesn't need new instructions. It sees that reality (2 replicas) doesn't match the desired state (3 replicas) and creates a new one.
This is the core philosophical insight behind Kubernetes. YAML manifests aren't just configuration files. They are declarations of desired state. The entire system is built around a simple loop: observe reality, compare to desired state, take action to close the gap. That loop runs continuously, forever, without human intervention.