Workloads

    A workload is an application running on Kubernetes. Whether your workload is a single component or several that work together, on Kubernetes you run it inside a set of pods. In Kubernetes, a represents a set of running on your cluster.

    Kubernetes pods have a defined lifecycle. For example, once a pod is running in your cluster then a critical fault on the where that pod is running means that all the pods on that node fail. Kubernetes treats that level of failure as final: you would need to create a new Pod to recover, even if the node later becomes healthy.

    Kubernetes provides several built-in workload resources:

    • Deployment and (replacing the legacy resource ReplicationController). Deployment is a good fit for managing a stateless application workload on your cluster, where any Pod in the Deployment is interchangeable and can be replaced if needed.
    • defines that provide node-local facilities. These might be fundamental to the operation of your cluster, such as a networking helper tool, or be part of an add-on.
      Every time you add a node to your cluster that matches the specification in a DaemonSet, the control plane schedules a Pod for that DaemonSet onto the new node.
    • and CronJob define tasks that run to completion and then stop. Jobs represent one-off tasks, whereas CronJobs recur according to a schedule.

    In the wider Kubernetes ecosystem, you can find third-party workload resources that provide additional behaviors. Using a , you can add in a third-party workload resource if you want a specific behavior that’s not part of Kubernetes’ core. For example, if you wanted to run a group of Pods for your application but stop work unless all the Pods are available (perhaps for some high-throughput distributed task), then you can implement or install an extension that does provide that feature.

    To learn about Kubernetes’ mechanisms for separating code from configuration, visit Configuration.

    There are two supporting concepts that provide backgrounds about how Kubernetes manages pods for applications:

    • The removes Jobs once a defined time has passed since they completed.