backuprestore

package
v1.149.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EtcdConfigFileName is the key/filename of the etcd config inside the ConfigMap.
	EtcdConfigFileName = "etcd.conf.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EtcdbrctlImage        string
	StoreContainer        string
	StorePrefix           string
	BackupBucketsHostPath string
}

Config contains configuration for running etcdbrctl initialize before starting the bootstrap etcd.

The etcdbrctl-initialize init container is only added when this config is not nil.

func ConfigFromBackupDataPath

func ConfigFromBackupDataPath(path, etcdbrctlImage string) (*Config, error)

ConfigFromBackupDataPath builds a Config from the local backup data path on the node and the etcdbrctl image. The path is expected to have the structure:

<backupBucketsRoot>/<bucketName>/<namespace>--<uid>/etcd-main/v2

func (*Config) ConfigMap

func (cfg *Config) ConfigMap(namespace string) *corev1.ConfigMap

ConfigMap returns the fully populated etcd-config ConfigMap for the etcdbrctl-initialize init container.

func (*Config) EtcdInitializeConfig

func (cfg *Config) EtcdInitializeConfig() string

EtcdInitializeConfig returns the etcd config YAML used during initialization.

func (*Config) InitContainer

func (cfg *Config) InitContainer(dataVolumeName string) corev1.Container

InitContainer returns the etcdbrctl-initialize init container spec.

The backup-restore initialization only ever runs for the main etcd (see ShouldRun and the caller in staticpods.go), hence the main etcd's data directory is used directly.

func (*Config) ShouldRun

func (cfg *Config) ShouldRun() bool

ShouldRun reports whether the etcdbrctl-initialize init container should be injected.

func (*Config) Volumes

func (cfg *Config) Volumes() []corev1.Volume

Volumes returns the volumes needed by the etcdbrctl-initialize init container.

Jump to

Keyboard shortcuts

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