schedops

package
v0.0.0-...-4c0c8b4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PXServiceName is the name of the portworx service in kubernetes
	PXServiceName = "portworx-service"
	// PXNamespace is the kubernetes namespace in which portworx daemon set runs
	PXNamespace = "kube-system"
	// PXDaemonSet is the name of portworx daemon set in k8s deployment
	PXDaemonSet = "portworx"
)

Variables

This section is empty.

Functions

func Register

func Register(name string, d Driver) error

Register registers the given portworx scheduler operator

Types

type Driver

type Driver interface {
	// ValidateOnNode validates portworx on given node (from scheduler perspective)
	ValidateOnNode(n node.Node) error
	// ValidateAddLabels validates whether the labels for the volume are applied appropriately on the vol replica nodes
	ValidateAddLabels(replicaNodes []api.Node, v *api.Volume) error
	// ValidateRemoveLabels validates whether the volume labels have been removed
	ValidateRemoveLabels(v *volume.Volume) error
	// ValidateVolumeCleanup validates that volume dir does not exist and no data present inside it
	ValidateVolumeCleanup(d node.Driver) error
	// ValidateVolumeSetup checks if the given volume is setup correctly
	ValidateVolumeSetup(v *volume.Volume) error
	// ValidateSnapshot validates the snapshot volume
	ValidateSnapshot(volumeParams map[string]string, parent *api.Volume) error
	// GetVolumeName returns the volume name based on the volume object recevied
	GetVolumeName(v *volume.Volume) string
	// GetServiceEndpoint returns the hostname of portworx service if it is present
	GetServiceEndpoint() (string, error)
	// UpgradePortworx upgrades portworx to the given docker image and tag
	UpgradePortworx(image, tag string) error
	// IsPXReadyOnNode returns true if PX pod is up on that node, else returns false
	IsPXReadyOnNode(n node.Node) bool
	// IsPXEnabled returns true if portworx is enabled on given node
	IsPXEnabled(n node.Node) (bool, error)
}

Driver is the interface for portworx operations under various schedulers

func Get

func Get(name string) (Driver, error)

Get a driver to perform portworx operations for the given scheduler

type ErrFailedToCleanupVolume

type ErrFailedToCleanupVolume struct {
	// OrphanPods is a map of node to list of pod UIDs whose portworx volume dir is not deleted
	OrphanPods map[string][]string
	// DirtyVolPods is a map of node to list of pod UIDs which still has data written
	// under the volume mount point
	DirtyVolPods map[string][]string
}

ErrFailedToCleanupVolume error type for orphan pods or unclean vol directories

func (*ErrFailedToCleanupVolume) Error

func (e *ErrFailedToCleanupVolume) Error() string

type ErrLabelMissingOnNode

type ErrLabelMissingOnNode struct {
	// Label is the label string that is missing from the nodes
	Label string
	// Nodes is a list of node names which have missing labels for certain PVCs
	Nodes []string
}

ErrLabelMissingOnNode error type for missing volume labels on node

func (*ErrLabelMissingOnNode) Error

func (e *ErrLabelMissingOnNode) Error() string

type ErrLabelNotRemovedFromNode

type ErrLabelNotRemovedFromNode struct {
	// Label is the label key that was not removed from the nodes
	Label string
	// Nodes is a list of node names which have stale volume related labels
	Nodes []string
}

ErrLabelNotRemovedFromNode error type for stale volume labels on node

func (*ErrLabelNotRemovedFromNode) Error

Jump to

Keyboard shortcuts

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