Adding and removing Workloads

Learn how to work with Workloads in Humanitec.

What is a Workload?

A Workload in Humanitec represents the code that will run in a Kubernetes cluster, mostly as a pod. A Workload is made up of one or more Containers alongside their configuration. In most cases, a Workload will be some kind of back-end service or a front-end of some application. For example, in a micro-service architecture, each service would be represented by a Workload in Humanitec.

Adding a Workload

You need to add a Workload to a Draft in order to deploy it.

Adding a Workload will create a new Workload Resource along with its Pods in the Kubernetes cluster when it is deployed. If you want to add a Container Image as a sidecar in an existing workload, see Add Sidecar Containers.

UI
CLI
API
UI
  1. Start in the App Details Screen​

  2. Ensure that the Draft is selected.

  3. Click the "Select container image" drop-down in the "Create new Workload" card.

  4. Select the the container image you want to use in the Workload. (You can add additional sidecar containers later.)

  5. If the list is long, you can search for container images in the search bar.

  6. Choose an ID for the workload. The ID must be a valid Humanitec ID and cannot be changed later.

  7. Click the "Create" button to create the workload in the App.

Steps 1-3 of adding a Workload in the UI
Steps 4-7 of adding a Workload in the UI
CLI

Our CLI is currently in closed beta. Please contact us if you want to learn more.

API

Adding a Workload is the equivalent to adding a module to a Delta in the API. See Deployment Deltas in the API Documentation for more details.

Duplicate a Workload

Sometimes, multiple workloads in an App share very similar configuration. In this case it can be useful to duplicate a Workload.

Duplicating a Workload will create a copy of the configuration of that Workload. The Workloads will be independent from each other from that point forward.

UI
CLI
API
UI
  1. Start in the App Details Screen​

  2. Ensure that the Draft is selected.

  3. Click the … button on the Workload to duplicate.

  4. Select "Duplicate" from the menu that appears.

  5. Choose an ID for the duplicated Workload. The ID must be a valid Humanitec ID and cannot be changed later.

  6. Click the "Create" button to create the workload in the App.

  7. If you wish to cancel this action, click the "Cancel" button.

Steps 1 - 4 of duplicating a Workload in the UI
Steps 5-7 of duplicating a Workload in the UI
CLI

Our CLI is currently in closed beta. Please contact us if you want to learn more.

API

Duplicating a Workload is the equivalent to adding a module to a Delta in the API. See Deployment Deltas in the API Documentation for more details.

Remove a Workload

Sometimes, multiple workloads in an App share very similar configuration. In this case it can be useful to duplicate a Workload.

UI
CLI
API
UI
  1. Start in the App Details Screen​

  2. Ensure that the Draft is selected.

  3. Click the … button on the Workload to duplicate.

  4. Select "Remove" from the menu that appears.

  5. The workload card will now have a red border to indicate it will be removed on the next deployment.

  6. Click the "Restore" button if you want to revert the remove action in this Draft.

Steps 1-4 of removing a Workload in the UI
Steps 5 & 6 of removing a Workload in the UI
CLI

Our CLI is currently in closed beta. Please contact us if you want to learn more.

API

Removing a Workload is the equivalent to removing a module to a Delta in the API. See Deployment Deltas in the API Documentation for more details.