backup

package
Version: v0.6.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	HTTPHeaderEtcdVersion = "X-etcd-Version"
	HTTPHeaderRevision    = "X-Revision"
)
View Source
const (
	PVBackupV1 = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupController added in v0.6.1

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

BackupController controls when to do backup based on backup policy and incoming HTTP backup requests.

func NewBackupController added in v0.6.1

func NewBackupController(config *BackupControllerConfig) (*BackupController, error)

NewBackupController creates a BackupController.

func (*BackupController) Run added in v0.6.1

func (bc *BackupController) Run()

Run starts BackupController controller where it controlls backups based on backup policy and HTTP backup requests.

func (*BackupController) StartHTTP added in v0.6.1

func (bc *BackupController) StartHTTP()

type BackupControllerConfig added in v0.6.1

type BackupControllerConfig struct {
	Kubecli kubernetes.Interface

	ListenAddr  string
	ClusterName string
	Namespace   string

	TLS          *api.TLSPolicy
	BackupPolicy *api.BackupPolicy
}

BackupControllerConfig contains configuration data to construct BackupController.

type BackupManager added in v0.6.1

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

BackupManager backups an etcd cluster.

func NewBackupManager added in v0.6.1

func NewBackupManager(kubecli kubernetes.Interface, clusterName string, namespace string, etcdTLSConfig *tls.Config, be backend.Backend) *BackupManager

NewBackupManager creates a BackupManager.

func (*BackupManager) SaveSnap added in v0.6.1

func (bm *BackupManager) SaveSnap(lastSnapRev int64) (*backupapi.BackupStatus, error)

SaveSnap saves the latest snapshot if its revision is greater than the given lastSnapRev and returns a BackupStatus containing saving backup metadata if SaveSnap succeeds.

type BackupServer added in v0.6.1

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

BackupServer provides the http handlers to handle backup related requests.

func NewBackupServer added in v0.6.1

func NewBackupServer(backend backend.Backend) *BackupServer

NewBackupServer creates a BackupServer.

func (*BackupServer) ServeBackup added in v0.6.1

func (bs *BackupServer) ServeBackup(w http.ResponseWriter, r *http.Request)

ServeBackup serves the backup request:

  • For GET, it returns the headers of etcd version and revision, with backup data. For HEAD, it only returns the headers.
  • It checks compatibility and fails any incompatible backup request
  • If both etcd version and revision, it returns the specified backup. If etcd version and revision is not given, it returns the latest compatible backup. If etcd version is not given, it returns the latest backup.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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