topolvm: github.com/cybozu-go/topolvm/driver/k8s Index | Files

package k8s

import "github.com/cybozu-go/topolvm/driver/k8s"

Index

Package Files

logicalvolume_service.go node_service.go

Variables

var ErrNodeNotFound = errors.New("node not found")

ErrNodeNotFound represents the error that node is not found.

var ErrVolumeNotFound = errors.New("VolumeID is not found")

ErrVolumeNotFound represents the specified volume is not found.

type LogicalVolumeService Uses

type LogicalVolumeService struct {
    client.Client
    // contains filtered or unexported fields
}

LogicalVolumeService represents service for LogicalVolume.

func NewLogicalVolumeService Uses

func NewLogicalVolumeService(mgr manager.Manager) (*LogicalVolumeService, error)

NewLogicalVolumeService returns LogicalVolumeService.

func (*LogicalVolumeService) CreateVolume Uses

func (s *LogicalVolumeService) CreateVolume(ctx context.Context, node, dc, name string, requestGb int64) (string, error)

CreateVolume creates volume

func (*LogicalVolumeService) DeleteVolume Uses

func (s *LogicalVolumeService) DeleteVolume(ctx context.Context, volumeID string) error

DeleteVolume deletes volume

func (*LogicalVolumeService) ExpandVolume Uses

func (s *LogicalVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error

ExpandVolume expands volume

func (*LogicalVolumeService) GetVolume Uses

func (s *LogicalVolumeService) GetVolume(ctx context.Context, volumeID string) (*topolvmv1.LogicalVolume, error)

GetVolume returns LogicalVolume by volume ID.

func (*LogicalVolumeService) UpdateCurrentSize Uses

func (s *LogicalVolumeService) UpdateCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error

UpdateCurrentSize updates .Status.CurrentSize of LogicalVolume.

func (*LogicalVolumeService) UpdateSpecSize Uses

func (s *LogicalVolumeService) UpdateSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error

UpdateSpecSize updates .Spec.Size of LogicalVolume.

type NodeService Uses

type NodeService struct {
    client.Client
}

NodeService represents node service.

func NewNodeService Uses

func NewNodeService(mgr manager.Manager) *NodeService

NewNodeService returns NodeService.

func (NodeService) GetCapacityByName Uses

func (s NodeService) GetCapacityByName(ctx context.Context, name, deviceClass string) (int64, error)

GetCapacityByName returns VG capacity of specified node by name.

func (NodeService) GetCapacityByTopologyLabel Uses

func (s NodeService) GetCapacityByTopologyLabel(ctx context.Context, topology, dc string) (int64, error)

GetCapacityByTopologyLabel returns VG capacity of specified node by TopoLVM's topology label.

func (NodeService) GetMaxCapacity Uses

func (s NodeService) GetMaxCapacity(ctx context.Context, deviceClass string) (string, int64, error)

GetMaxCapacity returns max VG capacity among nodes.

func (NodeService) GetTotalCapacity Uses

func (s NodeService) GetTotalCapacity(ctx context.Context, dc string) (int64, error)

GetTotalCapacity returns total VG capacity of all nodes.

Package k8s imports 18 packages (graph) and is imported by 1 packages. Updated 2020-07-02. Refresh now. Tools for package owners.