Skip to content

Instantly share code, notes, and snippets.

@gnufied
Last active January 22, 2020 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnufied/059fefc84c0750072ff4977cf5c4c84d to your computer and use it in GitHub Desktop.
Save gnufied/059fefc84c0750072ff4977cf5c4c84d to your computer and use it in GitHub Desktop.
// StorageClassDevice returns device configuration
type StorageClassDevice struct {
// StorageClass name to use for set of matched devices
StorageClassName string `json:"storageClassName"`
// Volume mode. Raw or with file system
// + optional
VolumeMode PersistentVolumeMode `json:"volumeMode,omitempty"`
// File system type
// +optional
FSType string `json:"fsType,omitempty"`
// A list of device paths which would be chosen for local storage.
// If specified along with AutoDiscovery option, device specified in devicePath
// will be selected regardless of selection critirea mentioned in autoDiscovery
// field.
// For example - ["/dev/sda", "/dev/sdb", "/dev/disk/by-id/ata-crucial"]
DevicePaths []string `json:"devicePaths,omitempty"`
// AutoDiscovery can be used to discover all local devices
// on the node and automatically create PVs.
// +optional
AutoDiscovery *LocalVolumeDiscoveryPolicy
}
type DeviceDiscoveryPolicy string
const (
UseAllDevices DeviceDiscoveryPolicy = "UseAllDevices"
UseOnlySSD DeviceDiscoveryPolicy = "UseOnlySSD"
)
type LocalVolumeDiscoveryPolicy struct {
// DeviceDiscoveryPolicy controls how devices are discovered by local-storage-operator
DiscoveryPolicy DeviceDiscoveryPolicy
// Device type that should be used for localvolumes. This would be type returned
// by output of lsblk. Possible types are - crypt,raid1, raid4, raid5, raid10, multipath, disk, tape, printer,
// processor, worm, rom, scanner, mo-disk, changer, comm, raid, enclosure, rbc, osd, and no-lun.
// For example - ["part", "disk"]
// +optional
DeviceTypes []string
// A list of regular expressions that will be used to exclude certain devices
// For example - ["^rbd[0-9]+p?[0-9]{0,}$"]
// +optional
DeviceExclusionFilter []string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment