topolvm

package module
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

README

TopoLVM logo GitHub release Main PkgGoDev Go Report Card

TopoLVM

TopoLVM is a CSI plugin using LVM for Kubernetes. It can be considered as a specific implementation of local persistent volumes using CSI and LVM.

  • Conformed CSI version: 1.5.0

Our supported platform are:

  • Kubernetes: 1.28, 1.27, 1.26
  • Node OS: Linux with LVM2 (*1)
  • CPU Architecture: x86 (*2), arm64 (*3), ppc64le (*3)
  • Filesystems: ext4, xfs, btrfs(experimental)
  • lvm version 2.02.163 or later (adds JSON output support)

*1 The host's Linux Kernel must be v4.9 or later which supports rmapbt and reflink, if you use xfs filesystem with an official docker image.
*2 Tier1 support. The official docker images are provided and all functionalities are tested by CI.
*3 Tier2 support. The official docker images are provided, but no tests run by CI.

Docker images are available on ghcr.io.

Getting Started

If you want to try TopoLVM on your local machine, see example directory which provides scripts to run TopoLVM on kind (Kubernetes IN Docker).

To use TopoLVM on your real kubernetes cluster, read documents.

Deprecated: If you want to use TopoLVM on Rancher/RKE, see docs/deprecated/rancher/README.md.

Contributing

TopoLVM project welcomes contributions from any member of our community. To get started contributing, please see our Contributing Guide.

Scope

In Scope
  • Dynamic provisioning: Volumes are created dynamically when PersistentVolumeClaim objects are created.
  • Raw block volume: Volumes are available as block devices inside containers.
  • Topology: TopoLVM uses CSI topology feature to schedule Pod to Node where LVM volume exists.
  • Extended scheduler: TopoLVM extends the general Pod scheduler to prioritize Nodes having larger storage capacity.
  • Volume metrics: Usage stats are exported as Prometheus metrics from kubelet.
  • Volume Expansion: Volumes can be expanded by editing PersistentVolumeClaim objects.
  • Storage capacity tracking: You can enable Storage Capacity Tracking mode instead of using topolvm-scheduler.
  • Snapshot: Snapshots can be taken when using thin provisioning.
Planned Features
  • Prioritize based on volume capacity without using the extended scheduler.

Communications

If you have any questions or ideas, please use discussions.

Resources

docs directory contains the user manual, designs and specifications, and so on.

A diagram of components is available in docs/design.md.

TopoLVM maintainers presented the motivation and implementation of TopoLVM at KubeCon Europe 2020: https://kccnceu20.sched.com/event/ZerD

License

This project is licensed under Apache License 2.0.

Documentation

Index

Constants

View Source
const CreatedbyLabelKey = "app.kubernetes.io/created-by"

Label key that indicates The controller/user who created this resource https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels

View Source
const CreatedbyLabelValue = "topolvm-controller"

Label value that indicates The controller/user who created this resource

View Source
const DefaultCSISocket = "/run/topolvm/csi-topolvm.sock"

DefaultCSISocket is the default path of the CSI socket file.

View Source
const DefaultDeviceClassAnnotationName = "00default"

DefaultDeviceClassAnnotationName is the part of annotation name for the default device-class.

View Source
const DefaultDeviceClassName = ""

DefaultDeviceClassName is the name for the default device-class.

View Source
const DefaultLVMdSocket = "/run/topolvm/lvmd.sock"

DefaultLVMdSocket is the default path of the lvmd socket file.

View Source
const DefaultSize = int64(DefaultSizeGb << 30)

DefaultSize is DefaultSizeGb in bytes

View Source
const DefaultSizeGb = 1

DefaultSizeGb is the default size in GiB for volumes (PVC or generic ephemeral volumes) w/o capacity requests.

View Source
const DeviceDirectory = "/dev/topolvm"

DeviceDirectory is a directory where TopoLVM Node service creates device files.

View Source
const LegacyPVCFinalizer = legacyPluginName + "/pvc"

LegacyPVCFinalizer is a legacy finalizer of PVC.

View Source
const MinimumSectorSize = int64(4096)

MinimumSectorSize is the minimum size in bytes for volumes (PVC or generic ephemeral volumes). It is derived from the usual sector size of 512,1024 or 4096 bytes for logical volumes. While Sector Sizes of 512 are common, using 4096 is safe As it also aligns with 512 and 1024 byte sectors, and is the default for most modern disks. Going lower than this size will cause validation issues on volume creation for the user.

View Source
const PVCFinalizer = pluginName + "/pvc"

PVCFinalizer is a finalizer of PVC.

Variables

View Source
var (
	// Version is the topolvm version, this value will be injected on building.
	Version = "devel"
)

Functions

func GetCapacityKeyPrefix added in v0.16.0

func GetCapacityKeyPrefix() string

GetCapacityKeyPrefix returns the key prefix of Node annotation that represents VG free space.

func GetCapacityResource added in v0.16.0

func GetCapacityResource() corev1.ResourceName

GetCapacityResource returns the resource name of topolvm capacity.

func GetDeviceClassKey added in v0.16.0

func GetDeviceClassKey() string

GetDeviceClassKey returns the key used in CSI volume create requests to specify a device-class.

func GetLVPendingDeletionKey added in v0.20.0

func GetLVPendingDeletionKey() string

GetPendingDeletionKey returns the name of the pending-deletion annotation

func GetLogicalVolumeFinalizer added in v0.16.0

func GetLogicalVolumeFinalizer() string

GetLogicalVolumeFinalizer returns the name of LogicalVolume finalizer

func GetLvcreateOptionClassKey added in v0.18.0

func GetLvcreateOptionClassKey() string

GetDeviceClassKey returns the key used in CSI volume create requests to specify a lvcreate-option-class.

func GetNodeFinalizer added in v0.16.0

func GetNodeFinalizer() string

GetNodeFinalizer returns the name of Node finalizer of TopoLVM

func GetPluginName added in v0.16.0

func GetPluginName() string

GetPluginName returns the name of the CSI plugin.

func GetResizeRequestedAtKey added in v0.16.0

func GetResizeRequestedAtKey() string

GetResizeRequestedAtKey returns the key of LogicalVolume that represents the timestamp of the resize request.

func GetTopologyNodeKey added in v0.16.0

func GetTopologyNodeKey() string

TopologyNodeKey returns the key of topology that represents node name.

func UseLegacy added in v0.16.0

func UseLegacy() bool

Types

This section is empty.

Directories

Path Synopsis
api
legacy/v1
Package v1 contains API Schema definitions for the topolvm v1 API group +kubebuilder:object:generate=true +groupName=topolvm.cybozu.com
Package v1 contains API Schema definitions for the topolvm v1 API group +kubebuilder:object:generate=true +groupName=topolvm.cybozu.com
v1
Package v1 contains API Schema definitions for the topolvm v1 API group +kubebuilder:object:generate=true +groupName=topolvm.io
Package v1 contains API Schema definitions for the topolvm v1 API group +kubebuilder:object:generate=true +groupName=topolvm.io
cmd
internal
pkg
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL