Skip to content

Commit d541b21

Browse files
authored
Merge pull request #20 from peter-wangxu/fixes/persist_provisioner_root
Make provisioner root persistent across reboot
2 parents 51278a4 + d699be7 commit d541b21

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

deploy/hostpath/csi-hostpath-plugin.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ spec:
6060
name: socket-dir
6161
- mountPath: /registration
6262
name: registration-dir
63+
- mountPath: /csi-data-dir
64+
name: csi-data-dir
6365

6466
- name: hostpath
6567
image: quay.io/k8scsi/hostpathplugin:v1.0.1
@@ -104,3 +106,8 @@ spec:
104106
path: /var/lib/kubelet/plugins
105107
type: Directory
106108
name: plugins-dir
109+
# 'path' is where PV data is persisted on host.
110+
# using /tmp is also possible while the PVs will not available after plugin container recreation or host reboot
111+
path: /var/lib/csi-hostpath-data/
112+
type: DirectoryOrCreate
113+
name: csi-data-dir

pkg/hostpath/controllerserver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import (
3838

3939
const (
4040
deviceID = "deviceID"
41-
provisionRoot = "/tmp/"
42-
snapshotRoot = "/tmp/"
41+
provisionRoot = "/csi-data-dir"
42+
snapshotRoot = "/csi-data-dir"
4343
maxStorageCapacity = tib
4444
)
4545

0 commit comments

Comments
 (0)