PriorityClassName
is a Kubernetes feature used to prioritize Pods within a cluster. It allows you to assign a priority value to Pods, ensuring that high-priority Pods receive preferential treatment when it comes to resource allocation and scheduling.
PriorityClassName is primarily used to define the priority level for a Pod. It involves the following components:
Priority Class: A Kubernetes resource that defines a set of attributes (e.g., priority value) that can be associated with Pods.
Priority Value: An integer value assigned to a Priority Class. Higher values indicate higher priority. Pods with higher priority values are scheduled and allocated resources before Pods with lower priority values.
Default Priority Class: Kubernetes provides a default Priority Class with a priority value of 0. Any Pod that does not specify a Priority Class will be assigned this default priority value.
Kubernetes provides below Priority Classes to help categorize workloads:
system-cluster-critical: Kubernetes system components that are critical to the entire cluster. Priority value: 2000001000
system-node-critical: Kubernetes system components that are critical to individual nodes. Priority value: 2000000000
These two Priority Classes ensure that essential system components receive the necessary resources for the proper functioning of the cluster.
We have used the PriorityClassName
to optimize resource allocation and scheduling in our MetaKube cluster.
In addition to the Kubernetes provided ones, we have defined few more Priority Classes to categorize our workloads based on their importance and resource requirements. Each Priority Class is associated with a priority value.
Below is the list of priorityClassName
that’s used in our cluster:
PriorityClassName | Priority Value | Component |
---|---|---|
kubermatic-master-controller-manager | 500005000 | kubermatic-master-controller-manager |
kubermatic-seed-controller-manager | 500005000 | kubermatic-seed-controller-manager |
user-cluster-apiserver | 500002000 | apiserver |
user-cluster-controller-manager | 500002000 | controller-manager |
user-cluster-scheduler | 500002000 | scheduler |
user-cluster-machine-controller | 500001000 | machine-controller |
user-cluster-kube-state-metrics | 500000000 | kube-state-metrics |
user-cluster-cluster-autoscaler | 500000000 | cluster-autoscaler |
user-cluster-prometheus | 500001000 | prometheus |
user-cluster-etcd | 500002000 | etcd |
user-cluster-nodeport-proxy-envoy | 500005000 | nodeport-proxy-envoy |
user-cluster-csi-cinder-controllerplugin | 500001000 | csi-cinder-controllerplugin |
system-cluster-critical | calico-kube-controllers coredns dns-autoscaler konnectivity-agent metrics-server |
|
system-node-critical | canal kube-proxy user-ssh-keys-agent node-local-dns envoy-agent |
|
For more in-depth and comprehensive information on Kubernetes PriorityClassName and related concepts, we recommend referring to the official Kubernetes documentation.