https://github.com/dravanet/truenas-csi
CSI driver utilizing TrueNAS for volume management
https://github.com/dravanet/truenas-csi
csi-driver golang truenas
Last synced: 5 months ago
JSON representation
CSI driver utilizing TrueNAS for volume management
- Host: GitHub
- URL: https://github.com/dravanet/truenas-csi
- Owner: dravanet
- License: bsd-2-clause
- Created: 2021-06-24T08:25:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-15T19:22:23.000Z (over 1 year ago)
- Last Synced: 2024-11-05T21:45:01.445Z (over 1 year ago)
- Topics: csi-driver, golang, truenas
- Language: Go
- Homepage:
- Size: 738 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github.com/dravanet/truenas-csi
CSI driver utilizing TrueNAS for volume management.
Warning: in __BETA__ state.
## Deployment
For deployment, see [truenas-csi-chart](https://github.com/dravanet/truenas-csi-chart).
## Configuration
__TL;DR__ see [examples](examples).
The driver needs configuration to access one or more TrueNAS instances. Check [config.go](pkg/config/config.go) for full configuration structure.
The configuration has `yaml` syntax, must be passed to the application with `-controller-config` argument. This enables controller services.
The configuration file format is:
```yaml
truenas-1:
backup:
default:
```
A `truenas-config` has the structure:
```
apiurl:
[username: ]
[password: ]
[apikey: ]
[nfs: ]
[iscsi: ]
configurations:
sub-config-1:
default:
```
`apikey` is recommended over `username`+`password`.
`nfs` configuration has the strucure:
```yaml
server:
[allowedhosts: [array of allowed hosts to access share]]
[allowednetworks: [array of allowed networks to access share]]
```
`iscsi` configuration has the structure:
```yaml
portal:
portalid:
```
Each `configuration` section has the structure:
```yaml
dataset:
deletePolicy: [delete|retain]
[sparse: [true|false]]
[nfs: ]
[iscsi: ]
```
## Detailed operation
During volume create, evaluating capability requests, the driver makes a decision to create an nfs or an iscsi share.
Then a dataset is created under the selected `configuration` section. If nfs was chosen, an nfs export is created according to the selected configuration's nfs section. If iscsi was chosen, a new secret/target is created according to the selected configuration's iscsi section. Then, connection parameters are returned in the volume_context.
## NAS configuration selection
On CreateVolume request, parameters may specify which TrueNAS to use, and may select its sub-configuration. Any of these parameters may be omitted, then `default` entries are looked up.
Parameter name | Effect
---------------|--------
truenas-csi.dravanet.net/nas | NAS Selection
truenas-csi.dravanet.net/config | Sub-configuration selection
## Implementation goals
- Use TrueNAS API only.
- Meet CSI requirements as much as can
- idempotency during volume operations
- implement as much capabilities
## Capabilities
The following capabilities are supported from CSI Specification 1.3.0:
Plugin:
- online volume expansion
Controller:
- create/delete volume
- expand-volume
Node:
- stage-unstage volume
- get volume stats
- expand volume
## Planned features
- Snapshot handling
## Related projects
- [TrueNAS](https://www.truenas.com/) itself is the NAS solution
- [democratic-csi](https://github.com/democratic-csi/democratic-csi) is an existing implementation
- [ganeti-extstorage-csi](https://github.com/dravanet/ganeti-extstorage-csi) is a Ganeti external storage driver utilizing CSI