diff --git a/deploy/chart/local-path-provisioner/README.md b/deploy/chart/local-path-provisioner/README.md index 8980442a..7c0c3bac 100644 --- a/deploy/chart/local-path-provisioner/README.md +++ b/deploy/chart/local-path-provisioner/README.md @@ -74,6 +74,8 @@ default values. | `nodeSelector` | Node labels for Local Path Provisioner pod assignment | `{}` | | `tolerations` | Node taints to tolerate | `[]` | | `affinity` | Pod affinity | `{}` | +| `priorityClassName` | Priority class name for the main provisioner pod | `""` | +| `configmap.helperPod.priorityClassName` | Priority class name for the helper pod | `"system-node-critical"` | | `configmap.setup` | Configuration of script to execute setup operations on each node | #!/bin/sh
while getopts "m:s:p:" opt
do
 case $opt in
  p)
  absolutePath=$OPTARG
  ;;
  s)
  sizeInBytes=$OPTARG
  ;;
  m)
  volMode=$OPTARG
  ;;
 esac
done
mkdir -m 0777 -p ${absolutePath} | | `configmap.teardown` | Configuration of script to execute teardown operations on each node | #!/bin/sh
while getopts "m:s:p:" opt
do
 case $opt in
  p)
  absolutePath=$OPTARG
  ;;
  s)
  sizeInBytes=$OPTARG
  ;;
  m)
  volMode=$OPTARG
  ;;
 esac
done
rm -rf ${absolutePath} | | `configmap.name` | configmap name | `local-path-config` | @@ -86,6 +88,18 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm $ helm install ./deploy/chart/local-path-provisioner --name local-path-storage --namespace local-path-storage --set storageClass.provisionerName=rancher.io/local-path ``` +To set a priority class for the provisioner pod: + +```console +$ helm install ./deploy/chart/local-path-provisioner --name local-path-storage --namespace local-path-storage --set priorityClassName=high-priority +``` + +To set different priority classes for both main and helper pods: + +```console +$ helm install ./deploy/chart/local-path-provisioner --name local-path-storage --namespace local-path-storage --set priorityClassName=high-priority --set configmap.helperPod.priorityClassName=system-cluster-critical +``` + Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, diff --git a/deploy/chart/local-path-provisioner/templates/configmap.yaml b/deploy/chart/local-path-provisioner/templates/configmap.yaml index 1bfbcc0a..3ae3aff8 100644 --- a/deploy/chart/local-path-provisioner/templates/configmap.yaml +++ b/deploy/chart/local-path-provisioner/templates/configmap.yaml @@ -44,7 +44,9 @@ data: {{- toYaml . | nindent 8 }} {{- end }} spec: - priorityClassName: system-node-critical + {{- if .Values.configmap.helperPod.priorityClassName }} + priorityClassName: {{ .Values.configmap.helperPod.priorityClassName }} + {{- end }} tolerations: - key: node.kubernetes.io/disk-pressure operator: Exists diff --git a/deploy/chart/local-path-provisioner/templates/deployment.yaml b/deploy/chart/local-path-provisioner/templates/deployment.yaml index 789e7298..f70ff609 100644 --- a/deploy/chart/local-path-provisioner/templates/deployment.yaml +++ b/deploy/chart/local-path-provisioner/templates/deployment.yaml @@ -25,6 +25,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ template "local-path-provisioner.serviceAccountName" . }} + {{- if .Values.priorityClassName }} + priorityClassName: {{ .Values.priorityClassName }} + {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: diff --git a/deploy/chart/local-path-provisioner/values.yaml b/deploy/chart/local-path-provisioner/values.yaml index 0a3874f3..97b052a9 100644 --- a/deploy/chart/local-path-provisioner/values.yaml +++ b/deploy/chart/local-path-provisioner/values.yaml @@ -146,6 +146,9 @@ tolerations: [] affinity: {} +# Priority class name for the pod +priorityClassName: "" + podDisruptionBudget: enabled: false @@ -167,6 +170,8 @@ configmap: name: "helper-pod" annotations: {} tolerations: [] + # Priority class name for the helper pod (defaults to system-node-critical) + priorityClassName: "system-node-critical" # Number of provisioner worker threads to call provision/delete simultaneously. # workerThreads: 4