Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(helm chart): rename priority class name for CSI plugin (node and controller) #287

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: CStor-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.1
version: 2.8.2
# 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 @@ -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-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-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-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-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