service

package
v0.0.0-...-402c6be Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwsEtcdEndpoint

func AwsEtcdEndpoint(etcdDomain string) string

func AzureEtcdEndpoint

func AzureEtcdEndpoint(etcdDomain string) string

func BackupPrefix

func BackupPrefix(clusterID string) string

func CAFile

func CAFile(clusterID string, tmpDir string) string

func CertFile

func CertFile(clusterID string, tmpDir string) string

func CheckClusterVersionSupport

func CheckClusterVersionSupport(clusterID string, provider string, crdCLient *versioned.Clientset) (bool, error)

check if cluster release version has guest cluster backup support

func ClearTMPDir

func ClearTMPDir(tmpDir string)

clear temporary directory

func CreateCRDClient

func CreateCRDClient(logger micrologger.Logger) (*versioned.Clientset, error)

create CRD client to access k8s crd resources cluster

func CreateCertFiles

func CreateCertFiles(clusterID string, certConfig *k8sclient.TLSClientConfig, tmpDir string) error

create cert files in tmp dir from certConfig and saves filenames back

func CreateK8sClient

func CreateK8sClient(logger micrologger.Logger) (kubernetes.Interface, error)

create k8s client to access host k8s cluster

func CreateTMPDir

func CreateTMPDir() (string, error)

Create temporary directory where all file related magic happens.

func FetchCerts

func FetchCerts(clusterID string, k8sClient kubernetes.Interface) (*k8sclient.TLSClientConfig, error)

fetch etcd client certs

func GetAllGuestClusters

func GetAllGuestClusters(provider string, crdCLient *versioned.Clientset) ([]string, error)

fetch all guest clusters ids in host cluster

func GetEtcdEndpoint

func GetEtcdEndpoint(clusterID string, provider string, crdCLient *versioned.Clientset) (string, error)

fetch guest cluster etcd endpoint

func IsFailedBackupError

func IsFailedBackupError(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidProvider

func IsInvalidProvider(err error) bool

IsInvalidConfig asserts invalidConfigError.

func KVMEtcdEndpoint

func KVMEtcdEndpoint(etcdDomain string) string

func KeyFile

func KeyFile(clusterID string, tmpDir string) string

Types

type Service

type Service struct {
	Logger micrologger.Logger

	AwsAccessKey     string
	AwsSecretKey     string
	AwsS3Bucket      string
	AwsS3Region      string
	EtcdV2DataDir    string
	EtcdV3Cert       string
	EtcdV3CACert     string
	EtcdV3Key        string
	EtcdV3Endpoints  string
	EncryptPass      string
	Prefix           string
	Provider         string
	PrometheusConfig *config.PrometheusConfig

	Help   bool
	SkipV2 bool
}

func CreateService

func CreateService(f config.Flags, logger micrologger.Logger) *Service

func (*Service) BackupGuestClusters

func (s *Service) BackupGuestClusters() error

backup all guest clusters etcd

func (*Service) BackupHostCluster

func (s *Service) BackupHostCluster() error

backup host cluster etcd

Jump to

Keyboard shortcuts

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