Skip to content

Commit

Permalink
add priority class name in values.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Shovan Maity <shovan.cse91@gmail.com>
  • Loading branch information
shovanmaity committed May 6, 2021
1 parent 4d72669 commit cc62f70
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
22 changes: 22 additions & 0 deletions deploy/helm/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,25 @@ Create labels for cstor csi controller
{{ include "cstor.csiController.matchLabels" . }}
{{ include "cstor.csiController.componentLabels" . }}
{{- end -}}

{{/*
Create the name of the priority class for csi node plugin
*/}}
{{- define "cstor.csiNode.priorityClassName" -}}
{{- if .Values.csiNode.priorityClass.create }}
{{- printf "%s-%s" .Release.Name .Values.csiNode.priorityClass.name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Values.csiNode.priorityClass.name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create the name of the priority class for csi controller plugin
*/}}
{{- define "cstor.csiController.priorityClassName" -}}
{{- if .Values.csiController.priorityClass.create }}
{{- printf "%s-%s" .Release.Name .Values.csiController.priorityClass.name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Values.csiController.priorityClass.name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/csi-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
{{ toYaml .Values.csiController.podLabels | nindent 8 }}
{{- end }}
spec:
priorityClassName: openebs-cstor-csi-controller-critical
priorityClassName: {{ template "cstor.csiController.priorityClassName" . }}
serviceAccount: {{ .Values.serviceAccount.csiController.name }}
containers:
- name: {{ .Values.csiController.resizer.name }}
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/csi-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
{{ toYaml .Values.csiNode.podLabels | nindent 8 }}
{{- end }}
spec:
priorityClassName: openebs-cstor-csi-node-critical
priorityClassName: {{ template "cstor.csiNode.priorityClassName" . }}
serviceAccount: {{ .Values.serviceAccount.csiNode.name }}
hostNetwork: true
containers:
Expand Down
8 changes: 6 additions & 2 deletions deploy/helm/charts/templates/priority-class.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{{- if .Values.csiController.priorityClass.create }}
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: openebs-cstor-csi-controller-critical
name: {{ template "cstor.csiController.priorityClassName" . }}
value: 900000000
globalDefault: false
description: "This priority class should be used for the CStor CSI driver controller deployment only."
{{- end }}
---
{{- if .Values.csiNode.priorityClass.create }}
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: openebs-cstor-csi-node-critical
name: {{ template "cstor.csiNode.priorityClassName" . }}
value: 900001000
globalDefault: false
description: "This priority class should be used for the CStor CSI driver node deployment only."
{{- end }}
6 changes: 6 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ cvcOperator:
securityContext: {}

csiController:
priorityClass:
create: true
name: cstor-csi-controller-critical
componentName: "openebs-cstor-csi-controller"
resizer:
name: "csi-resizer"
Expand Down Expand Up @@ -159,6 +162,9 @@ cstorCSIPlugin:
remount: "true"

csiNode:
priorityClass:
create: true
name: cstor-csi-node-critical
componentName: "openebs-cstor-csi-node"
driverRegistrar:
name: "csi-node-driver-registrar"
Expand Down

0 comments on commit cc62f70

Please sign in to comment.