Concepts

Edit This Page

Poseidon-Firmament Scheduler

FEATURE STATE: Kubernetes v1.6 alpha
This feature is currently in a alpha state, meaning:

  • The version names contain alpha (e.g. v1alpha1).
  • Might be buggy. Enabling the feature may expose bugs. Disabled by default.
  • Support for feature may be dropped at any time without notice.
  • The API may change in incompatible ways in a later software release without notice.
  • Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.

The Poseidon-Firmament scheduler is an alternate scheduler that can be deployed alongside the default Kubernetes scheduler.

Introduction

Poseidon is a service that acts as the integration glue between the Firmament scheduler and Kubernetes. Poseidon-Firmament augments the current Kubernetes scheduling capabilities. It incorporates novel flow network graph based scheduling capabilities alongside the default Kubernetes scheduler. The Firmament scheduler models workloads and clusters as flow networks and runs min-cost flow optimizations over these networks to make scheduling decisions.

Firmament models the scheduling problem as a constraint-based optimization over a flow network graph. This is achieved by reducing scheduling to a min-cost max-flow optimization problem. The Poseidon-Firmament scheduler dynamically refines the workload placements.

Poseidon-Firmament scheduler runs alongside the default Kubernetes scheduler as an alternate scheduler. You can simultaneously run multiple, different schedulers.

Flow graph scheduling with the Poseidon-Firmament scheduler provides the following advantages:

  • Workloads (Pods) are bulk scheduled to enable scheduling at massive scale.
    The Poseidon-Firmament scheduler outperforms the Kubernetes default scheduler by a wide margin when it comes to throughput performance for scenarios where compute resource requirements are somewhat uniform across your workload (Deployments, ReplicaSets, Jobs).
  • The Poseidon-Firmament’s scheduler’s end-to-end throughput performance and bind time improves as the number of nodes in a cluster increases. As you scale out, Poseidon-Firmament scheduler is able to amortize more and more work across workloads.
  • Scheduling in Poseidon-Firmament is dynamic; it keeps cluster resources in a global optimal state during every scheduling run.
  • The Poseidon-Firmament scheduler supports scheduling complex rule constraints.

How the Poseidon-Firmament scheduler works

Kubernetes supports using multiple schedulers. You can specify, for a particular Pod, that it is scheduled by a custom scheduler (“poseidon” for this case), by setting the schedulerName field in the PodSpec at the time of pod creation. The default scheduler will ignore that Pod and allow Poseidon-Firmament scheduler to schedule the Pod on a relevant node.

For example:

apiVersion: v1
kind: Pod
...
spec:
    schedulerName: poseidon
...

Batch scheduling

As mentioned earlier, Poseidon-Firmament scheduler enables an extremely high throughput scheduling environment at scale due to its bulk scheduling approach versus Kubernetes pod-at-a-time approach. In our extensive tests, we have observed substantial throughput benefits as long as resource requirements (CPU/Memory) for incoming Pods are uniform across jobs (Replicasets/Deployments/Jobs), mainly due to efficient amortization of work across jobs.

Although, Poseidon-Firmament scheduler is capable of scheduling various types of workloads, such as service, batch, etc., the following are a few use cases where it excels the most:

  1. For “Big Data/AI” jobs consisting of large number of tasks, throughput benefits are tremendous.
  2. Service or batch jobs where workload resource requirements are uniform across jobs (Replicasets/Deployments/Jobs).

Feature state

Poseidon-Firmament is designed to work with Kubernetes release 1.6 and all subsequent releases.

Caution: Poseidon-Firmament scheduler does not provide support for high availability; its implementation assumes that the scheduler cannot fail.

Feature comparison

Feature comparison of Kubernetes and Poseidon-Firmament schedulers.
FeatureKubernetes Default SchedulerPoseidon-Firmament SchedulerNotes
Node Affinity/Anti-AffinityYY
Pod Affinity/Anti-Affinity - including support for pod anti-affinity symmetryYYThe default scheduler outperforms the Poseidon-Firmament scheduler pod affinity/anti-affinity functionality.
Taints & TolerationsYY
Baseline Scheduling capability in accordance to available compute resources (CPU & Memory) on a nodeYY† Not all Predicates & Priorities are supported with Poseidon-Firmament.
Extreme Throughput at scaleY†Y Bulk scheduling approach scales or increases workload placement. Firmament scheduler offers high throughput when resource requirements (CPU/Memory) for incoming Pods are uniform across ReplicaSets/Deployments/Jobs.
Colocation Interference AvoidanceNN
Priority PreemptionYN† Partially exists in Poseidon-Firmament versus extensive support in Kubernetes default scheduler.
Inherent ReschedulingNY† Poseidon-Firmament scheduler supports workload re-scheduling. In each scheduling run, Poseidon-Firmament considers all Pods, including running Pods, and as a result can migrate or evict Pods – a globally optimal scheduling environment.
Gang SchedulingNY
Support for Pre-bound Persistence Volume SchedulingYY
Support for Local Volume & Dynamic Persistence Volume Binding SchedulingYN
High AvailabilityYN
Real-time metrics based schedulingNY† Partially supported in Poseidon-Firmament using Heapster (now deprecated) for placing Pods using actual cluster utilization statistics rather than reservations.
Support for Max-Pod per nodeYYPoseidon-Firmament scheduler seamlessly co-exists with Kubernetes default scheduler.
Support for Ephemeral Storage, in addition to CPU/MemoryYY

Installation

The Poseidon-Firmament installation guide explains how to deploy Poseidon-Firmament to your cluster.

Performance comparison

Note: Please refer to the latest benchmark results for detailed throughput performance comparison test results between Poseidon-Firmament scheduler and the Kubernetes default scheduler.

Pod-by-pod schedulers, such as the Kubernetes default scheduler, process Pods in small batches (typically one at a time). These schedulers have the following crucial drawbacks:

  1. The scheduler commits to a pod placement early and restricts the choices for other pods that wait to be placed.
  2. There is limited opportunities for amortizing work across pods because they are considered for placement individually.

These downsides of pod-by-pod schedulers are addressed by batching or bulk scheduling in Poseidon-Firmament scheduler. Processing several pods in a batch allows the scheduler to jointly consider their placement, and thus to find the best trade-off for the whole batch instead of one pod. At the same time it amortizes work across pods resulting in much higher throughput.

What's next

Feedback