Skip to content

PoC for undestanding NonPreemptingPriority Kubernetes Gate feature

Notifications You must be signed in to change notification settings

electrocucaracha/k8s-NonPreemptingPriority-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes NonPreemptingPriority gate feature demo

Build Status License

In Kubernetes, Priority determines the importance of a Pod to other Pods and Preemption is the logic which tries to find a Node to remove one or more low priority Pods to schedule a high priority Pod.

The goal of this project is to clarify those concepts through code examples. This project deploys an All-in-One Kubernetes Cluster with the NonPreemptingPriority feature gate enabled with the installer bash script which is consumed by the Vagrantfile.

Setup

This project uses Vagrant tool for provisioning Virtual Machines automatically. It's highly recommended to use the setup.sh script of the bootstrap-vagrant project for installing Vagrant dependencies and plugins required for its project. The script supports two Virtualization providers (Libvirt and VirtualBox).

$ curl -fsSL http://bit.ly/initVagrant | PROVIDER=libvirt bash

Once Vagrant is installed, it's possible to deploy the demo with the following instruction:

$ vagrant up

Demo

After the All-in-One Kubernetes Cluster is deployed the installer creates two kubernetes cron jobs with different PriorityClass on their pods. The trivial-job executes a counter job every minute and the urgent-job every three minutes. They are using preemptionPolicy: Never to avoid any preemption process.

Demo screenshot

As you can see, the jobs of the urgent-job have preference in the queue during the execution of the jobs without any preempt action over the existing Pods of trivial-job.

About

PoC for undestanding NonPreemptingPriority Kubernetes Gate feature

Topics

Resources

Stars

Watchers

Forks

Languages