Skip to content

Commit

Permalink
Make provisioner root persistent across reboot
Browse files Browse the repository at this point in the history
If the proversioner container or the host restart
data dir under /tmp in the container will be lost thus
causing start up failure for any pods using csi pv.

It's good to make the provisioner root persistent so that
this plugin is  more reliable for daily testing.
  • Loading branch information
peter-wangxu committed Mar 5, 2019
1 parent b862d4c commit d699be7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions deploy/hostpath/csi-hostpath-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ spec:
name: socket-dir
- mountPath: /registration
name: registration-dir
- mountPath: /csi-data-dir
name: csi-data-dir

- name: hostpath
image: quay.io/k8scsi/hostpathplugin:v1.0.1
Expand Down Expand Up @@ -104,3 +106,8 @@ spec:
path: /var/lib/kubelet/plugins
type: Directory
name: plugins-dir
# 'path' is where PV data is persisted on host.
# using /tmp is also possible while the PVs will not available after plugin container recreation or host reboot
path: /var/lib/csi-hostpath-data/
type: DirectoryOrCreate
name: csi-data-dir
4 changes: 2 additions & 2 deletions pkg/hostpath/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (

const (
deviceID = "deviceID"
provisionRoot = "/tmp/"
snapshotRoot = "/tmp/"
provisionRoot = "/csi-data-dir"
snapshotRoot = "/csi-data-dir"
maxStorageCapacity = tib
)

Expand Down

0 comments on commit d699be7

Please sign in to comment.