Discovering Kubernetes Workloads

Objectives

After completing this lesson, you will be able to:
  • Define Kubernetes workloads
  • Compare different types of Kubernetes workloads
  • Identify the best workload type for your application

Kubernetes Workloads

Usage Scenario

You're a developer who wants to deploy an application to Kubernetes. You want to understand the concepts of Kubernetes workloads and learn which workload type is most suitable for your application.

What is a Kubernetes Workload?

In Kubernetes, a workload is a containerized application operated and orchestrated by Kubernetes. So, as a developer, you decide which workload type is best for your application.

Stateless Versus Stateful Workloads

Before considering the different types of workloads, you must first understand the difference between stateless and stateful workloads:

The decision on whether to deploy a stateful or stateless application is important and should be considered carefully. If you choose the wrong workload type, you might encounter problems later on.

Kubernetes Workload Types

Kubernetes comes with different workload types. Each workload type has its own advantages and disadvantages. The workload type that you choose depends on your application and your requirements.

Why should you use workloads instead of creating and managing Pods directly? The answer is simple: Workloads are higher-level objects that abstract the underlying Pods. When using workloads, you don't have to manage the Pods directly. Instead, you can manage the workload, and Kubernetes takes care of managing the Pods.

Click on the buttons below to discover details about the main workload types and their purpose. All of them are available in SAP BTP, Kyma runtime.

Additional Workload Type in SAP BTP, Kyma Runtime

In SAP BTP, Kyma runtime, you can add the Serverless module to your Kyma cluster. The module offers a serverless runtime for building, running, and managing serverless applications, such as Functions.

In this context, serverless means that you can simply deploy your code without having to worry about the underlying infrastructure. A benefit of using serverless is that it significantly reduces implementation and operational effort. This allows you to focus solely on your code.

Definition of Function

DetailDescriptionExplanation
FunctionA Function is a serverless workload type.Use a Function, if you want to run code without providing a container image. You can use it to deploy a simple API that is triggered to process some data (batch job) or a simple API that is triggered by an event.

Summary

Workloads abstract the underlying Pods. They are higher-level objects that allow you to manage your application in a more convenient way. Kubernetes comes with different workload types that are suitable for different use cases. The workload type that you choose depends on your application and your requirements.

Further Reading about Kubernetes Workload Concepts