volumes

package
v0.0.0-...-ecdaeff Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

This package implements mounting volumes on a cloud to back etcd data.

It is derived from the kops protokube code.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Containerized indicates the etcd is containerized
	Containerized = false
)

Functions

func PathFor

func PathFor(hostPath string) string

func SleepUntil

func SleepUntil(backoff Backoff, condition conditionFunc) (done bool, err error)

SleepUntil is for retrying functions It calls condition repeatedly, with backoff. When condition returns done==true or a err != nil; this function returns those values. If first we exhaust the backoff Attempts; we return false, nil

Types

type Backoff

type Backoff struct {
	Duration time.Duration
	Attempts int
}

Backoff ...

type Boot

type Boot struct {
	// contains filtered or unexported fields
}

Boot s ithe options for the protokube service

func (*Boot) Init

func (b *Boot) Init(volumesProvider Volumes)

Init is responsible for initializing the controllers

func (*Boot) WaitForVolumes

func (b *Boot) WaitForVolumes() []*Volume

type Volume

type Volume struct {
	// MountName is the name to use when mounting the volume
	MountName string

	// ProviderID is the cloud-provider identifier for the volume
	ProviderID string

	// EtcdName is the name for etcd
	EtcdName string

	// LocalDevice is set if the volume is attached to the local machine
	LocalDevice string

	// AttachedTo is set to the ID of the machine the volume is attached to, or "" if not attached
	AttachedTo string

	// Mountpoint is the path on which the volume is mounted, if mounted
	// It will likely be "/mnt/master-" + ID
	Mountpoint string

	// Status is a volume provider specific Status string; it makes it easier for the volume provider
	Status string

	Info VolumeInfo
}

type VolumeInfo

type VolumeInfo struct {
	Description string
}

type VolumeMountController

type VolumeMountController struct {
	// contains filtered or unexported fields
}

type Volumes

type Volumes interface {
	AttachVolume(volume *Volume) error
	FindVolumes() ([]*Volume, error)

	// FindMountedVolume returns the device (e.g. /dev/sda) where the volume is mounted
	// If not found, it returns "", nil (it should not return an error)
	// On other errors, it returns "", err
	// FindMountedVolume is used by calling it in a retry loop until the volume is attached
	FindMountedVolume(volume *Volume) (device string, err error)

	// MyIP returns the current node's IP address
	MyIP() (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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