minor fixes for local-hostpath, documentation

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-02-22 21:51:16 -07:00
parent 4d215968d7
commit 6345c53a4e
6 changed files with 58 additions and 10 deletions

View File

@ -1,6 +1,16 @@
# v1.5.0
Released 2022-02-
- massive ci overhaul
- introduce `zfs-local-dataset` driver
- introduce `zfs-local-zvol` driver
- introduce `local-hostpath` driver
- support manually provisioned `oneclient` volumes
# v1.4.4 # v1.4.4
Release 2021-12-11 Released 2021-12-11
- better adherence to expected csi behavior when volume request for less than - better adherence to expected csi behavior when volume request for less than
minimum volume size is requested (see #137) minimum volume size is requested (see #137)

View File

@ -33,8 +33,9 @@ have access to resizing, snapshots, clones, etc functionality.
for all volumes) for all volumes)
- `smb-client` (crudely provisions storage using a shared smb share/directory - `smb-client` (crudely provisions storage using a shared smb share/directory
for all volumes) for all volumes)
- `node-manual` (allows connecting to manually created smb, nfs, lustre, and - `local-hostpath` (crudely provisions node-local directories)
iscsi volumes, see sample PVs in the `examples` directory) - `node-manual` (allows connecting to manually created smb, nfs, lustre,
oneclient, and iscsi volumes, see sample PVs in the `examples` directory)
- framework for developing `csi` drivers - framework for developing `csi` drivers
If you have any interest in providing a `csi` driver, simply open an issue to If you have any interest in providing a `csi` driver, simply open an issue to
@ -159,6 +160,11 @@ provision `MULTI_NODE` / `RWX` volumes, any workloads using the volume will
always land a single node and that node will always be the node where the always land a single node and that node will always be the node where the
volume is/was provisioned. volume is/was provisioned.
### local-hostpath
This `driver` provisions node-local storage. Each node should and an
identically name folder where volumes will be created.
## Server Prep ## Server Prep
Server preparation depends slightly on which `driver` you are using. Server preparation depends slightly on which `driver` you are using.

View File

@ -0,0 +1,10 @@
driver: local-hostpath
instance_id:
local-hostpath:
# generally shareBasePath and controllerBasePath should be the same for this
# driver, this path should be mounted into the csi-driver container
shareBasePath: "/var/lib/csi-local-hostpath"
controllerBasePath: "/var/lib/csi-local-hostpath"
dirPermissionsMode: "0777"
dirPermissionsUser: root
dirPermissionsGroup: root

View File

@ -1,3 +1,4 @@
const _ = require("lodash");
const { CsiBaseDriver } = require("../index"); const { CsiBaseDriver } = require("../index");
const { GrpcError, grpc } = require("../../utils/grpc"); const { GrpcError, grpc } = require("../../utils/grpc");
const cp = require("child_process"); const cp = require("child_process");
@ -570,14 +571,20 @@ class ControllerClientCommonDriver extends CsiBaseDriver {
* @param {*} call * @param {*} call
*/ */
async GetCapacity(call) { async GetCapacity(call) {
const driver = this;
if (
!driver.options.service.controller.capabilities.rpc.includes(
"GET_CAPACITY"
)
) {
// really capacity is not used at all with nfs in this fashion, so no reason to enable // really capacity is not used at all with nfs in this fashion, so no reason to enable
// here even though it is technically feasible. // here even though it is technically feasible.
throw new GrpcError( throw new GrpcError(
grpc.status.UNIMPLEMENTED, grpc.status.UNIMPLEMENTED,
`operation not supported by driver` `operation not supported by driver`
); );
}
const driver = this;
if (call.request.volume_capabilities) { if (call.request.volume_capabilities) {
const result = this.assertCapabilities(call.request.volume_capabilities); const result = this.assertCapabilities(call.request.volume_capabilities);

View File

@ -15,6 +15,8 @@ class ControllerLocalHostpathDriver extends ControllerClientCommonDriver {
"service.identity.capabilities.service", "service.identity.capabilities.service",
false false
); );
const c_caps = _.get(options, "service.controller.capabilities", false);
super(...arguments); super(...arguments);
if (!i_caps) { if (!i_caps) {
@ -26,6 +28,16 @@ class ControllerLocalHostpathDriver extends ControllerClientCommonDriver {
"VOLUME_ACCESSIBILITY_CONSTRAINTS", "VOLUME_ACCESSIBILITY_CONSTRAINTS",
]; ];
} }
if (!c_caps) {
this.ctx.logger.debug("setting local-hostpath controller service caps");
if (
!options.service.controller.capabilities.rpc.includes("GET_CAPACITY")
) {
options.service.controller.capabilities.rpc.push("GET_CAPACITY");
}
}
} }
getConfigKey() { getConfigKey() {

View File

@ -125,6 +125,9 @@ class NodeManualDriver extends CsiBaseDriver {
driverResourceType = "filesystem"; driverResourceType = "filesystem";
fs_types = ["oneclient", "fuse.oneclient"]; fs_types = ["oneclient", "fuse.oneclient"];
break; break;
case "hostpath":
driverResourceType = "filesystem";
break;
case "iscsi": case "iscsi":
driverResourceType = "volume"; driverResourceType = "volume";
fs_types = ["ext3", "ext4", "ext4dev", "xfs"]; fs_types = ["ext3", "ext4", "ext4dev", "xfs"];