Documentation ¶
Index ¶
- Constants
- Variables
- func Add(mgr manager.Manager) error
- func AddFinalizer(obj metav1.Object, name string)
- func CreateNewDataVolume(client k8sclient.Client, sourceDvName, targetDvName, ns string, ...) error
- func GetRsyncPodBackOffLimit(dvm *migapi.DirectVolumeMigration) int
- func GetRsyncPodSelector(pvcName string) map[string]string
- func HasFinalizer(object metav1.Object, value string) bool
- func RemoveFinalizer(obj metav1.Object, name string)
- func Union(m1 map[string]string, m2 map[string]string) map[string]string
- type ExtraOpts
- type HardLinks
- type Itinerary
- type Partial
- type ReconcileDirectVolumeMigration
- type RsyncBwLimit
- type Step
- type Task
- type VirtualMachineMappings
Constants ¶
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" )
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" )
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" DeleteStaleVirtualMachineInstanceMigrations = "DeleteStaleVirtualMachineInstanceMigrations" )
Phases
const ( DirectVolumeMigration = "directvolumemigration" DirectVolumeMigrationRsyncTransfer = "directvolumemigration-rsync-transfer" DirectVolumeMigrationRsyncTransferBlock = "directvolumemigration-rsync-transfer-block" DirectVolumeMigrationRsyncConfig = "directvolumemigration-rsync-config" DirectVolumeMigrationRsyncCreds = "directvolumemigration-rsync-creds" DirectVolumeMigrationRsyncTransferSvc = "directvolumemigration-rsync-transfer-svc" DirectVolumeMigrationRsyncTransferSvcBlock = "directvolumemigration-rsync-transfer-svc-block" DirectVolumeMigrationRsyncTransferRoute = "dvm" DirectVolumeMigrationRsyncTransferRouteBlock = "dvm-block" 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) MigrationSourceFor = "migration.openshift.io/source-for-directvolumemigration" // (dvm UID) )
labels
const ( VolumeMigrationItinerary = "VolumeMigration" VolumeMigrationFailedItinerary = "VolumeMigrationFailed" VolumeMigrationRollbackItinerary = "VolumeMigrationRollback" )
Itinerary names
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" LiveMigrationsPending = "LiveMigrationsPending" Succeeded = "Succeeded" SourceToDestinationNetworkError = "SourceToDestinationNetworkError" FailedCreatingRsyncPods = "FailedCreatingRsyncPods" FailedDeletingRsyncPods = "FailedDeletingRsyncPods" RsyncServerPodsRunningAsNonRoot = "RsyncServerPodsRunningAsNonRoot" )
Types
const ( NotFound = "NotFound" NotSet = "NotSet" NotDistinct = "NotDistinct" NotReady = "NotReady" RsyncTimeout = "RsyncTimedOut" RsyncNoRouteToHost = "RsyncNoRouteToHost" NotSupported = "NotSupported" )
Reasons
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
Categories
const ( True = migapi.True False = migapi.False )
Statuses
const (
// RsyncAttemptLabel is used to associate an Rsync Pod with the attempts
RsyncAttemptLabel = "migration.openshift.io/rsync-attempt"
)
labels
const (
VMIKind = "VirtualMachineInstance"
)
Variables ¶
var ( ErrVolumesDoNotMatch = errors.New("volumes do not match") ErrNamespacesDoNotMatch = errors.New("source and target namespaces must match") )
var FailedItinerary = Itinerary{ Name: VolumeMigrationFailedItinerary, Steps: []Step{ {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, }, }
var FastReQ = time.Duration(time.Millisecond * 100)
Requeue
var NoReQ = time.Duration(0)
var PollReQ = time.Duration(time.Second * 3)
var RollbackItinerary = Itinerary{ Name: VolumeMigrationRollbackItinerary, 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 */}, }, }
var VolumeMigration = Itinerary{ Name: VolumeMigrationItinerary, 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 */}, {/* contains filtered or unexported fields */}, }, }
Functions ¶
func Add ¶
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 AddFinalizer ¶
AddFinalizer adds a finalizer to a resource
func CreateNewDataVolume ¶
func GetRsyncPodBackOffLimit ¶
func GetRsyncPodBackOffLimit(dvm *migapi.DirectVolumeMigration) int
func GetRsyncPodSelector ¶
GetRsyncPodSelector returns pod selector used to identify sibling Rsync pods
func HasFinalizer ¶
HasFinalizer returns true if a resource has a specific finalizer
func RemoveFinalizer ¶
RemoveFinalizer removes a finalizer from a resource
Types ¶
type ExtraOpts ¶
type ExtraOpts []string
func (ExtraOpts) ApplyTo ¶
func (e ExtraOpts) ApplyTo(opts *rsynctransfer.TransferOptions) error
type HardLinks ¶
type HardLinks bool
func (HardLinks) ApplyTo ¶
func (h HardLinks) ApplyTo(opts *rsynctransfer.TransferOptions) error
type Partial ¶
type Partial bool
func (Partial) ApplyTo ¶
func (p Partial) ApplyTo(opts *rsynctransfer.TransferOptions) error
type ReconcileDirectVolumeMigration ¶
type ReconcileDirectVolumeMigration struct { *rest.Config client.Client // contains filtered or unexported fields }
ReconcileDirectVolumeMigration reconciles a DirectVolumeMigration object
func (*ReconcileDirectVolumeMigration) Reconcile ¶
func (r *ReconcileDirectVolumeMigration) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
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 ¶
func (r RsyncBwLimit) ApplyTo(opts *rsynctransfer.TransferOptions) error
type Task ¶
type Task struct { Log logr.Logger Client k8sclient.Client PrometheusAPI prometheusv1.API 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 VirtualMachineMappings VirtualMachineMappings PromQuery func(ctx context.Context, query string, ts time.Time, opts ...prometheusv1.Option) (model.Value, prometheusv1.Warnings, error) 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.
type VirtualMachineMappings ¶
type VirtualMachineMappings struct {
// contains filtered or unexported fields
}