directvolumemigration

package
v0.0.0-...-ec8378c Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRANSFER_POD_CPU_LIMIT       = "TRANSFER_POD_CPU_LIMIT"
	TRANSFER_POD_MEMORY_LIMIT    = "TRANSFER_POD_MEMORY_LIMIT"
	TRANSFER_POD_CPU_REQUESTS    = "TRANSFER_POD_CPU_REQUEST"
	TRANSFER_POD_MEMORY_REQUESTS = "TRANSFER_POD_MEMORY_REQUEST"
	CLIENT_POD_CPU_LIMIT         = "CLIENT_POD_CPU_LIMIT"
	CLIENT_POD_MEMORY_LIMIT      = "CLIENT_POD_MEMORY_LIMIT"
	CLIENT_POD_CPU_REQUESTS      = "CLIENT_POD_CPU_REQUEST"
	CLIENT_POD_MEMORY_REQUESTS   = "CLIENT_POD_MEMORY_REQUEST"
)
View Source
const (
	// DefaultStunnelTimout is when stunnel timesout on establishing connection from source to destination.
	//  When this timeout is reached, the rsync client will still see "connection reset by peer". It is a red-herring
	// it does not conclusively mean the destination rsyncd is unhealthy but stunnel is dropping this in between
	DefaultStunnelTimeout = 20
	// DefaultRsyncBackOffLimit defines default limit on number of retries on Rsync Pods
	DefaultRsyncBackOffLimit = 20
	// DefaultRsyncOperationConcurrency defines number of Rsync operations that can be processed concurrently
	DefaultRsyncOperationConcurrency = 5
	// PendingPodWarningTimeLimit time threshold for Rsync Pods in Pending state to show warning
	PendingPodWarningTimeLimit = 10 * time.Minute
	// SuperPrivilegedContainerType is the selinux SPC type string
	SuperPrivilegedContainerType = "spc_t"
)
View Source
const (
	Created                              = ""
	Started                              = "Started"
	Prepare                              = "Prepare"
	CleanStaleRsyncResources             = "CleanStaleRsyncResources"
	CreateDestinationNamespaces          = "CreateDestinationNamespaces"
	DestinationNamespacesCreated         = "DestinationNamespacesCreated"
	CreateDestinationPVCs                = "CreateDestinationPVCs"
	DestinationPVCsCreated               = "DestinationPVCsCreated"
	CreateStunnelConfig                  = "CreateStunnelConfig"
	CreateRsyncConfig                    = "CreateRsyncConfig"
	CreateRsyncRoute                     = "CreateRsyncRoute"
	EnsureRsyncRouteAdmitted             = "EnsureRsyncRouteAdmitted"
	CreateRsyncTransferPods              = "CreateRsyncTransferPods"
	WaitForRsyncTransferPodsRunning      = "WaitForRsyncTransferPodsRunning"
	CreatePVProgressCRs                  = "CreatePVProgressCRs"
	RunRsyncOperations                   = "RunRsyncOperations"
	DeleteRsyncResources                 = "DeleteRsyncResources"
	WaitForRsyncResourcesTerminated      = "WaitForRsyncResourcesTerminated"
	WaitForStaleRsyncResourcesTerminated = "WaitForStaleRsyncResourcesTerminated"
	Completed                            = "Completed"
	MigrationFailed                      = "MigrationFailed"
)

Phases

View Source
const (
	DirectVolumeMigration                   = "directvolumemigration"
	DirectVolumeMigrationRsyncTransfer      = "directvolumemigration-rsync-transfer"
	DirectVolumeMigrationRsyncConfig        = "directvolumemigration-rsync-config"
	DirectVolumeMigrationRsyncCreds         = "directvolumemigration-rsync-creds"
	DirectVolumeMigrationRsyncTransferSvc   = "directvolumemigration-rsync-transfer-svc"
	DirectVolumeMigrationRsyncTransferRoute = "dvm"
	DirectVolumeMigrationStunnelConfig      = "crane2-stunnel-config"
	DirectVolumeMigrationStunnelCerts       = "crane2-stunnel-secret"
	DirectVolumeMigrationRsyncPass          = "directvolumemigration-rsync-pass"
	DirectVolumeMigrationStunnelTransfer    = "directvolumemigration-stunnel-transfer"
	DirectVolumeMigrationRsync              = "rsync"
	DirectVolumeMigrationRsyncClient        = "rsync-client"
	DirectVolumeMigrationStunnel            = "stunnel"
	MigratedByDirectVolumeMigration         = "migration.openshift.io/migrated-by-directvolumemigration" // (dvm UID)
)

labels

View Source
const (
	InvalidSourceClusterRef         = "InvalidSourceClusterRef"
	InvalidDestinationClusterRef    = "InvalidDestinationClusterRef"
	InvalidSourceCluster            = "InvalidSourceCluster"
	InvalidDestinationCluster       = "InvalidDestinationCluster"
	InvalidPVCs                     = "InvalidPVCs"
	SourceClusterNotReady           = "SourceClusterNotReady"
	DestinationClusterNotReady      = "DestinationClusterNotReady"
	PVCsNotFoundOnSourceCluster     = "PodsNotFoundOnSourceCluster"
	StunnelClientPodsPending        = "StunnelClientPodsPending"
	RsyncTransferPodsPending        = "RsyncTransferPodsPending"
	RsyncRouteNotAdmitted           = "RsyncRouteNotAdmitted"
	Running                         = "Running"
	Failed                          = "Failed"
	RsyncClientPodsPending          = "RsyncClientPodsPending"
	Succeeded                       = "Succeeded"
	SourceToDestinationNetworkError = "SourceToDestinationNetworkError"
	FailedCreatingRsyncPods         = "FailedCreatingRsyncPods"
	FailedDeletingRsyncPods         = "FailedDeletingRsyncPods"
	RsyncServerPodsRunningAsNonRoot = "RsyncServerPodsRunningAsNonRoot"
)

