Skip to content

Commit

Permalink
priorityClass docs #1881
Browse files Browse the repository at this point in the history
  • Loading branch information
domiborges authored and ryanemerson committed Nov 2, 2023
1 parent 62ab2f3 commit c9391b6
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include::{topics}/proc_allocating_storage.adoc[leveloffset=+1]
include::{topics}/ref_persistent_cache_store.adoc[leveloffset=+2]
include::{topics}/proc_allocating_cpu_memory.adoc[leveloffset=+1]
include::{topics}/proc_setting_jvm_options.adoc[leveloffset=+1]
include::{topics}/proc_setting_priority.adoc[leveloffset=+1]

// Downstream content
ifdef::downstream[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@
:helm_chart_docs: https://infinispan.org/docs/helm-chart/main/helm-chart.html

:cryostat_installation: https://cryostat.io/get-started/#installing-cryostat-operator[Installing Cryostat Operator]
:cryostat_security_configuration: https://cryostat.io/guides/#store-credentials[Configuring Cryostat Credentials]
:cryostat_security_configuration: https://cryostat.io/guides/#store-credentials[Configuring Cryostat Credentials]
:pod_priority_reference: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/[Kubernetes: Pod Priority and Preemption]
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@
//
:cryostat_installation: https://access.redhat.com/documentation/en-us/red_hat_build_of_cryostat/2/html/installing_cryostat/index[Installing Cryostat]
:cryostat_security_configuration: https://access.redhat.com/documentation/en-us/red_hat_build_of_cryostat/2/html-single/using_cryostat_to_manage_a_jfr_recording/index#proc_storing-managing-jmx-credentials_assembly_security-options[Configuring Cryostat Credentials]
:pod_priority_reference: https://docs.openshift.com/container-platform/4.14/nodes/pods/nodes-pods-priority.html[Including pod priority in pod scheduling decisions]
56 changes: 56 additions & 0 deletions documentation/asciidoc/topics/proc_setting_priority.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[id='setting-priority_{context}']
= Configuring pod priority

[role="_abstract"]
Create one or more priority classes to indicate the importance of a pod relative to other pods.
Pods with higher priority are scheduled ahead of pods with lower priority, ensuring prioritization of pods running critical workloads, especially when resources become constrained.

.Prerequisites
* Have `cluster-admin` access to {k8s}.

.Procedure
. Define a `PriorityClass` object by specifying its name and value.
+

.high-priority.yaml
[source,yaml]
----
include::yaml/priority_class.yaml[]
----
. Create the priority class.
+
[source,options="nowrap",subs=attributes+]
----
{oc_create} -f high-priority.yaml
----

. Reference the priority class name in the pod configuration.
+
.Infinispan CR
[source,yaml]
----
include::yaml/priority_class_CR.yaml[]
----
+
You must reference an existing priority class name, otherwise the pod is rejected.

. Apply the changes.

.PriorityClass fields
[%header,cols=2*]
|===
| Field | Description

| `PriorityClassName`
| The name of the priority class.

| `PriorityClassValue`
| An integer indicating the priority level. The higher the value, the higher the priority.

| `PriorityClassDescription`
| An optional field for providing context about the priority class.
|===

[role="_additional-resources"]
.Additional resources
* link:{pod_priority_reference}
7 changes: 7 additions & 0 deletions documentation/asciidoc/topics/yaml/priority_class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 1000000
globalDefault: false
description: "Use this priority class for high priority service pods only."
8 changes: 8 additions & 0 deletions documentation/asciidoc/topics/yaml/priority_class_CR.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: Infinispan
...
spec:
scheduling:
affinity:
...
priorityClassName: "high-priority"
...

0 comments on commit c9391b6

Please sign in to comment.