Skip to content

Commit 674f5f3

Browse files
[stable/lvm]: add custom priorityclass for lvm deployments (#125)
Signed-off-by: prateekpandey14 <[email protected]>
1 parent 93dfdc0 commit 674f5f3

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

deploy/helm/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: lvm-localpv
33
description: CSI Driver for dynamic provisioning of LVM Persistent Local Volumes.
4-
version: 0.7.1
4+
version: 0.7.2
55
appVersion: 0.7.0
66
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png
77
home: http://www.openebs.io/

deploy/helm/charts/templates/_helpers.tpl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,25 @@ Create labels for openebs lvm-localpv node daemon
114114
{{ include "lvmlocalpv.lvmNode.matchLabels" . }}
115115
{{ include "lvmlocalpv.lvmNode.componentLabels" . }}
116116
{{- end -}}
117+
118+
{{/*
119+
Create the name of the priority class for csi node plugin
120+
*/}}
121+
{{- define "lvmlocalpv.lvmNode.priorityClassName" -}}
122+
{{- if .Values.lvmNode.priorityClass.create }}
123+
{{- printf "%s-%s" .Release.Name .Values.lvmNode.priorityClass.name | trunc 63 | trimSuffix "-" }}
124+
{{- else }}
125+
{{- printf "%s" .Values.lvmNode.priorityClass.name | trunc 63 | trimSuffix "-" }}
126+
{{- end }}
127+
{{- end }}
128+
129+
{{/*
130+
Create the name of the priority class for csi controller plugin
131+
*/}}
132+
{{- define "lvmlocalpv.lvmController.priorityClassName" -}}
133+
{{- if .Values.lvmController.priorityClass.create }}
134+
{{- printf "%s-%s" .Release.Name .Values.lvmController.priorityClass.name | trunc 63 | trimSuffix "-" }}
135+
{{- else }}
136+
{{- printf "%s" .Values.lvmController.priorityClass.name | trunc 63 | trimSuffix "-" }}
137+
{{- end }}
138+
{{- end }}

deploy/helm/charts/templates/lvm-node-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ spec:
1515
{{- with .Values.lvmNode.podLabels }}
1616
{{ toYaml . }}
1717
{{- end }}
18-
{{- end }}
18+
{{- end }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.lvmController.priorityClass.create }}
2+
apiVersion: scheduling.k8s.io/v1
3+
kind: PriorityClass
4+
metadata:
5+
name: {{ template "lvmlocalpv.lvmController.priorityClassName" . }}
6+
value: 900000000
7+
globalDefault: false
8+
description: "This priority class should be used for the CStor CSI driver controller deployment only."
9+
{{- end }}
10+
---
11+
{{- if .Values.lvmNode.priorityClass.create }}
12+
apiVersion: scheduling.k8s.io/v1
13+
kind: PriorityClass
14+
metadata:
15+
name: {{ template "lvmlocalpv.lvmNode.priorityClassName" . }}
16+
value: 900001000
17+
globalDefault: false
18+
description: "This priority class should be used for the CStor CSI driver node deployment only."
19+
{{- end }}

deploy/helm/charts/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ lvmNode:
5050
tolerations: []
5151
securityContext: {}
5252
labels: {}
53+
priorityClass:
54+
create: true
55+
name: lvm-localpv-csi-node-critical
56+
5357

5458
# lvmController contains the configurables for
5559
# the lvm controller statefulset
@@ -114,6 +118,9 @@ lvmController:
114118
nodeSelector: {}
115119
tolerations: []
116120
securityContext: {}
121+
priorityClass:
122+
create: true
123+
name: lvm-localpv-csi-controller-critical
117124

118125
# lvmPlugin is the common csi container used by the
119126
# controller statefulset and node daemonset

0 commit comments

Comments
 (0)