title | description | author | ms.author | ms.date | ms.topic | ms.service | ms.subservice | ms.custom | products | categories | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Migrate from Amazon Elastic Kubernetes Service (EKS) to Azure Kubernetes Service (AKS) |
Learn about options for migrating from Amazon EKS to Azure Kubernetes Service (AKS). |
ketan-chawda-msft |
kechaw |
06/05/2024 |
conceptual |
architecture-center |
azure-guide |
|
|
|
This article provides strategies for migrating typical stateless and stateful workloads from Amazon EKS to Azure Kubernetes Service (AKS).
The actual deployment process of a real-world production workload can vary depending on the following factors:
-
Deployment strategies: The choice between GitOps and traditional DevOps Continuous Integration/Continuous Deployment (CI/CD) methods significantly influences the deployment approach. GitOps prioritizes declarative infrastructure managed through version-controlled repositories, while DevOps CI/CD focuses on automated workflows for application delivery.
-
Deployment artifacts: The selection of deployment artifacts plays a crucial role in defining the deployment structure. YAML files, manifest files, Helm charts, and Kustomize configurations represent various approaches to specifying and customizing deployment settings, each with its strengths and use cases.
-
Workload authentication and authorization: Depending on the setup, authentication and authorization methods can differ. You can use Amazon Web Services (AWS) Identity and Access Management (IAM) roles, workload identity mechanisms, or connection strings for access control.
-
Monitoring: Implementation of monitoring solutions is a critical aspect that can involve various tools and methodologies to ensure the performance and health of the deployed workloads. For more information on how AKS monitoring compares to EKS, see Kubernetes monitoring and logging.
Before beginning your migration, review and consider the following general guidance and best-practice resources:
- Review the cluster operator and developer best practices.
- Define the monitoring and alerting strategy to ensure the application is performing as expected.
- Define the security and compliance requirements for the application and the AKS environment.
- Define the access control policies and how they're enforced. Identify any compliance standards that must be adhered to.
- Define the disaster recovery and business continuity plan for the AKS environment and the application.
- Define the backup and restore policies and procedures. Identify the recovery time objective (RTO) and recovery point objective (RPO).
- Identify any risks or challenges that might be encountered during the deployment.
- Test the functionality to ensure the application works as expected before redirecting live traffic to the new AKS cluster.
This section reviews some things you should consider before migrating your workloads from Amazon EKS to AKS.
Analyze the existing EKS environment to understand the current architecture, resources, and configurations.
-
Review EKS configuration: Assess EKS cluster configuration, such as node types, number of nodes, Kubernetes version and support policy, and scaling configuration.
[!NOTE] EKS allows the creation of custom AMI images for EKS nodes. AKS doesn't allow the use of custom node images. If your deployment requires node customization, you can apply kubelet customization and/or DaemonSets to customize your nodes.
-
Review application workloads: Identify all the Kubernetes workloads running on the EKS cluster including deployments, services, stateful sets, ingress configurations, and persistent volume claims. Ensure you have a complete list of applications and their associated resources.
-
Check dependencies: Identify any dependencies on AWS services specific to EKS.
AWS service Dependency AWS Secret Manager Azure Key Vault AWS Guard Duty Agent Microsoft Defender for Containers EKS Pod Identity Agent Microsoft Entra ID Workload Identity Amazon Elastic File System (EFS) or Elastic Block Store (EBS) Container Storage Interface (CSI) drivers AKS CSI Drivers -
Backup EKS cluster: You can use a non-Microsoft tool like Velero to back up and migrate Kubernetes resources and persistent volumes.
The Amazon virtual private cloud (VPC) Container Networking Interface (CNI) is the default networking plugin supported by EKS. An AKS cluster supports multiple network plugins and methods to deploy a cluster in a virtual network, including:
- Kubenet networking (default in AKS)
- Azure CNI Networking
- Azure CNI Overlay
- Azure CNI networking for dynamic allocation
- Azure CNI Powered by Cilium
- Non-Microsoft CNIs
To prepare your AKS cluster, follow these steps:
- Create a new AKS cluster in Azure, configuring the desired networking settings to match your requirements.
- Review your Kubernetes manifests and YAML files used in EKS. Check for any potential Kubernetes API version incompatibility or specific EKS configurations that AKS doesn't support.
- Ensure that your Docker images and container image registry location are accessible from the AKS cluster. Verify network connectivity and any required authentication and authorization settings for accessing the images.
By following these steps, you can successfully create an AKS cluster and ensure compatibility for your Kubernetes manifests and Docker images, ensuring a smooth migration process from EKS to AKS.
Migrating from Amazon EKS to AKS involves several steps, such as:
-
Container image migration: Migrating container images is a crucial step when moving from EKS to AKS. You can use tools like kubectl, Docker, or container registries to export and import images.
- Export Images from EKS.
- Set up an Azure Container Registry and attach it to AKS if you haven't already.
- Push images to Container Registry.
Container images can also be imported into Container Registry directly from a non-Azure public or private repository. For more information, see Import container images.
-
Kubernetes manifest migration: AKS uses the Kubernetes YAML file manifest to define Kubernetes objects. Deployments are typically created and managed with kubectl create or kubectl apply. Create a deployment by defining a manifest file in the YAML format. For more information, see this sample AKS manifest. You can learn more about how YAML files work on Kubernetes by reviewing Deployments and YAML manifests.
-
Data migration: Carefully plan your migration of stateful applications to avoid data loss or unexpected downtime. For more information, see the section Stateful workload migration considerations.
Migrating your Kubernetes manifests involves adapting the configuration to work in the Azure environment, including these steps:
-
Update manifests: Update your Kubernetes manifests to use the new image locations in Container Registry. Replace the image references in your YAML files with the Container Registry path.
- Review your existing Kubernetes manifest files for AWS-specific configurations, such as VPC and IAM roles.
- Review the EKS IAM roles associated with nodes, service accounts, and other resources. Map it with equivalent Azure AKS role-based access control (RBAC) roles. For more information, see Kubernetes workload identity and access.
- Modify the manifest files to replace AWS-specific settings with Azure-specific settings, like annotations.
-
Apply manifests to AKS:
- Connect to AKS Cluster.
- Apply the modified Kubernetes manifest files using
kubectl apply -f
.
If your applications use Persistent Volumes (PVs) or Persistent Volume Claims (PVCs) for data storage, make sure you back up this data. You can use tools like Velero to perform cluster backups, including for PVs and PVCs data. For more information, see Backup and restore your Amazon EKS cluster resources using Velero.
Stateful applications typically have persistent data storage requirements, which add complexity to the migration process. For a comparison of the storage capabilities of Amazon EKS and AKS, see Storage options for a Kubernetes cluster.
Follow these steps to back up persistent data:
- Set up Velero in AKS and EKS cluster.
- Perform a backup of your EKS cluster.
- Copy the Velero backup from S3 bucket to Azure blob storage, by using the az copy command.
- Since AKS and EKS might use different
storageClassNames
for the persistent volume claims, create aconfigMap
that translates the sourcestorageClassNames
to an AKS-compatible class name. You can ignore this step if you're using the same storage solution on the EKS and the AKS Kubernetes clusters. - Restore the backup to AKS (using Velero restore command).
- Apply necessary changes to the restored objects, such as references to container images in Amazon Elastic Container Registry (ECR), or access to secrets.
This article is maintained by Microsoft. It was originally written by the following contributors.
Principal authors:
- Dixit Arora | Senior Customer Engineer, ISV DN CoE
- Ketan Chawda | Senior Customer Engineer, ISV DN CoE
Other contributors:
- Paolo Salvatori | Principal Customer Engineer, ISV & DN CoE
- Anthony Nevico | Principal Cloud Solution Architect
- Francis Simy Nazareth | Senior Technical Specialist
To see non-public LinkedIn profiles, sign in to LinkedIn.
- Migration Guide - Azure Samples
- AKS for Amazon EKS professionals
- Kubernetes identity and access management
- Kubernetes monitoring and logging
- Secure network access to Kubernetes
- Storage options for a Kubernetes cluster
- Cost management for Kubernetes
- Kubernetes node and node pool management
- Cluster governance