Skip to content

Commit

Permalink
conditional iscsi mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
travisghansen committed Sep 16, 2020
1 parent f0a4b96 commit 8b06a17
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/democratic-csi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: democratic-csi
version: 0.4.4
version: 0.4.5
9 changes: 9 additions & 0 deletions stable/democratic-csi/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{- define "democratic-csi.mount-iscsi" -}}
{{- if contains "iscsi" .Values.driver.config.driver }}
{{- printf "%s" "true" -}}
{{- else }}
{{- printf "%s" "false" -}}
{{- end }}
{{- end -}}

{{- define "democratic-csi.external-provisioner-container" -}}
# https://github.com/kubernetes-csi/external-provisioner
- name: external-provisioner
Expand Down
11 changes: 8 additions & 3 deletions stable/democratic-csi/templates/node.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if .Values.node.enabled -}}
{{- $controllerStrategy := "node" -}}
{{- $mountIscsi := include "democratic-csi.mount-iscsi" . | eq "true" }}
---
kind: DaemonSet
apiVersion: apps/v1
Expand Down Expand Up @@ -100,12 +101,14 @@ spec:
- name: mountpoint-dir
mountPath: {{ .Values.node.kubeletHostPath }}
mountPropagation: Bidirectional
{{- if $mountIscsi }}
- name: iscsi-dir
mountPath: /etc/iscsi
mountPropagation: Bidirectional
- name: iscsi-info
mountPath: /var/lib/iscsi
mountPropagation: Bidirectional
{{- end }}
- name: modules-dir
mountPath: /lib/modules
readOnly: true
Expand Down Expand Up @@ -185,10 +188,15 @@ spec:
hostPath:
path: {{ .Values.node.kubeletHostPath }}
type: Directory
{{- if $mountIscsi }}
- name: iscsi-dir
hostPath:
path: /etc/iscsi
type: Directory
- name: iscsi-info
hostPath:
path: /var/lib/iscsi
{{- end }}
- name: dev-dir
hostPath:
path: /dev
Expand All @@ -202,9 +210,6 @@ spec:
- name: udev-data
hostPath:
path: /run/udev
- name: iscsi-info
hostPath:
path: /var/lib/iscsi
- name: sys-dir
hostPath:
path: /sys
Expand Down

0 comments on commit 8b06a17

Please sign in to comment.