Documentation ¶
Index ¶
- Constants
- func BuildAWSCredentials(accessKeyID, secretAccessKey string) ([]byte, error)
- func BuildLvpStoreFileSystem(config *types.FileSystemConfig) *types.StoreFileSystem
- func BuildMinioStoreFileSystem(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) (*types.StoreFileSystem, error)
- func CheckKotsadmVeleroAccess(ctx context.Context, kotsadmNamespace string) (requiresAccess bool, finalErr error)
- func ConfigureStore(ctx context.Context, options ConfigureStoreOptions) (*types.Store, error)
- func CreateFileSystemMinioBucket(ctx context.Context, clientset kubernetes.Interface, namespace string, ...) error
- func DeleteFileSystemMinio(ctx context.Context, kotsadmNamespace string) error
- func DeployFileSystemLvp(ctx context.Context, clientset kubernetes.Interface, ...) error
- func DeployFileSystemMinio(ctx context.Context, clientset kubernetes.Interface, ...) error
- func DetectVeleroNamespace(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) (string, error)
- func EnsureLocalVolumeProviderConfigMaps(deployOptions FileSystemDeployOptions, veleroNamespace string) error
- func EnsureVeleroNamespaceConfigMap(ctx context.Context, clientset kubernetes.Interface, veleroNamespace string, ...) error
- func EnsureVeleroPermissions(ctx context.Context, clientset kubernetes.Interface, veleroNamespace string, ...) error
- func FindBackupStoreLocation(ctx context.Context, kotsadmNamespace string) (*velerov1.BackupStorageLocation, error)
- func GetCurrentFileSystemConfig(ctx context.Context, namespace string, isMinioDisabled bool) (*types.FileSystemConfig, error)
- func GetCurrentLvpFileSystemConfig(ctx context.Context, namespace string) (*types.FileSystemConfig, error)
- func GetCurrentMinioFileSystemConfig(ctx context.Context, namespace string) (*types.FileSystemConfig, error)
- func GetFileSystemMinioErrors(ctx context.Context, clientset kubernetes.Interface) map[string]string
- func GetGlobalStore(ctx context.Context, kotsadmNamespace string, ...) (*types.Store, error)
- func GetLvpBucket(fsConfig *types.FileSystemConfig) (string, error)
- func GetLvpProvider(fsConfig *types.FileSystemConfig) string
- func IsFileSystemMinioDisabled(kotsadmNamespace string) (bool, error)
- func ListAllBackups(ctx context.Context, options ListInstanceBackupsOptions) ([]velerov1.Backup, error)
- func ListInstanceBackups(ctx context.Context, options ListInstanceBackupsOptions) ([]velerov1.Backup, error)
- func ListInstanceRestores(ctx context.Context, options ListInstanceRestoresOptions) ([]velerov1.Restore, error)
- func Redact(store *types.Store) error
- func RestoreInstanceBackup(ctx context.Context, options RestoreInstanceBackupOptions) error
- func RevertToMinioFS(ctx context.Context, kotsadmNamespace, veleroNamespace string, ...) error
- func TryGetVeleroNamespaceFromConfigMap(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) string
- func UpdateBackupStorageLocation(ctx context.Context, veleroNamespace string, ...) error
- func ValidateFileSystemDeployment(ctx context.Context, clientset kubernetes.Interface, ...) (bool, bool, error)
- func WaitForDefaultBslAvailableAndSynced(ctx context.Context, veleroNamespace string, start metav1.Time) error
- type BackupResponse
- type ConfigureStoreOptions
- type CreateInstanceBackupOptions
- type FileSystemDeployOptions
- type HostPathNotFoundError
- type InvalidStoreDataError
- type ListInstanceBackupsOptions
- type ListInstanceRestoresOptions
- type ResetFileSystemError
- type RestoreInstanceBackupOptions
- type ValidateStoreOptions
- type VeleroRBACResponse
- type VeleroStatus
Constants ¶
const (
FileSystemMinioConfigMapName, FileSystemMinioSecretName = "kotsadm-fs-minio", "kotsadm-fs-minio-creds"
FileSystemMinioDeploymentName, FileSystemMinioServiceName = "kotsadm-fs-minio", "kotsadm-fs-minio"
FileSystemMinioProvider, FileSystemMinioBucketName, FileSystemMinioRegion = "aws", "velero", "minio"
FileSystemMinioServicePort = 9000
)
const ( DefaultBackupStorageLocationName = "default" CloudCredentialsSecretName = "cloud-credentials" RegistryImagePullSecretName = "registry-credentials" SnapshotMigrationArtifactName = "kotsadm-velero-migration" SnapshotStoreHostPathProvider = "replicated.com/hostpath" SnapshotStoreNFSProvider = "replicated.com/nfs" SnapshotStorePVCProvider = "replicated.com/pvc" SnapshotStorePVCBucket = "velero-internal-snapshots" )
const (
FileSystemLVPConfigMapName = "kotsadm-fs-lvp"
)
const (
VeleroNamespaceConfigMapName = "kotsadm-velero-namespace"
)
Variables ¶
This section is empty.
Functions ¶
func BuildAWSCredentials ¶
func BuildLvpStoreFileSystem ¶
func BuildLvpStoreFileSystem(config *types.FileSystemConfig) *types.StoreFileSystem
func BuildMinioStoreFileSystem ¶
func BuildMinioStoreFileSystem(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) (*types.StoreFileSystem, error)
func ConfigureStore ¶
func CreateFileSystemMinioBucket ¶
func CreateFileSystemMinioBucket(ctx context.Context, clientset kubernetes.Interface, namespace string, registryConfig kotsadmtypes.RegistryConfig) error
func DeleteFileSystemMinio ¶
DeleteFileSystemMinio cleans up the minio resources for hostpath and nfs snapshot deployments. The secret is not deleted, just in case.
func DeployFileSystemLvp ¶
func DeployFileSystemLvp(ctx context.Context, clientset kubernetes.Interface, deployOptions FileSystemDeployOptions, registryConfig kotsadmtypes.RegistryConfig) error
func DeployFileSystemMinio ¶
func DeployFileSystemMinio(ctx context.Context, clientset kubernetes.Interface, deployOptions FileSystemDeployOptions, registryConfig kotsadmtypes.RegistryConfig) error
func DetectVeleroNamespace ¶
func DetectVeleroNamespace(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) (string, error)
DetectVeleroNamespace will detect and validate the velero namespace kotsadmNamespace is only required in minimal rbac installations. if empty, cluster scope privileges will be needed to detect and validate velero
func EnsureLocalVolumeProviderConfigMaps ¶ added in v1.91.1
func EnsureLocalVolumeProviderConfigMaps(deployOptions FileSystemDeployOptions, veleroNamespace string) error
EnsureLocalVolumeProviderConfigMaps ensures two configmaps: one customizes the LVP plugin deployment with a config map based on the chosen file system backing and the detection of Openshift. This ensures that Velero and NodeAgent have permissions to write to the disk. the second config map is used to store the current file system configuration.
func EnsureVeleroPermissions ¶
func FindBackupStoreLocation ¶
func FindBackupStoreLocation(ctx context.Context, kotsadmNamespace string) (*velerov1.BackupStorageLocation, error)
FindBackupStoreLocation will find the backup storage location used by velero kotsadmNamespace is only required in minimal rbac installations. if empty, cluster scope privileges will be needed to detect and validate velero
func GetFileSystemMinioErrors ¶
func GetFileSystemMinioErrors(ctx context.Context, clientset kubernetes.Interface) map[string]string
Finds the latest FS utility pod of every kind and looks for errors in the events for the pods.
func GetGlobalStore ¶
func GetGlobalStore(ctx context.Context, kotsadmNamespace string, bsl *velerov1.BackupStorageLocation) (*types.Store, error)
GetGlobalStore will return the global store from the current backup storage location or will find it, if the param is nil
func GetLvpBucket ¶
func GetLvpBucket(fsConfig *types.FileSystemConfig) (string, error)
GetLvpBucket returns the bucket/volume name used for the LVP backup. It includes a hash of the Filesystem configuration
func GetLvpProvider ¶
func GetLvpProvider(fsConfig *types.FileSystemConfig) string
GetLvpProvider returns the name of the Lvp provider corresponding to the desired filesystem configuration
func IsFileSystemMinioDisabled ¶
IsFileSystemMinioDisable returns the value of an internal KOTS config map entry indicating if this installation has opted in or out of migrating from Minio to the LVP plugin.
func ListAllBackups ¶
func ListInstanceBackups ¶
func ListInstanceRestores ¶
func RestoreInstanceBackup ¶
func RestoreInstanceBackup(ctx context.Context, options RestoreInstanceBackupOptions) error
func RevertToMinioFS ¶
func RevertToMinioFS(ctx context.Context, kotsadmNamespace, veleroNamespace string, previousBsl *velerov1api.BackupStorageLocation) error
RevertToMinioFS will apply the spec of the previous BSL to the current one and then update. Used for recovery during a failed migration from Minio to LVP.
func TryGetVeleroNamespaceFromConfigMap ¶
func TryGetVeleroNamespaceFromConfigMap(ctx context.Context, clientset kubernetes.Interface, kotsadmNamespace string) string
TryGetVeleroNamespaceFromConfigMap in the case of minimal rbac installations, a configmap containing the velero namespace will be created once the user gives kotsadm access to velero using the cli
func UpdateBackupStorageLocation ¶
func UpdateBackupStorageLocation(ctx context.Context, veleroNamespace string, bsl *velerov1.BackupStorageLocation) error
UpdateBackupStorageLocation applies an updated Velero backup storage location resource to the cluster
func ValidateFileSystemDeployment ¶
func ValidateFileSystemDeployment(ctx context.Context, clientset kubernetes.Interface, deployOptions FileSystemDeployOptions, registryConfig kotsadmtypes.RegistryConfig) (bool, bool, error)
func WaitForDefaultBslAvailableAndSynced ¶
func WaitForDefaultBslAvailableAndSynced(ctx context.Context, veleroNamespace string, start metav1.Time) error
WaitForDefaultBslAvailableAndSynced blocks execution until the default backup storage location to display a status as "AVAILABLE" and also until the backups in the location are available through the Velero api. There is a timeout of 5 minutes, though the default Velero sync time is only 1 minute.
Types ¶
type BackupResponse ¶
type BackupResponse struct { Success bool `json:"success"` BackupName string `json:"backupName,omitempty"` Error string `json:"error,omitempty"` }
func CreateInstanceBackup ¶
func CreateInstanceBackup(ctx context.Context, options CreateInstanceBackupOptions) (*BackupResponse, error)
type ConfigureStoreOptions ¶
type ConfigureStoreOptions struct { Provider string Bucket string Path string CACertData []byte AWS *types.StoreAWS Google *types.StoreGoogle Azure *types.StoreAzure Other *types.StoreOther Internal bool FileSystem *types.FileSystemConfig KotsadmNamespace string RegistryConfig *kotsadmtypes.RegistryConfig // If set to true, will validate the endpoint and the bucket using a pod instead (when applicable). // Will be ignored if SkipValidation is set to true. ValidateUsingAPod bool SkipValidation bool IsMinioDisabled bool }
type FileSystemDeployOptions ¶
type FileSystemDeployOptions struct { Namespace string IsOpenShift bool ForceReset bool FileSystemConfig types.FileSystemConfig }
type HostPathNotFoundError ¶
type HostPathNotFoundError struct {
Message string
}
func (HostPathNotFoundError) Error ¶
func (e HostPathNotFoundError) Error() string
type InvalidStoreDataError ¶
type InvalidStoreDataError struct {
Message string
}
func (*InvalidStoreDataError) Error ¶
func (e *InvalidStoreDataError) Error() string
type ListInstanceBackupsOptions ¶
type ListInstanceBackupsOptions struct {
Namespace string
}
type ListInstanceRestoresOptions ¶
type ListInstanceRestoresOptions struct {
Namespace string
}
type ResetFileSystemError ¶
type ResetFileSystemError struct {
Message string
}
func (ResetFileSystemError) Error ¶
func (e ResetFileSystemError) Error() string
type ValidateStoreOptions ¶
type ValidateStoreOptions struct { KotsadmNamespace string RegistryConfig *kotsadmtypes.RegistryConfig CACertData []byte // If set to true, will validate the endpoint and the bucket using a pod instead (when applicable) ValidateUsingAPod bool }
type VeleroRBACResponse ¶
type VeleroStatus ¶
type VeleroStatus struct { Version string Plugins []string Status string Namespace string VeleroPod string NodeAgentPods []string NodeAgentVersion string NodeAgentStatus string }
func DetectVelero ¶
func DetectVelero(ctx context.Context, kotsadmNamespace string) (*VeleroStatus, error)
func (*VeleroStatus) ContainsPlugin ¶
func (s *VeleroStatus) ContainsPlugin(plugin string) bool