There are three different cases we need to test when the user inputs a default setting for Priority Class
:
- Install
Longhorn
with nopriority-class
set in the default settings. ThePriority Class
setting should be empty after the installation completes according to thelonghorn-ui
, and the defaultPriority
of allPods
in thelonghorn-system
namespace should be0
:
~ kubectl -n longhorn-system describe pods | grep Priority
# should be repeated many times
Priority: 0
- Install
Longhorn
with a nonexistentpriority-class
in the default settings. The system should fail to come online. ThePriority Class
setting should be set and the status of theDaemon Set
for thelonghorn-manager
should indicate that the reason it failed was due to an invalidPriority Class
:
~ kubectl -n longhorn-system describe lhs priority-class
Name: priority-class
...
Value: nonexistent-priority-class
...
~ kubectl -n longhorn-system describe daemonset.apps/longhorn-manager
Name: longhorn-manager
...
Priority Class Name: nonexistent-priority-class
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulCreate 23s daemonset-controller Created pod: longhorn-manager-gbskd
Normal SuccessfulCreate 23s daemonset-controller Created pod: longhorn-manager-9s7mg
Normal SuccessfulCreate 23s daemonset-controller Created pod: longhorn-manager-gtl2j
Normal SuccessfulDelete 17s daemonset-controller Deleted pod: longhorn-manager-9s7mg
Normal SuccessfulDelete 17s daemonset-controller Deleted pod: longhorn-manager-gbskd
Normal SuccessfulDelete 17s daemonset-controller Deleted pod: longhorn-manager-gtl2j
Warning FailedCreate 4s (x14 over 15s) daemonset-controller Error creating: pods "longhorn-manager-" is forbidden: no PriorityClass with name nonexistent-priority-class was found
- Install
Longhorn
with a validpriority-class
in the default settings. ThePriority Class
setting should be set according to thelonghorn-ui
, and all thePods
in thelonghorn-system
namespace should have the rightPriority
set:
~ kubectl -n longhorn-system describe pods | grep Priority
# should be repeated many times
Priority: 2000001000
Priority Class Name: system-node-critical