Let's Explore Kubernetes:

Workloads

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

In this section:

Introduction

Now Tommy has a standardised way to package his ingredients, kitchen utensils and any other equipment needed for making his famous burger.

His next challenge is to resolve how the prep chefs in the kitchen make the burger available to the customers.

In this section:

What is a Workload?

Customer satisfaction is important to Tommy’s business, and he therefore recognises that customers will want flexibility and customisations when ordering from his menu.

In order to succeed however, Tommy still needs to have a standardised way to handle these customer requests.

Poppy proposes defining courses in a menu that customers can order from, such as a burger or dessert. Each course comes with a description of how each dish is made and what customisations can be made to it.

A Workload refers to the things users can request from the code. To standardise handling these requests, developers write detailed instruction files on how to complete each request. These files specify which containers to run, the number of instances, and settings, including user customisations, to complete each Workload.

Checkpoint Click here to check in and see what you've learned so far

- Workload: This refers to the things that you want to run on a Kubernetes cluster like applications, services or batch jobs. It can be a single container or a group of containers that make up a distributed application.

- As developers are the ones who created the code, it makes sense for them to be able to define to the users what can and cannot be requested from their application. For example, the chef would write a detailed menu as they are the ones who understand the dishes best.

- Workload resources make it much easier for developers to manage sets of pods, instead of having to manage each pod directly. They also provide a way to tell your container orchestration platform (e.g. Kubernetes) how to run your code. More on that later...

Benefits of Workloads

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.

Flexibility

In the restaurant, Tommy can easily update the menu and have it reflected in the restaurant's operations. New food items can be added, recipes can be modified or dishes removed, without disrupting the overall functioning of the kitchen.

Depending on the ingredients Tommy has on a specific day, the restaurant menu can be easily updated. For example, Tommys butcher has new sausages and Tommy is keen to add a hotdog to the menu after numerous requests from customers.

Workloads allow developers to easily update the options available to the users without disrupting existing workflows. If the IT Business wanted to replace the Volume Boost functionality with a Bass Boost, this is easily achieved through Workloads.

Organisation

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.

Before service, Tommy can provide details to his staff of the restaurant capacity, the reservations which can be expected, and therefore what needs to be prepared to meet this expected demand.

In Kubernetes, Workloads specify how many containers need to be prepared for each audio option, how many replicas of the Workload to make and when the containers should be run – ensuring user requests can be handled smoothly.

Standardisation

Prep chefs can define their desired state for each patty in a detailed recipe and let the digitised restaurant management system that Poppy setup calculate the logistics of what ingredients are required and which table to send them to. The table chef can then cook to perfection.

An example for Tommy is that a Prep Chef has created a spicy version of Tommy’s burger. With a new detailed recipe and update to the menu, any prep chef can now create the spicy burger, enhancing productivity and minimising operational overhead.

This standardised approach means that Workloads provide all the details to run any of the audio options. So where previously only one developer would know all the details of how to deploy a specific audio option, now any developer can deploy any audio option via its corresponding Workload.

Checkpoint Click here to check in and see what you've learned so far

- Flexibility: Defining Workloads makes it easy for developers to apply updates and changes without disrupting existing workflows.

- Organisation: As Workloads provide detailed instructions of how to run each audio request, this information can be used to make development more efficient.

- Standardisation: Workloads provide standardised definitions of how to deploy a developer's code, including all the details of how to deploy any corresponding containers.

- Container Orchestration: Kubernetes uses Workloads to automatically deploy and manage containers, finding the most efficient and organised way to do this.

In summary, Workloads provide standardised definitions of how to deploy a developer's code, including all the details of how to deploy any corresponding containers. Defining Workloads in this way make it easy for developers to make updates and changes without disrupting existing workflows. A container orchestration system such as Kubernetes can then use this information to automatically deploy and manage containers, finding the most efficient and organised way to do this.

Section Recap

In this section we learned...

A Workload describes what can be requested from code

Workloads can be easily adapted by developers without disrupting existing workflows

Defining Workloads means developers can organise the containers needed without any bottlenecks or delays

Workloads help to standardise all requests that can be made from the code so any developer can deploy them regardless of their current subject knowledge

Next Section

Now we can define what can be requested from code using Workloads, we will next look at how we can use Kubernetes to efficiently deliver Workloads.

Next Kubernetes