Types

View Source
const (
	NotFound           = "NotFound"
	NotSet             = "NotSet"
	NotDistinct        = "NotDistinct"
	NotReady           = "NotReady"
	RsyncTimeout       = "RsyncTimedOut"
	RsyncNoRouteToHost = "RsyncNoRouteToHost"
)

Reasons

View Source
const (
	ReadyMessage                              = "Direct migration is ready"
	RunningMessage                            = "Step: %d/%d"
	InvalidSourceClusterReferenceMessage      = "The source cluster reference is invalid"
	InvalidDestinationClusterReferenceMessage = "The destination cluster reference is invalid"
	InvalidSourceClusterMessage               = "The source cluster is invalid"
	InvalidDestinationClusterMessage          = "The destination cluster is invalid"
	InvalidPVCsMessage                        = "The set of persistent volume claims is invalid"
	SourceClusterNotReadyMessage              = "The source cluster is not ready"
	DestinationClusterNotReadyMessage         = "The destination cluster is not ready"
	PVCsNotFoundOnSourceClusterMessage        = "The set of pvcs were not found on source cluster"
	SucceededMessage                          = "The migration has succeeded"
	FailedMessage                             = "The migration has failed.  See: Errors."
)

Messages

View Source
const (
	Critical = migapi.Critical
	Advisory = migapi.Advisory
	Warn     = migapi.Warn
)

Categories

View Source
const (
	True  = migapi.True
	False = migapi.False
)

Statuses

View Source
const (
	// RsyncAttemptLabel is used to associate an Rsync Pod with the attempts
	RsyncAttemptLabel = "migration.openshift.io/rsync-attempt"
)

labels

Variables

View Source
var FailedItinerary = Itinerary{
	Name: "VolumeMigrationFailed",
	Steps: []Step{
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
	},
}
View Source
var FastReQ = time.Duration(time.Millisecond * 100)

Requeue

View Source
var NoReQ = time.Duration(0)
View Source
var PollReQ = time.Duration(time.Second * 3)
View Source
var VolumeMigration = Itinerary{
	Name: "VolumeMigration",
	Steps: []Step{
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
		{/* contains filtered or unexported fields */},
	},
}

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new DirectVolumeMigration Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func GetRsyncPodBackOffLimit

func GetRsyncPodBackOffLimit(dvm migapi.DirectVolumeMigration) int

func GetRsyncPodSelector

func GetRsyncPodSelector(pvcName string) map[string]string

GetRsyncPodSelector returns pod selector used to identify sibling Rsync pods

func Union

func Union(m1 map[string]string, m2 map[string]string) map[string]string

Types

type ExtraOpts

type ExtraOpts []string

func (ExtraOpts) ApplyTo

func (e ExtraOpts) ApplyTo(opts *rsynctransfer.TransferOptions) error
type HardLinks bool

func (HardLinks) ApplyTo

func (h HardLinks) ApplyTo(opts *rsynctransfer.TransferOptions) error

type Itinerary

type Itinerary struct {
	Name  string
	Steps []Step
}

type Partial

type Partial bool

func (Partial) ApplyTo

func (p Partial) ApplyTo(opts *rsynctransfer.TransferOptions) error

type ReconcileDirectVolumeMigration

type ReconcileDirectVolumeMigration struct {
	client.Client
	// contains filtered or unexported fields
}

ReconcileDirectVolumeMigration reconciles a DirectVolumeMigration object

func (*ReconcileDirectVolumeMigration) Reconcile

Reconcile reads that state of the cluster for a DirectVolumeMigration object and makes changes based on the state read and what is in the DirectVolumeMigration.Spec a Deployment as an example Automatically generate RBAC rules to allow the Controller to read and write Deployments +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get;update;patch +kubebuilder:rbac:groups=migration.openshift.io,resources=directvolumemigrations,verbs=get;list;watch;create;update;patch;delete; +kubebuilder:rbac:groups=migration.openshift.io,resources=directvolumemigrations/status,verbs=get;update;patch

type RsyncBwLimit

type RsyncBwLimit int

func (RsyncBwLimit) ApplyTo

type Step

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

Step

type Task

type Task struct {
	Log    logr.Logger
	Client k8sclient.Client

	Owner                        *migapi.DirectVolumeMigration
	SSHKeys                      *sshKeys
	EndpointType                 migapi.EndpointType
	RsyncRoutes                  map[string]string
	Phase                        string
	PhaseDescription             string
	PlanResources                *migapi.PlanResources
	Requeue                      time.Duration
	Itinerary                    Itinerary
	Errors                       []string
	SparseFileMap                sparseFilePVCMap
	SourceLimitRangeMapping      limitRangeMap
	DestinationLimitRangeMapping limitRangeMap

	Tracer        opentracing.Tracer
	ReconcileSpan opentracing.Span
	// contains filtered or unexported fields
}

A task that provides the complete migration workflow. Log - A controller's logger. Client - A controller's (local) client. Owner - A DirectVolumeMigration resource. Phase - The task phase. Requeue - The requeueAfter duration. 0 indicates no requeue. Itinerary - The phase itinerary. Errors - Migration errors. Failed - Task phase has failed.

func (*Task) Run

func (t *Task) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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