Skip to content

Commit

Permalink
fix(helm chart): rename priority class name for CSI plugin (node and …
Browse files Browse the repository at this point in the history
…controller) (#72)

Include storage engine name in priority class name to make sure CSI
driver of different storage will have different priority class. This
will resolve the issue of installing multiple storage engine using
helm chart.


Signed-off-by: Shovan Maity <[email protected]>
  • Loading branch information
Shovan Maity committed May 11, 2021
1 parent 5702dd2 commit ab5dc61
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Jiva-Operator helm chart for Kubernetes
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.8.0
version: 2.8.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 2.8.0
Expand Down
22 changes: 22 additions & 0 deletions deploy/helm/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,25 @@ Create labels for jiva csi controller
{{ include "jiva.csiController.matchLabels" . }}
{{ include "jiva.csiController.componentLabels" . }}
{{- end -}}

{{/*
Create the name of the priority class for csi node plugin
*/}}
{{- define "jiva.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 "jiva.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-csi-controller-critical
priorityClassName: {{ template "jiva.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-csi-node-critical
priorityClassName: {{ template "jiva.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-csi-controller-critical
name: {{ template "jiva.csiController.priorityClassName" . }}
value: 900000000
globalDefault: false
description: "This priority class should be used for the OpenEBS CSI driver controller deployment only."
{{- end }}
---
{{- if .Values.csiNode.priorityClass.create }}
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: openebs-csi-node-critical
name: {{ template "jiva.csiNode.priorityClassName" . }}
value: 900001000
globalDefault: false
description: "This priority class should be used for the OpenEBS 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 @@ -50,6 +50,9 @@ jivaOperator:


csiController:
priorityClass:
create: true
name: jiva-csi-controller-critical
componentName: "openebs-jiva-csi-controller"
attacher:
name: "csi-attacher"
Expand Down Expand Up @@ -112,6 +115,9 @@ jivaCSIPlugin:
remount: "true"

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

0 comments on commit ab5dc61

Please sign in to comment.