Skip to main content
Skip table of contents

Setting Priority Classes in DKP Applications

In DKP, your workloads can be prioritized to ensure that your critical components stay running in any situation. 

Priority Classes can be set for any application in DKP, including Platform Applications, Catalog applications, and even your own Custom Applications. 

By default, the priority classes of Platform Applications are set by DKP.

See the following pages for more information about the default priority classes for DKP applications:

This page gives instructions on how you can override the default priority class of any application in DKP to a different one.

DKP Priority Classes 

Here are the priority classes that are available in DKP: 

Class 

Value Name

Value 

Description 

DKP High 

dkp-high-priority

100001000

This is the priority class that is used for high priority DKP workloads.

DKP Critical 

dkp-critical-priority

100002000

This is the highest priority class that is used for critical priority DKP workloads.

Prerequisites

Set the WORKSPACE_NAMESPACE environment variable to the name of the workspace’s namespace where the cluster is attached:

CODE
export WORKSPACE_NAMESPACE=<your_workspace_namespace>

You are now able to copy the following commands without having to replace the placeholder with your workspace namespace every time you run a command.

Set the Priority Class

Follow these steps.

Keep in mind that the overrides for each application appears differently and is dependent on how the application’s helm chart values are configured.

For more information about the helm chart values used in the DKP Platform Applications, see DKP 2.6.0 Components and Applications.

Generally speaking, performing a search for the priorityClassName field allows you to find out how you can set the priority class for a component.

In the example below which uses the helm chart values in Grafana Loki, the referenced priorityClassName field is nested under the ingester component. That said, if you reference the Grafana Loki helm chart values, you’ll see that the priority class can be set for several other components, including distributor, ruler, and on a global level.

  1. Create a ConfigMap with custom priority class configuration values for Grafana Loki. The following example sets the priority class of ingester component to the DKP critical priority class:

    CODE
    cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: ConfigMap
    metadata:
      namespace: ${WORKSPACE_NAMESPACE}
      name: grafana-loki-overrides
    data:
      values.yaml: |
        ingester:
          priorityClassName: dkp-critical-priority
    EOF
  2. Edit the grafana-loki AppDeployment to set the value of spec.configOverrides.name to grafana-loki-overrides (Refer to Deploy a service with a custom configuration for more information).

    CODE
    dkp edit appdeployment -n ${WORKSPACE_NAMESPACE} grafana-loki

    After your editing is complete, the AppDeployment resembles this example:

    CODE
    apiVersion: apps.kommander.d2iq.io/v1alpha3
    kind: AppDeployment
    metadata:
      name: grafana-loki
      namespace: ${WORKSPACE_NAMESPACE}
    spec:
      appRef:
        name: grafana-loki-0.69.16
        kind: ClusterApp
      configOverrides:
        name: grafana-loki-overrides
  3. It will take a few minutes to reconcile, but you can check the ingester pod’s priority class after reconciling:

    CODE
    kubectl get pods -n ${WORKSPACE_NAMESPACE} -o custom-columns=NAME:.metadata.name,PRIORITY:.spec.priorityClassName,PRIORITY:.spec.priority |grep ingester

    It will show something like this:

    CODE
    NAME                                                              PRIORITY                  PRIORITY
    grafana-loki-loki-distributed-ingester-0                          dkp-critical-priority     100002000

For more information about priority classes, see https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.