Use your own priority classes#
This guide shows you how to run the stack’s pods under the PriorityClasses your cluster already defines.
By default, the stack creates one class named high-priority and assigns it to every pod.
Pick a class for each role#
The stack splits its pods into two roles.
capturePods that ingest metrics, logs, or traces, or that route alerts. Losing one of them loses data or alerts.
queryPods that only answer queries. They can wait while a node runs short of memory.
Choose an existing class for each role.
Give capture a class at least as high as query.
kubectl get priorityclasses
Set the classes#
Set create: false so the stack no longer creates high-priority, and name your classes.
const config = mergeConfig({
// required cluster values ...
priorityClasses: {
create: false,
capture: 'tier-critical',
query: 'tier-high',
},
});
Important
The classes you name must exist before the stack syncs.
Kubernetes rejects a pod that names a missing PriorityClass, and the workload stays at zero ready replicas.
If you only want different classes and still want the library’s high-priority class to exist, keep create: true.
Roll out the change#
Synthesize and deploy your integration chart.
npx cdk8s synth
The Helm-managed workloads and the Thanos workloads pick up the new priorityClassName with their next rollout.
If you set create: false on a cluster that already runs the stack, the high-priority class leaves the manifests, and ArgoCD deletes it when pruning is on.
Running pods keep their priority, but any other workload that still names high-priority can no longer create pods.
Check for such workloads before you sync.
kubectl get pods -A -o custom-columns=NS:.metadata.namespace,POD:.metadata.name,PRIO:.spec.priorityClassName | grep high-priority
Verify#
List the priority class of every pod in the monitoring namespace.
kubectl get pods -n monitoring -o custom-columns=POD:.metadata.name,PRIO:.spec.priorityClassName
Each pod shows the class of its role. The role of every workload is listed in Configuration options.
See also#
Pod priority — why the stack splits its pods into two roles.
Sync waves — when the
high-priorityclass is created.