Voiced by Amazon Polly |
Introduction
Kubernetes Migration Factory (KMF) is a powerful tool designed to simplify and accelerate the migration of Kubernetes workloads to Amazon EKS. Built with Golang, KMF offers a command-line interface (CLI) that orchestrates and automates complex migration tasks, reducing the process from weeks of manual effort to just minutes.
With minimal input through the CLI, users can configure, launch, and track migration plans for their existing container platforms. KMF scans the source environment, generates a detailed blueprint of running workloads, and lists all the Kubernetes resources to be created on the target Amazon EKS cluster.
The tool understands source platform configurations and automatically adjusts manifest files to ensure compatibility with Amazon EKS. It can also suggest AWS-native services by analyzing existing workloads and recommending equivalent AWS resources. Additionally, KMF provides data plane setup recommendations based on current cluster metadata, making migrations smoother and more efficient.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Prerequisites
- Azure AKS Cluster (Source)
- Amazon EKS Cluster (Destination)
- Install Go
- Download Kubernetes Migration Factory – https://github.com/awslabs/aws-kubernetes-migration-factory.git
- AWS CLI, EKSCTL, and Kubectl tools need to be installed on your workstation
- For AWS CLI installation, refer to the AWS documentation
- For EKSCTL installation, refer to the EKSCTL documentation
- For Kubectl installation, refer to the Kubernetes documentation
Note: Here, we will be using a Virtual Machine (Azure) and an Amazon EC2 Instance to install the prerequisites.
Creating and Managing Azure Kubernetes Service (AKS) Clusters with Application Migration Using Kubernetes Migration Factory (KMF)
Installing Go
Before beginning, ensure Go is installed on your system:
- Download Go:
1 |
curl -OL https://golang.org/dl/go1.16.7.linux-amd64.tar.gz |
2. Verify the download:
1 |
sha256sum go1.16.7.linux-amd64.tar.gz |
3. Extract the archive:
1 |
sudo tar -C /usr/local -xvf go1.16.7.linux-amd64.tar.gz |
4. Set Go’s path in your environment:
1 |
sudo nano ~/.profile |
5. Add the following line to the end of the file:
1 |
export PATH=$PATH:/usr/local/go/bin |
6. Apply the changes:
1 |
source ~/.profile |
7. Verify the installation:
go version
Creating an AKS Cluster
Azure Kubernetes Service (AKS) provides a managed Kubernetes environment that simplifies the deployment and management of containerized applications. To create an AKS cluster:
- Follow the official Microsoft documentation at: https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-portal?tabs=azure-cli
- You can create a cluster using the Azure portal or Azure CLI based on your preference.
After creating your AKS cluster, you’ll need to authenticate and configure your environment:
- Authenticate to Azure:
1 |
az login |
This command will provide a URL and passcode to authenticate your Azure account.
2. Configure kubectl to communicate with your AKS cluster:
1 |
az aks get-credentials --resource-group AKSResourceGrp --name MyAKScluster |
This command downloads the kubeconfig file needed to access your cluster.
Setting Up Kubernetes Migration Factory
The Kubernetes Migration Factory (KMF) is a tool designed to streamline the migration of applications to Kubernetes environments.
- Clone the repository:
1 |
git clone https://github.com/awslabs/aws-kubernetes-migration-factory.git |
2. Navigate to the project directory:
1 |
cd kubernetes-migration-factory/ |
3. Build the KMF binary:
1 |
go build |
This builds the binary in the current directory as “containers-migration-factory”.
- Alternatively, create a shorter name for the binary:
1 2 3 4 5 |
go build -o ./bin/kmf Verify the binary was created: ls -l ./bin/kmf |
Troubleshooting Dependencies
If you encounter dependency issues during the build process:
- Download dependencies:
1 |
go mod download |
2. Tidy up dependencies:
1 |
go mod tidy |
3. Rebuild the project after resolving dependencies.
Deploying Sample Applications
To test your AKS cluster with a sample application:
- Follow the Microsoft guide for deploying sample applications: https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-portal?tabs=azure-cli
- This will walk you through deploying, exposing, and testing a basic application on your new Kubernetes cluster.
Running KMF CLI
Running with a Config config.ini
From the operating system path from where you are making calls to ./bin/kmf, mAKS sure that you have a file with the name config.ini and provide all the required information. A sample config.ini file looks like below:
1 |
https://github.com/awslabs/aws-kubernetes-migration-factory/blob/main/config.ini |
To access the destination cluster, Update the Kubeconfig of the Amazon EKS cluster from the source cluster.
Screenshot of k8 resources running on the destination cluster
Screenshot of k8 resources running on the source cluster
We can migrate the required resources to the Amazon EKS cluster with the following command.
1 |
./bin/kmf --source_kubeconfig /home/azureuser/.kube/config --destination_kubeconfig /home/azureuser/.kube/config --namespaces "default" --resources "deployment, service, secrets, pods" --migrate_images "yes" --reg_names "dockerhub" --source_context MyAKScluster --destination_context arn:aws:eks:ap-southeast-1:730335384723:cluster/demo-eks --source_type AKS --helm_path /home/azureuser/kuberenetes-pocs/helm --action Deploy |
Screenshot of the k8 components migrated to destination cluster (Amazon EKS)
Sample application running as a service as a LoadBalancer
Conclusion
This guide has walked through the essential steps for setting up your AKS environment, installing the necessary tools, and preparing for application migration. By following these steps, you will establish a solid foundation for your Kubernetes infrastructure that can support modern application development practices and enable more efficient operations.
Drop a query if you have any questions regarding Azure Kubernetes Service and we will get back to you quickly.
Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.
- Reduced infrastructure costs
- Timely data-driven decisions
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront, Amazon OpenSearch, AWS DMS, AWS Systems Manager, Amazon RDS, and many more.
FAQs
1. What version of Go is required for KMF?
ANS: – Go version 1.16 or higher is recommended for building the Kubernetes Migration Factory tool.
2. Can we use AKS with existing Azure resources?
ANS: – Yes, AKS can integrate with existing Azure resources such as Virtual Networks, Azure Monitor, and Azure Active Directory.

WRITTEN BY Deepika N
Deepika N works as a Research Associate - DevOps and holds a Master's in Computer Applications. She is interested in DevOps and technologies. She helps clients to deploy highly available and secured application in AWS. Her hobbies are singing and painting.
Comments