schedops

package
v0.20.4-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 25 Imported by: 2

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"
	// PXServiceLabelKey is the label key used for px systemd service control
	PXServiceLabelKey = "px/service"

	// PXEnabledLabelKey is the label used to check whether px installation is enabled/disabled on node
	PXEnabledLabelKey = "px/enabled"
)

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 {
	//GetKubernetesVersion returns kubernetes version
	GetKubernetesVersion() (*version.Info, error)
	// StartPxOnNode enables portworx service on given node
	StartPxOnNode(n node.Node) error
	// StopPxOnNode disables portworx service  on given node
	StopPxOnNode(n node.Node) error
	// RestartPxOnNode restarts portworx service on given node
	RestartPxOnNode(n node.Node) error
	// 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.StorageNode, 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, d node.Driver) 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 received
	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(ociImage, ociTag, pxImage, pxTag 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)
	// GetRemotePXNodes returns list of PX node found on destination k8s cluster
	// referenced by kubeconfig
	GetRemotePXNodes(destKubeConfig string) ([]node.Node, error)
	// CreateAutopilotRule creates the AutopilotRule object
	CreateAutopilotRule(apRule apapi.AutopilotRule) (*apapi.AutopilotRule, error)
	// ListAutopilotRules lists AutopilotRules
	ListAutopilotRules() (*apapi.AutopilotRuleList, 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