pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.24k stars 499 forks source link

Feature Request: Able to specify priority class #910

Closed cofyc closed 5 years ago

cofyc commented 5 years ago

Feature Request

Is your feature request related to a problem? Please describe:

For TiKV pods which use local PVs in production for high performance may be stuck in pending because the nodes which have available PVs are out of CPU/Memory.

In this scenario, we can give TiKV pods a higher priority. Then it can preempt other low priority pods.

Describe the feature you'd like:

Able to specify pod priorityClassName in TiDBCluster CRD.

Uses can add customized priority classes into the cluster or uses builtin priority classes.

This also prevents the TiKV pods from being evicted by the kubelet. In practice, the builtin system-node-critical priority class is a good fit for TiKV pods.

apiVersion: scheduling.k8s.io/v1beta1
description: Used for system critical pods that must not be moved from their current
  node.
kind: PriorityClass
metadata:
  name: system-node-critical
value: 2000001000

We can also allow a priority class to be set for PD/TiDB pods. It's up to the user whether to use this feature.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#how-to-use-priority-and-preemption

cofyc commented 5 years ago

closed via https://github.com/pingcap/tidb-operator/pull/940.