Learning Objectives
Understand what a Workload is
Understand how Workloads help developers manage sets of pods
Learn how to make informed decisions about workload strategies
Tommy now has a standardised way to package his ingredients, kitchen utensils, and other equipment for making his famous burger.
His next challenge is defining what customers can order and how the restaurant should prepare each order reliably.
| Restaurant reference | Kubernetes reference | Meaning |
|---|---|---|
| Menu item | Workload resource | A written definition of what should run, which containers it uses, and how Kubernetes should keep it running. |
| Number of servings | Replica count | The desired number of matching pods Kubernetes should maintain. |
| Customer preferences | Configuration | Settings that change behaviour without changing the packaged application image. |
Customer satisfaction is important to Tommy's business, so he recognises that customers will want flexibility and customisation when ordering from the menu.
To succeed, Tommy still needs a standardised way to describe each menu item and the rules for preparing it.
- Workload: An application or task that you want to run on a Kubernetes cluster, such as a web application, service, or batch job.
- Workload resource: A Kubernetes definition, such as a Deployment or Job, that tells the platform how pods should be created and maintained.
- Developers manage workload resources rather than manually managing each pod one by one.
If Tommy can clearly define what the customers can request from the menu, this will bring a number of benefits. Let’s take a look at those benefits.
In the restaurant, Tommy can update the menu and have the change reflected in operations. New food items can be added, recipes can be modified, or dishes can be removed without redesigning the whole kitchen.
In Tommy’s restaurant you can plan by specifying how much of each food item should be prepared, how many servings to make and when to start cooking.
Prep chefs can define the desired state for each patty in a detailed recipe and let the digitised restaurant management system calculate the logistics of which ingredients are required and which table should receive them. The table chef can then cook to the same standard.
- Flexibility: Defining workloads makes it easier for developers to apply updates without disrupting unrelated parts of the application.
- Organisation: Workload resources describe the pods and settings required to run application work.
- Standardisation: Workload resources provide repeatable definitions for deploying code and maintaining the required pods.
- Container orchestration: Kubernetes uses workload resources to create, replace, and manage pods automatically.
In summary, workloads are the application work that should run on Kubernetes, and workload resources are the definitions Kubernetes uses to create and maintain pods. This gives developers a repeatable way to update, organise, and scale application work.
In this section we learned...
A workload is application work running on Kubernetes
Workload resources describe the pods, replicas, and settings Kubernetes should maintain
Defining workloads gives teams a repeatable way to organise containers and pods
Kubernetes uses workload resources to create, replace, and scale pods automatically
Now we can define application work using Workloads, we will next look at how Kubernetes coordinates that work.