Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

hostpath: Add block volume support #143

Closed

Conversation

darkowlzz
Copy link

This change adds block volume support to hostpath driver.

When a block volume request is received, a block file is created at
provisionRoot with the requested capacity as size.

At node publish, a loop device is created associated with the block
file. This loop device is then symlinked to the publish target path.
For read only volume publish, the loop device is created with read only
flag.

At node unpublish, the symlinked file is deleted, and the loop device is
detached from the block file.

At volume delete, the block file is deleted.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: darkowlzz
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: chakri-nelluri

If they are not already assigned, you can assign the PR to them by writing /assign @chakri-nelluri in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 20, 2019
This change adds block volume support to hostpath driver.

When a block volume request is received, a block file is created at
provisionRoot with the requested capacity as size.

At node publish, a loop device is created associated with the block
file. This loop device is then symlinked to the publish target path.
For read only volume publish, the loop device is created with read only
flag.

At node unpublish, the symlinked file is deleted, and the loop device is
detached from the block file.

At volume delete, the block file is deleted.
@pohly
Copy link
Contributor

pohly commented Jan 21, 2019

Wow, that was fast. Thanks a lot @darkowlzz.

Before this can be merged we need to get the hostpath driver moved (kubernetes-csi/csi-driver-host-path#1) and then also move this PR. In the meantime we can discuss it here.

@lpabon: I remember that you were raising the question of handling block devices with symlinks vs. bind mounts. What was the outcome? Is the approach taken here correct?

@pohly
Copy link
Contributor

pohly commented Jan 21, 2019

/hold

I'm holding this because we don't want to add any further changes here. It's still ready for review.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2019
@pohly
Copy link
Contributor

pohly commented Jan 24, 2019

@darkowlzz Please move this PR over to the csi-driver-host-path repo. The code was merged into master of that repo.

@darkowlzz
Copy link
Author

Moved to kubernetes-csi/csi-driver-host-path#6

@darkowlzz darkowlzz closed this Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants