Migration and portability
Inventory what will actually move
Migrating a Kubernetes application means moving desired configuration, dependencies, data and traffic, not merely exporting YAML. For the bookstore, inventory Deployments, Services, RBAC, ConfigMaps, secret references, CRDs, operators, PVCs, DNS, registry, external databases and cloud IAM bindings. Prefer reviewed source manifests. Exclude generated status, resourceVersion, UID and controller-owned objects that should be recreated. Do not copy real Secret values into export bundles. An API export is not a backup of the external disk or database.
catalog Deployment -> redeploy reviewed sourceorders PVC -> restore verified backup to target storagecloud identity -> configure target trustDNS -> staged cutover planAdapt APIs, identity and storage
Check served APIs on the intended target and convert removed versions using the official deprecation guide. Historical example: networking.k8s.io/v1beta1 Ingress stopped being served in v1.22; v1 requires updated backend fields and pathType. Install compatible CRDs and controllers before custom resources. Keep stable workload manifests in a base and provider-specific settings in overlays. Map EKS Pod Identity or IRSA, AKS Microsoft Entra Workload ID and GKE Workload Identity Federation to separate target configurations. Matching ServiceAccount names alone do not establish cloud trust. Recreate least-privilege bindings and test both allowed and denied access. A StorageClass name or source volumeHandle does not make the backing volume portable. Choose the target driver and restore method deliberately.
Source: cloud IAM binding + source disk handleTarget: new trust binding + target PVC + restored dataKeep: application identity intent and resource requestsReplace: provider-specific identifiers and annotationsRehearse data recovery
Define recovery point objective (RPO), the maximum acceptable data loss expressed as time, and recovery time objective (RTO), the target restoration duration. With a last consistent recovery point at minute 90 and cutover at minute 100, the possible data-loss window is 10 minutes. If RPO is 5 minutes, hold the migration. If validation and restoration take 25 minutes against an RTO of 30 minutes, that one timing gate passes. Include write quiescence or a verified replication protocol, integrity checks, application-level reconciliation and permissions. A checksum match proves byte equality of the tested artifact, not full database correctness.
Cutover minute: 100; last consistent data: 90RPO limit: 5 min; observed gap: 10 min -> HOLDRecovery: 25 min; RTO limit: 30 min -> pass timing gateCut over traffic and retain a safe recovery path
Prepare the target, restore data, verify health and access, then test a controlled traffic shift. DNS TTL and client caching can delay traffic changes. For stateful workloads use an explicit single-writer rule unless the application supports coordinated multi-writer replication. Stop promotion on missing telemetry or failed data checks. Before target writes, routing back may be safe if the source remains healthy and authoritative. After target writes, routing back without reconciling new data can lose accepted transactions. Hold and follow the approved recovery plan instead. Database and DNS rollback are distinct from Deployment rollback.
Before target writes: source healthy + authoritative -> rollback candidateAfter target writes: no verified reverse sync -> HOLDAfter target writes: reconciled data + approved recovery -> rollback candidateVerify and retire deliberately
Record exact versions, controllers, policy decisions, restore results, application tests and the owner of each gate. Verify successful and denied requests, business invariants, error rate and latency, not just Ready Pods. Keep the source protected until the rollback window closes and the data owner signs off. Then remove only reviewed lab-owned resources and check lingering disks, snapshots, load balancers and credentials. This chapter is an offline planning exercise; it does not authorize actual migration or claim that a cloud provider supports the fictional workload.
Gate: API compatibility, identity, restore, RPO/RTO, telemetryGate: single writer, rollback plan, approvalAny missing or failed gate -> HOLDFurther reading
- https://docs.aws.amazon.com/prescriptive-guidance/latest/migrating-self-managed-kubernetes-cluster-to-amazon-eks/pre-migration-checklist.html — EKS migration inventory and preflight
- https://docs.aws.amazon.com/prescriptive-guidance/latest/migrating-self-managed-kubernetes-cluster-to-amazon-eks/best-practices.html — EKS migration dependencies
- https://learn.microsoft.com/en-us/azure/architecture/aws-professional/eks-to-aks/migrate — EKS to AKS migration and persistent data
- https://learn.microsoft.com/en-us/azure/architecture/aws-professional/eks-to-aks/workload-identity — EKS and AKS identity differences
- https://docs.cloud.google.com/kubernetes-engine/docs/how-to/prepare-migrate-cluster-mode — GKE migration planning
- https://kubernetes.io/docs/reference/using-api/deprecation-guide/ — Removed API versions and migration
- https://kubernetes.io/docs/concepts/storage/storage-classes/ — Storage provisioners and reclaim policy
- https://kubernetes.io/docs/concepts/storage/persistent-volumes/ — Persistent volumes and external storage lifecycle
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Migration and portability — knowledge check
Identify provider-specific dependencies and test plan
Which item is not backed up merely by exporting a PVC manifest?
What should happen before deploying a custom resource?
Last consistent data is at minute 90 and cutover is minute 100; RPO is five minutes. What is the decision?
Target has accepted writes but reverse synchronization is unverified. What is safest?
Does a matching ServiceAccount name guarantee cloud access on the target?