backup

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesClient

type KubernetesClient interface {
	// ListNamespaces returns a list of all namespace names in the cluster
	ListNamespaces(ctx context.Context) ([]string, error)

	// ListDeployments returns a list of all deployments in the specified namespace
	ListDeployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)

	// ListServices returns a list of all services in the specified namespace
	ListServices(ctx context.Context, namespace string) (*corev1.ServiceList, error)

	// ListConfigMaps returns a list of all config maps in the specified namespace
	ListConfigMaps(ctx context.Context, namespace string) (*corev1.ConfigMapList, error)

	// ListSecrets returns a list of all secrets in the specified namespace
	ListSecrets(ctx context.Context, namespace string) (*corev1.SecretList, error)

	// ListStatefulSets returns a list of all stateful sets in the specified namespace
	ListStatefulSets(ctx context.Context, namespace string) (*appsv1.StatefulSetList, error)

	// ListHorizontalPodAutoscalers returns a list of all horizontal pod autoscalers in the specified namespace
	ListHorizontalPodAutoscalers(ctx context.Context, namespace string) (*autoscalingv2.HorizontalPodAutoscalerList, error)

	// ListCronJobs returns a list of all cron jobs in the specified namespace
	ListCronJobs(ctx context.Context, namespace string) (*batchv1.CronJobList, error)

	// PersistantVolumeClaims returns a list of all persistant volume claims in the specified namespace
	ListPersistantVolumeClaims(ctx context.Context, namespace string) (*corev1.PersistentVolumeClaimList, error)
}

KubernetesClient defines the interface for interacting with Kubernetes resources

type Logger added in v1.0.6

type Logger interface {
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{})
	Error(v ...interface{})
	Debugf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Close()
}

type Manager

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

Manager handles the backup process for Kubernetes resources

func NewManager

func NewManager(client KubernetesClient, backupDir string, dryRun bool, logger Logger) *Manager

NewManager creates a new Manager instance

func (*Manager) PerformBackup

func (bm *Manager) PerformBackup(ctx context.Context) error

PerformBackup initiates the backup process for all namespaces

Jump to

Keyboard shortcuts

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